Merge branch '2640-folder-api'
[arvados.git] / apps / workbench / app / controllers / api_client_authorizations_controller.rb
index 8eed5526093563e94c546dc6c991aff0aa0665fa..24b4ae3185d4701c7152af5a8f582f2e97ecb424 100644 (file)
@@ -1,2 +1,20 @@
 class ApiClientAuthorizationsController < ApplicationController
+  def index
+    m = model_class.all
+    items_available = m.items_available
+    offset = m.result_offset
+    limit = m.result_limit
+    filtered = m.to_ary.reject do |x|
+      x.api_client_id == 0 or (x.expires_at and x.expires_at < Time.now) rescue false
+    end
+    ArvadosApiClient::patch_paging_vars(filtered, items_available, offset, limit)
+    @objects = ArvadosResourceList.new(ApiClientAuthorization)
+    @objects.results= filtered
+    super
+  end
+
+  def index_pane_list
+    %w(Recent Help)
+  end
+
 end