[pbs-devel] [PATCH pve-manager 1/1] ui: node status: use helper for formatting repository status

Fabian Ebner f.ebner at proxmox.com
Fri Jul 9 14:44:15 CEST 2021


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

Dependency bump for widget-toolkit is needed.

 www/manager6/node/StatusView.js | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/www/manager6/node/StatusView.js b/www/manager6/node/StatusView.js
index d7a08529..3c52ce95 100644
--- a/www/manager6/node/StatusView.js
+++ b/www/manager6/node/StatusView.js
@@ -27,26 +27,7 @@ Ext.define('PVE.node.StatusView', {
 		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('{0} updates'), 'Proxmox VE');
-
-		if (status === 'ok') {
-		    return fmt(getUpdates, 'check-circle good') + ' ' +
-		        fmt(gettext('Production-ready Enterprise repository enabled'), 'check-circle good');
-		} else if (status === 'no-sub') {
-		    return fmt(gettext('Production-ready Enterprise repository enabled'), 'check-circle good') + ' ' +
-			    fmt(gettext('Enterprise repository needs valid subscription'), 'exclamation-circle warning');
-		} else if (status === 'non-production') {
-		    return fmt(getUpdates, 'check-circle good') + ' ' +
-			   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');
-		}
-
-		return Proxmox.Utils.unknownText;
+		return Proxmox.Utils.formatNodeRepoStatus(get('repoStatus'), 'Proxmox VE');
 	    },
 	},
     },
-- 
2.30.2






More information about the pbs-devel mailing list