added widget for site count

This commit is contained in:
orbit 2019-03-27 18:29:11 +08:00
parent 4fa49d0b1b
commit 19d9c8b530
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,13 @@
class RegisteredSitesController < ApplicationController
def site_count_widget
count = RegisteredSite.count
{
{
"extras" => {
"total_sites" => count
}
}
}
end
end

View File

@ -4,6 +4,8 @@ module RegisteredSites
OrbitApp.registration "RegisteredSites", :type => "ModuleApp" do
module_label "registered_sites.registered_sites"
base_url File.expand_path File.dirname(__FILE__)
widget_methods ["site_count_widget"]
widget_settings [{"data_count"=>30}]
authorizable
taggable "RegisteredSite"
categorizable