public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH proxmox-widget-toolkit 1/1] utils: add helper to format node's repository status
@ 2021-07-09 12:44 Fabian Ebner
  2021-07-09 12:44 ` [pve-devel] [PATCH pve-manager 1/1] ui: node status: use helper for formatting " Fabian Ebner
  2021-07-09 12:44 ` [pve-devel] [PATCH proxmox-backup 1/1] ui: dashboard: show node's repository/subscription status Fabian Ebner
  0 siblings, 2 replies; 4+ messages in thread
From: Fabian Ebner @ 2021-07-09 12:44 UTC (permalink / raw)
  To: pve-devel, pbs-devel

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 src/Utils.js | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/Utils.js b/src/Utils.js
index 8e1f9d4..19ce1f2 100644
--- a/src/Utils.js
+++ b/src/Utils.js
@@ -1150,6 +1150,28 @@ utilities: {
 
 	return icon;
     },
+
+    formatNodeRepoStatus: function(status, product) {
+	let fmt = (txt, cls) => `<i class="fa fa-fw fa-lg fa-${cls}"></i>${txt}`;
+
+	let getUpdates = Ext.String.format(gettext('{0} updates'), product);
+	let noRepo = Ext.String.format(gettext('No {0} repository enabled!'), product);
+
+	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(noRepo, 'exclamation-circle critical');
+	}
+
+	return Proxmox.Utils.unknownText;
+    },
 },
 
     singleton: true,
-- 
2.30.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-12  5:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 12:44 [pve-devel] [PATCH proxmox-widget-toolkit 1/1] utils: add helper to format node's repository status Fabian Ebner
2021-07-09 12:44 ` [pve-devel] [PATCH pve-manager 1/1] ui: node status: use helper for formatting " Fabian Ebner
2021-07-09 12:44 ` [pve-devel] [PATCH proxmox-backup 1/1] ui: dashboard: show node's repository/subscription status Fabian Ebner
2021-07-12  5:19   ` [pve-devel] applied: [pbs-devel] " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal