]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
apt repos: move Official to the right & use checkbox to render enabled
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Jun 2021 17:57:30 +0000 (19:57 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Jun 2021 17:57:33 +0000 (19:57 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/node/APTRepositories.js

index fd4a35003d7fee0bb60b5fe46893fbdec1dfff1b..fb6edaf13c2bcef982223c1be0c0d104bafeb9be 100644 (file)
@@ -123,27 +123,12 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
 
     columns: [
        {
-           header: gettext('Official'),
-           dataIndex: 'OfficialHost',
-           renderer: function(value, cell, record) {
-               let icon = (cls) => `<i class="fa fa-fw ${cls}"></i>`;
-
-               const enabled = record.data.Enabled;
-
-               if (value === undefined || value === null) {
-                   return icon('fa-question-circle-o');
-               }
-               if (!value) {
-                   return icon('fa-times ' + (enabled ? 'critical' : 'faded'));
-               }
-               return icon('fa-check ' + (enabled ? 'good' : 'faded'));
-           },
-           width: 70,
-       },
-       {
+           xtype: 'checkcolumn',
            header: gettext('Enabled'),
            dataIndex: 'Enabled',
-           renderer: Proxmox.Utils.format_enabled_toggle,
+           listeners: {
+               beforecheckchange: () => false, // veto, we don't want to allow inline change - to subtle
+           },
            width: 90,
        },
        {
@@ -205,6 +190,23 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
            },
            flex: 1,
        },
+       {
+           header: gettext('Official'),
+           dataIndex: 'OfficialHost',
+           renderer: function(value, cell, record) {
+               let icon = (cls) => `<i class="fa fa-fw ${cls}"></i>`;
+
+               if (value === undefined || value === null) {
+                   return icon('fa-question-circle-o');
+               }
+               const enabled = record.data.Enabled;
+               if (!value) {
+                   return icon('fa-question ' + (enabled ? 'warning' : 'faded'));
+               }
+               return icon('fa-check ' + (enabled ? 'good' : 'faded'));
+           },
+           width: 70,
+       },
        {
            header: gettext('Comment'),
            dataIndex: 'Comment',