瀏覽代碼

Always show refresh when caching

Andrew Kane 9 年之前
父節點
當前提交
f2d1546d73
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      app/views/blazer/queries/run.html.erb

+ 7 - 2
app/views/blazer/queries/run.html.erb

@@ -8,9 +8,14 @@
   <% end %>
 <% else %>
   <% unless @only_chart %>
-    <% if @cached_at %>
+    <% if @cached_at || @data_source.cache %>
       <p class="text-muted" style="float: right;">
-        Cached <%= time_ago_in_words(@cached_at, include_seconds: true) %> ago
+        <% if @cached_at %>
+          Cached <%= time_ago_in_words(@cached_at, include_seconds: true) %> ago
+        <% elsif !params[:data_source] %>
+          Cached just now
+        <% end %>
+
         <% if @query && !params[:data_source] %>
           <%= link_to "Refresh", refresh_query_path(@query, variable_params), method: :post %>
         <% end %>