Project

General

Profile

How to change the UI's items displayed "per page" default (from 50 -> 'all')?

Added by a henry over 4 years ago

While I'm debugging setup, I'm constanly popping back & forth between UI tabs.

With hundreds of services, muxes, channels, etc., I always looking at each whole list, sorting by various columns.

The TVH UI seems to default each & every time to showing only 50 itmes per page; I have to change it to "all" each time.

Is there a place to config "all" to be the default, or otherwise make it 'sticky'?


Replies (12)

RE: How to change the UI's items displayed "per page" default (from 50 -> 'all')? - Added by Alan S over 4 years ago

To permanently change the default number of items you need to edit the src/webui/static/app/tvheadend.js (actual default setting) and src/webui/static/app/idnode.js (dropdown default setting) files. However all the webui JavaScript is merged at build time into a single tvh.js.gz file which is served to clients and not the individual js files.

So either, at build time you need to patch src/webui/static/app/tvheadend.js and change "conf.pageSize = 50;" at tvheadend.PagingToolbarConf to the desired value and also patch src/webui/static/app/idnode.js and change the "value: 50," line to the desired value per the options data: "25, '25'], [50, '50'], [100, '100'], [200, '200'], [999999999, _('All')" above it. Search for the "Ext.form.ComboBox" with "pageSize" for the correct section.

Else, for a running system you need to uncompress the /usr/share/tvheadend/src/webui/static/tvh.js.gz file, search for the "conf.pageSize = 50;" and change to the desired value and also search for the "value:50" on a line with the above options data and change it to the desired value and then recompress.

RE: How to change the UI's items displayed "per page" default (from 50 -> 'all')? - Added by Pablo R. about 4 years ago

Alan S wrote:

To permanently change the default number of items you need to edit the src/webui/static/app/tvheadend.js (actual default setting) and src/webui/static/app/idnode.js (dropdown default setting) files. However all the webui JavaScript is merged at build time into a single tvh.js.gz file which is served to clients and not the individual js files.

So either, at build time you need to patch src/webui/static/app/tvheadend.js and change "conf.pageSize = 50;" at tvheadend.PagingToolbarConf to the desired value and also patch src/webui/static/app/idnode.js and change the "value: 50," line to the desired value per the options data: "25, '25'], [50, '50'], [100, '100'], [200, '200'], [999999999, _('All')" above it. Search for the "Ext.form.ComboBox" with "pageSize" for the correct section.

Else, for a running system you need to uncompress the /usr/share/tvheadend/src/webui/static/tvh.js.gz file, search for the "conf.pageSize = 50;" and change to the desired value and also search for the "value:50" on a line with the above options data and change it to the desired value and then recompress.

I have tried to do what you say and although the boxes if I change the value to the chosen one (200 for example) when loading the page automatically it is set to 50, and I have to click on the desired value to work. I have changed both files that you indicate from 50 to 200 (idnode.js and tvheadend.js) and rebuilt. What can it be wrong?

I do not understand why it continues using 50 if it does not already appear in any part of the code (apparently)...

RE: How to change the UI's items displayed "per page" default (from 50 -> 'all')? - Added by Dave Pickles about 4 years ago

Yes I find that even with the mods I have to click on the 'reload' button on the status bar at the bottom of the screen in order to see everything. It's still quicker than using the drop-down list though.

The default value 50 is hard-coded into the TVH API.

RE: How to change the UI's items displayed "per page" default (from 50 -> 'all')? - Added by Alan S about 4 years ago

Sorry, there was one missing edit of src/webui/static/app/dvr.js to change "var pageSize = 50;" at tvheadend.dvr_finished to the desired value for specifically the Finished Recordings tab. Apply the same change to the tvh.js.gz file for current installs.

