]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
webui: add "Clear all statistics" button to Status -> Stream tab.
authorMark Clarkstone <hello@markclarkstone.co.uk>
Tue, 19 Sep 2017 09:59:56 +0000 (10:59 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 24 Sep 2017 07:06:50 +0000 (09:06 +0200)
fixes #3759

src/webui/static/app/status.js

index e875eb3e1d5ffdd28ef79ff08569364a0036781c..586e1c897a1d4d006e4698e913500d4707dd6831 100644 (file)
@@ -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);
     }