[pbs-devel] [PATCH proxmox-backup v14] fixup! ui: tree: render unmounted datastores correctly
Dominik Csapak
d.csapak at proxmox.com
Mon Nov 25 14:06:14 CET 2024
one comment inline
On 11/25/24 09:47, Hannes Laimer wrote:
> ---
> fixes small problem with the original patch where all datastores were rendered with the plug
> icon in the UI
>
> sent in reply to original patch since it is a really minor or change and
> can just be squashed in
> www/NavigationTree.js | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/www/NavigationTree.js b/www/NavigationTree.js
> index dd03fbd62..29ecae7fe 100644
> --- a/www/NavigationTree.js
> +++ b/www/NavigationTree.js
> @@ -266,7 +266,8 @@ Ext.define('PBS.view.main.NavigationTree', {
> while (name.localeCompare(getChildTextAt(j)) > 0 && (j+1) < list.childNodes.length) {
> j++;
> }
> - let mainIcon = `fa fa-${records[i].data.mount-status !== 'nonremovable' ? 'plug' : 'database'}`;
> + const isRemovable = records[i].data['mount-status'] !== 'nonremovable';
> + let mainIcon = `fa fa-${isRemovable ? 'plug' : 'database'}`;
i think it'll not happen, but if an 'old' api returns no 'mount-status' at all, i think
we should default to the 'normal' symbol, not the plug one
so e.g.
let mountStatus = records[i].data['mount-status'] ?? 'nonremovable';
let isRemoveable = mountStatus !== 'nonremovable';
or something like this
> let [qtip, iconCls] = ['', mainIcon];
> const maintenance = records[i].data.maintenance;
>
More information about the pbs-devel
mailing list