From 0668981954db795d0fbb1465fa8f20bd76f528af Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 1 Jul 2021 18:38:04 +0200 Subject: [PATCH] node: repo: highlight proxmox repos that are not producition-ready Signed-off-by: Thomas Lamprecht --- src/node/APTRepositories.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/node/APTRepositories.js b/src/node/APTRepositories.js index 9a4418a..e34abb6 100644 --- a/src/node/APTRepositories.js +++ b/src/node/APTRepositories.js @@ -295,8 +295,23 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', { { header: gettext('Components'), dataIndex: 'Components', - renderer: function(components, cell, record) { - return components.join(' '); + renderer: function(components, metaData, record) { + let err = ''; + if (components.length === 1) { + // FIXME: this should be a flag set to the actual repsotiories, i.e., a tristate + // like production-read = + if (components[0].match(/\w+(-no-subscription|test)\s*$/i)) { + metaData.tdCls = 'proxmox-warning-row'; + err = ' '; + + let qtip = components[0].match(/no-subscription/) + ? gettext('The no-subscription repository is NOT production-ready') + : gettext('The test repository may contain unstable updates') + ; + metaData.tdAttr = `data-qtip="${Ext.htmlEncode(qtip)}"`; + } + } + return components.join(' ') + err; }, width: 170, }, -- 2.39.2