From: Mark Clarkstone Date: Tue, 19 Sep 2017 09:59:56 +0000 (+0100) Subject: webui: add "Clear all statistics" button to Status -> Stream tab. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3bda7c2b43c081636c1086775ae4e8cf8ce45164;p=thirdparty%2Ftvheadend.git webui: add "Clear all statistics" button to Status -> Stream tab. fixes #3759 --- diff --git a/src/webui/static/app/status.js b/src/webui/static/app/status.js index e875eb3e1..586e1c897 100644 --- a/src/webui/static/app/status.js +++ b/src/webui/static/app/status.js @@ -120,14 +120,14 @@ tvheadend.status_subs = function(panel, index) header: _("Service"), dataIndex: 'service', sortable: true - }, + }, { width: 50, id: 'profile', header: _("Profile"), dataIndex: 'profile', sortable: true - }, + }, { width: 50, id: 'start', @@ -179,7 +179,7 @@ tvheadend.status_subs = function(panel, index) renderer: renderBw } ]); - + function clicked(column, grid, index, e) { if (column.dataIndex == 'in' || column.dataIndex == 'out') { var id = grid.getStore().getAt(index).id; @@ -207,7 +207,7 @@ tvheadend.status_subs = function(panel, index) forceFit: true } }); - + dpanel.add(subs); dpanel.doLayout(false, true); } @@ -482,7 +482,29 @@ tvheadend.status_streams = function(panel, index) })); grid = new Ext.grid.GridPanel({ - tbar: ['->', { + tbar: [ + { + text: _('Clear all statistics'), + iconCls: 'clean', + handler: function() { + store = tvheadend.streamStatusStore; + if (!store || store == 'undefined') { + return; + } + clearStat = function(record) { + uuid = record.data.uuid; + if (!uuid || 'undefined') { + return; + } + Ext.Ajax.request({ + url: 'api/status/inputclrstats', + params: { uuid: uuid } + }); + } + store.each(clearStat) + } + }, + '->',{ text: _('Help'), iconCls: 'help', handler: function() { @@ -501,7 +523,7 @@ tvheadend.status_streams = function(panel, index) }, plugins: [actions] }); - + dpanel.add(grid); dpanel.doLayout(false, true); } @@ -672,7 +694,7 @@ tvheadend.status_conns = function(panel, index) { }, plugins: [actions] }); - + dpanel.add(grid); dpanel.doLayout(false, true); }