]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
webui: break configuration into multiple super tabs
authorAdam Sutton <dev@adamsutton.me.uk>
Fri, 15 Feb 2013 12:34:22 +0000 (12:34 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Fri, 15 Feb 2013 12:34:22 +0000 (12:34 +0000)
This is done to limit the total number of tabs on one row which is
leading to problems on smaller displays. I also think its more
logical.

src/webui/static/app/tvheadend.js

index cfaab7345ee2d10b47ed49edf36ed8d221a48d45..1db51311d65a0b6b84f804c99bb4db232e575388 100644 (file)
@@ -1,5 +1,9 @@
 tvheadend.accessupdate = null;
 tvheadend.capabilties  = null;
+tvheadend.conf_chepg   = null;
+tvheadend.conf_dvbin   = null;
+tvheadend.conf_tsdvr   = null;
+tvheadend.conf_csa     = null;
 
 /**
  * Displays a help popup window
@@ -245,54 +249,106 @@ function accessUpdate(o) {
   if (!tvheadend.capabilities)
     return;
 
-       if (o.dvr == true && tvheadend.dvrpanel == null) {
-               tvheadend.dvrpanel = new tvheadend.dvr;
-               tvheadend.rootTabPanel.add(tvheadend.dvrpanel);
-       }
-
-       if (o.admin == true && tvheadend.confpanel == null) {
-               tvheadend.confpanel = new Ext.TabPanel({
-                       activeTab : 0,
-                       autoScroll : true,
-                       title : 'Configuration',
-                       iconCls : 'wrench',
-                       items : [ new tvheadend.miscconf, new tvheadend.chconf,
-                               new tvheadend.epggrab, new tvheadend.cteditor,
-                               new tvheadend.dvrsettings, 
-                               new tvheadend.iptv, new tvheadend.acleditor ]
-               });
-               tvheadend.rootTabPanel.add(tvheadend.confpanel);
+  if (o.dvr == true && tvheadend.dvrpanel == null) {
+    tvheadend.dvrpanel = new tvheadend.dvr;
+    tvheadend.rootTabPanel.add(tvheadend.dvrpanel);
+  }
+
+  if (o.admin == true && tvheadend.confpanel == null) {
+    var tabs1 = [
+      new tvheadend.miscconf,
+      new tvheadend.acleditor
+    ]
+    var tabs2;
+
+    /* DVB inputs */
+    tabs2 = [];
     if (tvheadend.capabilities.indexOf('linuxdvb') != -1 ||
         tvheadend.capabilities.indexOf('v4l')      != -1) {
-      tvheadend.confpanel.add(new tvheadend.tvadapters);
-    }
-    if (tvheadend.capabilities.indexOf('cwc')      != -1) {
-      tvheadend.confpanel.add(new tvheadend.cwceditor);
-      tvheadend.confpanel.add(new tvheadend.capmteditor);
+      tabs2.push(new tvheadend.tvadapters);
     }
+    tabs2.push(new tvheadend.iptv);
+    tvheadend.conf_dvbin = new Ext.TabPanel({
+      activeTab: 0,
+      autoScroll: true,
+      title: 'DVB Inputs',
+      iconCls: 'hardware',
+      items : tabs2
+    });
+    tabs1.push(tvheadend.conf_dvbin);
+
+    /* Channel / EPG */
+    tvheadend.conf_chepg = new Ext.TabPanel({
+      activeTab: 0,
+      autoScroll: true,
+      title : 'Channel / EPG',
+      iconCls : 'television',
+      items : [
+        new tvheadend.chconf,
+        new tvheadend.cteditor,
+        new tvheadend.epggrab
+      ]
+    });
+    tabs1.push(tvheadend.conf_chepg);
+
+    /* DVR / Timeshift */
+    tabs2 = [ new tvheadend.dvrsettings ];
     if (tvheadend.capabilities.indexOf('timeshift') != -1) {
-      tvheadend.confpanel.add(new tvheadend.timeshift);
+      tabs2.push(new tvheadend.timeshift)
+    }
+    tvheadend.conf_tsdvr = new Ext.TabPanel({
+      activeTab: 0,
+      autoScroll: true,
+      title: 'Recording',
+      iconCls: 'drive',
+      items : tabs2
+    });
+    tabs1.push(tvheadend.conf_tsdvr);
+
+    /* CSA */
+    if (tvheadend.capabilities.indexOf('cwc')      != -1) {
+      tvheadend.conf_csa = new Ext.TabPanel({
+        activeTab: 0,
+        autoScroll: true,
+        title: 'CSA',
+        iconCls: 'key',
+        items: [
+          new tvheadend.cwceditor,
+          new tvheadend.capmteditor
+        ]
+      });
+      tabs1.push(tvheadend.conf_csa);
     }
+
+    tvheadend.confpanel = new Ext.TabPanel({
+      activeTab : 0,
+      autoScroll : true,
+      title : 'Configuration',
+      iconCls : 'wrench',
+      items : tabs1
+    });
+
+    tvheadend.rootTabPanel.add(tvheadend.confpanel);
     tvheadend.confpanel.doLayout();
   }
 
-       if (o.admin == true && tvheadend.statuspanel == null) {
-               tvheadend.statuspanel = new tvheadend.status;
-               tvheadend.rootTabPanel.add(tvheadend.statuspanel);
-       }
-
-       if (tvheadend.aboutPanel == null) {
-               tvheadend.aboutPanel = new Ext.Panel({
-                       border : false,
-                       layout : 'fit',
-                       title : 'About',
-                       iconCls : 'info',
-                       autoLoad : 'about.html'
-               });
-               tvheadend.rootTabPanel.add(tvheadend.aboutPanel);
-       }
-
-       tvheadend.rootTabPanel.doLayout();
+  if (o.admin == true && tvheadend.statuspanel == null) {
+    tvheadend.statuspanel = new tvheadend.status;
+    tvheadend.rootTabPanel.add(tvheadend.statuspanel);
+  }
+
+  if (tvheadend.aboutPanel == null) {
+    tvheadend.aboutPanel = new Ext.Panel({
+      border : false,
+      layout : 'fit',
+      title : 'About',
+      iconCls : 'info',
+      autoLoad : 'about.html'
+    });
+    tvheadend.rootTabPanel.add(tvheadend.aboutPanel);
+  }
+
+  tvheadend.rootTabPanel.doLayout();
 }
 
 /**