]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: node summary: rework repo status output
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 4 Jul 2021 19:18:31 +0000 (21:18 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 4 Jul 2021 19:18:43 +0000 (21:18 +0200)
the icon on the left side look a bit weird here, as the lines
directly above had none and the actual status which the icon tried to
emphasize is on the right anyway.

Rework also the output.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/node/StatusView.js

index f4a55d14658e61b40c26401e21eb63d7752aae1b..7b1e2bed09d96476dd6aabc36ec2341df5fa1d98 100644 (file)
@@ -11,56 +11,37 @@ Ext.define('PVE.node.StatusView', {
        },
        formulas: {
            repoStatus: function(get) {
-               if (get('subscriptionActive') === '' ||
-                   get('enterpriseRepo') === '') {
+               if (get('subscriptionActive') === '' || get('enterpriseRepo') === '') {
                    return '';
                }
 
                if (!get('subscriptionActive') && get('enterpriseRepo')) {
                    return 'no-sub';
-               }
-
-               if (get('noSubscriptionRepo') || get('testRepo')) {
+               } else if (get('noSubscriptionRepo') || get('testRepo')) {
                    return 'non-production';
-               }
-
-               if (!get('enterpriseRepo') || !get('noSubscriptionRepo') || !get('testRepo')) {
+               } else if (!get('enterpriseRepo') || !get('noSubscriptionRepo') || !get('testRepo')) {
                    return 'no-repo';
                }
-
                return 'ok';
            },
            repoStatusMessage: function(get) {
                const status = get('repoStatus');
 
-               if (status === 'ok') {
-                   return gettext('Enterprise repository and subscription active');
-               } else if (status === 'no-sub') {
-                   return gettext('Enterprise repository enabled, but no active subscription');
-               } else if (status === 'non-production') {
-                   return gettext('No-subscription or test repository in use');
-               } else if (status === 'no-repo') {
-                   return gettext('No PVE repository is enabled!');
-               }
-
-               return Proxmox.Utils.unknownText;
-           },
-           repoStatusIconCls: function(get) {
-               const status = get('repoStatus');
-
-               let iconCls = (cls) => `fa fa-fw ${cls}`;
+               let fmt = (txt, cls) => `<i class="fa fa-fw fa-${cls}"></i> ${txt}`;
 
                if (status === 'ok') {
-                   return iconCls('fa-check good');
+                   return fmt(gettext('Enterprise repository enabled'), 'check good') + ', ' +
+                           fmt(gettext('Active subscription'), 'check good');
                } else if (status === 'no-sub') {
-                   return iconCls('fa-exclamation-triangle critical');
+                   return fmt(gettext('Enterprise repository enabled'), 'check good') + ', ' +
+                           fmt(gettext('No active subscription'), 'exclamation-circle warning');
                } else if (status === 'non-production') {
-                   return iconCls('fa-exclamation-triangle warning');
+                   return fmt(gettext('No production-ready repository used'), 'exclamation-circle warning');
                } else if (status === 'no-repo') {
-                   return iconCls('fa-exclamation-triangle critical');
+                   return fmt(gettext('No Proxmox VE repository enabled!'), 'exclamation-circle critical');
                }
 
-               return iconCls('fa-question-circle-o');
+               return Proxmox.Utils.unknownText;
            },
        },
     },
@@ -180,14 +161,13 @@ Ext.define('PVE.node.StatusView', {
            itemId: 'repositoryStatus',
            colspan: 2,
            printBar: false,
-           title: gettext('Repository Configuration Status'),
+           title: gettext('Repository Status'),
            // for bind
            setValue: function(value) {
                let me = this;
                me.updateValue(value);
            },
            bind: {
-               iconCls: '{repoStatusIconCls}',
                value: '{repoStatusMessage}',
            },
        },