From 09a48c9c5a8a61586b85fdb44c9f63dc3b08d9f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Tue, 20 Jun 2017 08:11:41 +0200 Subject: [PATCH] added usage list to providers --- .../uds/static/adm/js/gui-d-calendar.coffee | 3 +- .../uds/static/adm/js/gui-d-services.coffee | 48 +++++++++---------- .../templates/uds/admin/tmpl/providers.html | 6 +-- 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/server/src/uds/static/adm/js/gui-d-calendar.coffee b/server/src/uds/static/adm/js/gui-d-calendar.coffee index 71f19659..6392ca84 100644 --- a/server/src/uds/static/adm/js/gui-d-calendar.coffee +++ b/server/src/uds/static/adm/js/gui-d-calendar.coffee @@ -14,7 +14,7 @@ gui.calendars.link = -> return freqDct = - 'DAILY': [gettext('day'), gettext('days'), gettext('Dayly')] + 'DAILY': [gettext('day'), gettext('days'), gettext('Daily')] 'WEEKLY': [gettext('week'), gettext('weeks'), gettext('Weekly')] 'MONTHLY': [gettext('month'), gettext('months'), gettext('Monthly')] 'YEARLY': [gettext('year'), gettext('years'), gettext('Yearly')] @@ -45,7 +45,6 @@ gui.calendars.link = -> return gettext("(no days)") return res.join(', ') - renderer = (fld, data, type, record) -> # Display "custom" fields of rules table if fld == "interval" diff --git a/server/src/uds/static/adm/js/gui-d-services.coffee b/server/src/uds/static/adm/js/gui-d-services.coffee index 7434492b..c9ca3b37 100644 --- a/server/src/uds/static/adm/js/gui-d-services.coffee +++ b/server/src/uds/static/adm/js/gui-d-services.coffee @@ -216,30 +216,30 @@ gui.providers.link = (event) -> prevTables.push servicesTable prevTables.push logTable - # usageAPI = api.providers.detail(id, "usage", { permission: selected[0].permission }) - # usage = new GuiElement(usageAPI, "usage-" + selected[0].type) - # usageTable = usage.table( - # icon: 'usage' - # container: "usage-placeholder" - # doNotLoadData: true - # rowSelect: "multi" - # - # onData: (data) -> - # $.each data, (index, value) -> - # value.owner = gui.fastLink(value.owner.replace /@/, '@', "#{value.owner_info.auth_id},u#{value.owner_info.user_id}", 'gui.providers.fastLink', 'goAuthLink') - # value.pool = gui.fastLink(value.pool, value.pool_id, 'gui.providers.fastLink', 'goPoolLink') - # - # buttons: [ - # "delete" - # "xls" - # ] - # onDelete: gui.methods.del(usage, gettext("Delete user service"), gettext("User service deletion error"),) - # scrollToTable: false - # onLoad: (k) -> - # gui.tools.unblockUI() - # return - # ) - # prevTables.push usageTable + usageAPI = api.providers.detail(id, "usage", { permission: selected[0].permission }) + usage = new GuiElement(usageAPI, "usage-" + selected[0].type) + usageTable = usage.table( + icon: 'usage' + container: "usage-placeholder" + doNotLoadData: true + rowSelect: "multi" + + onData: (data) -> + $.each data, (index, value) -> + value.owner = gui.fastLink(value.owner.replace /@/, '@', "#{value.owner_info.auth_id},u#{value.owner_info.user_id}", 'gui.providers.fastLink', 'goAuthLink') + value.pool = gui.fastLink(value.pool, value.pool_id, 'gui.providers.fastLink', 'goPoolLink') + + buttons: [ + "delete" + "xls" + ] + onDelete: gui.methods.del(usage, gettext("Delete user service"), gettext("User service deletion error"),) + scrollToTable: false + onLoad: (k) -> + gui.tools.unblockUI() + return + ) + prevTables.push usageTable return diff --git a/server/src/uds/templates/uds/admin/tmpl/providers.html b/server/src/uds/templates/uds/admin/tmpl/providers.html index 85b75e0f..00978f6c 100644 --- a/server/src/uds/templates/uds/admin/tmpl/providers.html +++ b/server/src/uds/templates/uds/admin/tmpl/providers.html @@ -29,7 +29,7 @@
@@ -47,12 +47,12 @@
- +
...