From a886456f305527192dd334e13ae0275844e9b26f Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 14 Nov 2024 09:04:35 +0100 Subject: [PATCH 1/3] ui: tree: show tooltips for all entries that have sensible information instead of filtering pools and groups out manually, simply accumulate the info we want to to have (status/hastate/etc.) and if any of those exist, show the tooltip. This results in the nodes also having a tooltip, including their hastate (such as online/maintenance), and automatically would show such things in the future if we add those fields to other entries. Signed-off-by: Dominik Csapak --- www/manager6/tree/ResourceTree.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js index 312f958f..a7acdf93 100644 --- a/www/manager6/tree/ResourceTree.js +++ b/www/manager6/tree/ResourceTree.js @@ -148,11 +148,10 @@ Ext.define('PVE.tree.ResourceTree', { }, getToolTip: function(info) { - if (info.type === 'pool' || info.groupbyid !== undefined) { - return undefined; + let qtips = []; + if (info.qmpstatus || info.status) { + qtips.push(gettext('Status') + ': ' + (info.qmpstatus || info.status)); } - - let qtips = [gettext('Status') + ': ' + (info.qmpstatus || info.status)]; if (info.lock) { qtips.push(Ext.String.format(gettext('Config locked ({0})'), info.lock)); } @@ -166,6 +165,10 @@ Ext.define('PVE.tree.ResourceTree', { } } + if (qtips.length === 0) { + return undefined; + } + let tip = qtips.join(', '); info.tip = tip; return tip; From c21b4250d66215d2e9e9994a6d33b22ede2171f1 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 14 Nov 2024 18:47:43 +0100 Subject: [PATCH 2/3] ui: resource tree: improve gettext representation of dynamic state tooltip Some languages need to know about the argument here to allow for a better translation (text order). Signed-off-by: Thomas Lamprecht --- www/manager6/tree/ResourceTree.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js index a7acdf93..8b7c2521 100644 --- a/www/manager6/tree/ResourceTree.js +++ b/www/manager6/tree/ResourceTree.js @@ -150,13 +150,13 @@ Ext.define('PVE.tree.ResourceTree', { getToolTip: function(info) { let qtips = []; if (info.qmpstatus || info.status) { - qtips.push(gettext('Status') + ': ' + (info.qmpstatus || info.status)); + qtips.push(Ext.String.format(gettext('Status: {0}'), info.qmpstatus || info.status)); } if (info.lock) { qtips.push(Ext.String.format(gettext('Config locked ({0})'), info.lock)); } if (info.hastate !== 'unmanaged') { - qtips.push(gettext('HA State') + ": " + info.hastate); + qtips.push(Ext.String.format(gettext('HA State: {0}'), info.hastate)); } if (info.type === 'storage') { let usage = info.disk / info.maxdisk; From b67c450126b5840ea9a58b1cd1accbd6f72a4328 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 14 Nov 2024 22:22:55 +0100 Subject: [PATCH 3/3] ui: mobile: add Bulgarian as available language to copy of Utils Signed-off-by: Thomas Lamprecht --- www/mobile/WidgetToolkitUtils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/mobile/WidgetToolkitUtils.js b/www/mobile/WidgetToolkitUtils.js index ea710faf..617d7cba 100644 --- a/www/mobile/WidgetToolkitUtils.js +++ b/www/mobile/WidgetToolkitUtils.js @@ -67,6 +67,7 @@ utilities: { language_map: { //language map is sorted alphabetically by iso 639-1 ar: `العربية - ${gettext("Arabic")}`, + bg: `Български - ${gettext("Bulgarian")}`, ca: `Català - ${gettext("Catalan")}`, da: `Dansk - ${gettext("Danish")}`, de: `Deutsch - ${gettext("German")}`,