added usage list to providers

This commit is contained in:
Adolfo Gómez García 2017-06-20 08:11:41 +02:00
parent ac245e71e9
commit 09a48c9c5a
3 changed files with 28 additions and 29 deletions

View File

@ -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"

View File

@ -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 /@/, '<span class="text-danger">@</span>', "#{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 /@/, '<span class="text-danger">@</span>', "#{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

View File

@ -29,7 +29,7 @@
<ul class="bottom_tabs nav nav-tabs">
<li class="active"><a href="#{{ provider_info }}" data-toggle="tab">{% endverbatim %}{% trans 'Overview' %}{% verbatim %}</a></li>
<li><a href="#{{ services }}_tab" data-toggle="tab">{% endverbatim %}{% trans 'Services' %}{% verbatim %}</a></li>
<!-- <li><a href="#{{ usage }}_tab" data-toggle="tab">{% endverbatim %}{% trans 'Usage' %}{% verbatim %}</a></li> -->
<li><a href="#{{ usage }}_tab" data-toggle="tab">{% endverbatim %}{% trans 'Usage' %}{% verbatim %}</a></li>
<li><a href="#{{ logs }}" data-toggle="tab">{% endverbatim %}{% trans 'Logs' %}{% verbatim %}</a></li>
</ul>
<div class="tab-content">
@ -47,12 +47,12 @@
</div>
</div>
</div>
<!-- <div class="tab-pane fade" id="{{ usage }}_tab">
<div class="tab-pane fade" id="{{ usage }}_tab">
<div class="row">
<div class="col-xs-12" id="{{ usage }}">
</div>
</div>
</div> -->
</div>
<div class="tab-pane fade" id="{{ logs }}">...</div>
</div>
</div>