]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: node status: prioritize non-production and fix ok case
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 5 Jul 2021 13:33:42 +0000 (15:33 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 5 Jul 2021 13:33:45 +0000 (15:33 +0200)
Non-production repositories will always pull in their newer software,
so even if enterprise+subscription is OK we should mark it with
priority if, e.g., pvetest is enabled.

There was also a bug regarding the all OK state

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

index f3d2627f610b7b93044dd86305baf25d4ac17ef2..d7a0852960bbcc03e0dd8c1db14cae3374b43c02 100644 (file)
@@ -15,21 +15,23 @@ Ext.define('PVE.node.StatusView', {
                    return '';
                }
 
-               if (!get('subscriptionActive') && get('enterpriseRepo')) {
-                   return 'no-sub';
-               } else if (get('noSubscriptionRepo') || get('testRepo')) {
+               if (get('noSubscriptionRepo') || get('testRepo')) {
                    return 'non-production';
+               } else if (get('subscriptionActive') && get('enterpriseRepo')) {
+                   return 'ok';
+               } else if (!get('subscriptionActive') && get('enterpriseRepo')) {
+                   return 'no-sub';
                } else if (!get('enterpriseRepo') || !get('noSubscriptionRepo') || !get('testRepo')) {
                    return 'no-repo';
                }
-               return 'ok';
+               return 'unknown';
            },
            repoStatusMessage: function(get) {
                const status = get('repoStatus');
 
                let fmt = (txt, cls) => `<i class="fa fa-fw fa-lg fa-${cls}"></i>${txt}`;
 
-               let getUpdates = Ext.String.format(gettext('You get updates for {0}'), 'Proxmox VE');
+               let getUpdates = Ext.String.format(gettext('{0} updates'), 'Proxmox VE');
 
                if (status === 'ok') {
                    return fmt(getUpdates, 'check-circle good') + ' ' +
@@ -39,7 +41,7 @@ Ext.define('PVE.node.StatusView', {
                            fmt(gettext('Enterprise repository needs valid subscription'), 'exclamation-circle warning');
                } else if (status === 'non-production') {
                    return fmt(getUpdates, 'check-circle good') + ' ' +
-                          fmt(gettext('Not a production-ready repository!'), 'exclamation-circle warning');
+                          fmt(gettext('Non production-ready repository enabled!'), 'exclamation-circle warning');
                } else if (status === 'no-repo') {
                    return fmt(gettext('No Proxmox VE repository enabled!'), 'exclamation-circle critical');
                }