However can I now get it to stick on web pages shows to my preferred 200 rather than 50? Can I flipping heck... :-(

RE: How to change the UI's items displayed "per page" default (from 50 -> 'all')? - Added by easy easy over 3 years ago

No one solved this?
I'm trying to but without success.
Any help pls..

RE: How to change the UI's items displayed "per page" default (from 50 -> 'all')? - Added by Győző Nagy about 3 years ago

If You want to set the default row count to eg.: 1000, you need to edit the three files like above and add the params start and limit. After that You don't need to push the refresh button.

Tvheadend build: 4.3-1789~g6bfeca6c0

in src/webui/static/app/idnode.js at line ~1744 (it's in the /* Store */ section) add:

        params['start'] = 0;
        params['limit'] = 1000;

at line ~2036 (it's in the /* Grid Panel */ section) modify:

            store: new Ext.data.ArrayStore({
                id: 0,
                fields: ['key', 'val'],
                data: [[50, '50'], [100, '100'], [200, '200']
                    [1000, '1000'], [999999999, _('All')]]
            }),
            value: 1000,

in src/webui/static/app/tvheadend.js at line ~697 (it's in tvheadend.PagingToolbarConf function)

  conf.pageSize = 1000;

in src/webui/static/app/dvr.js at line ~818 (it's in tvheadend.dvr_finished function)

    var pageSize = 1000;

RE: How to change the UI's items displayed "per page" default (from 50 -> 'all')? - Added by Dave H about 3 years ago

Thanks for that. It looks very helpful. But you don't say which version of the code you're talking about and the line numbers you've given don't seem sensible for my version. It would be helpful if you could repost giving some context lines for the edits as well as the approximate line numbers.

edit: oh and in my version (4.2.6) there's no pageSize in dvr.js

RE: How to change the UI's items displayed "per page" default (from 50 -> 'all')? - Added by Dave Pickles about 3 years ago

Here is a patch against v4.3.1784. However while I've been using earlier versions of the patch for some time, I haven't tried this one out yet.

--- src/webui/static/app/tvheadend.js        2019-05-07 13:05:57.735415337 +0100
+++ src/webui/static/app/tvheadend.js   2019-05-07 13:11:03.318479401 +0100
@@ -694,7 +694,7 @@
 tvheadend.PagingToolbarConf = function(conf, title, auto, count)
 {
   conf.width = 50;
-  conf.pageSize = 50;
+  conf.pageSize = 1000;
   conf.displayInfo = true;
                     /// {0} start, {1} end, {2} total, {3} title
   conf.displayMsg = _('{3} {0} - {1} of {2}').replace('{3}', title);
--- src/webui/static/app/idnode.js   2019-05-07 13:05:57.735415337 +0100
+++ src/webui/static/app/idnode.js      2019-05-07 13:11:03.318479401 +0100
@@ -1740,6 +1740,8 @@
         var params = {};
         if (conf.all) params['all'] = 1;
         if (conf.extraParams) conf.extraParams(params);
+        params['start'] = 0;
+        params['limit'] = 1000;

         groupReader = new Ext.data.JsonReader({
             totalProperty: 'total',
@@ -2034,9 +2036,9 @@
                 id: 0,
                 fields: ['key', 'val'],
                 data: [[25, '25'], [50, '50'], [100, '100'],
-                    [200, '200'], [999999999, _('All')]]
+                    [200, '200'], [1000, '1000'], [999999999, _('All')]]
             }),
-            value: 50,
+            value: 1000,
             mode: 'local',
             forceSelection: false,
             triggerAction: 'all',
--- src/webui/static/app/dvr.js  2019-05-07 13:05:57.735415337 +0100
+++ src/webui/static/app/dvr.js    2019-05-07 13:11:03.318479401 +0100
@@ -815,7 +815,7 @@

     var actions = tvheadend.dvrRowActions();
     var buttonFcn = tvheadend.dvrButtonFcn;
-    var pageSize = 50;
+    var pageSize = 1000;
     var activePage = 0;

     var downloadButton = {

RE: How to change the UI's items displayed "per page" default (from 50 -> 'all')? - Added by Győző Nagy about 3 years ago

Dave H wrote:

Thanks for that. It looks very helpful. But you don't say which version of the code you're talking about and the line numbers you've given don't seem sensible for my version. It would be helpful if you could repost giving some context lines for the edits as well as the approximate line numbers.

edit: oh and in my version (4.2.6) there's no pageSize in dvr.js

I've modified the answer

thnx

RE: How to change the UI's items displayed "per page" default (from 50 -> 'all')? - Added by Dave H about 3 years ago

Thanks for that Dave (edit: and Győző :). I applied it* to my 4.2.6 and it seems to have worked.

  • Well except for the bit in dvr.js that I edited to mention above. But that doesn't seem to be needed on my system.

RE: How to change the UI's items displayed "per page" default (from 50 -> 'all')? - Added by easy easy over 2 years ago

Dave Pickles wrote:

Here is a patch against v4.3.1784. However while I've been using earlier versions of the patch for some time, I haven't tried this one out yet.

[...]

Thank you for detailed explanation!
It's working!

    (1-12/12)