[pve-devel] [PATCH manager] add tooltips to the tree
Thomas Lamprecht
t.lamprecht at proxmox.com
Tue Mar 26 07:17:23 CET 2019
On 3/25/19 4:36 PM, Dominik Csapak wrote:
> to give the user better feedback about the various icons (play, pause,
> warning, error, etc) add a tooltip to the tree elements which
> contain that information
>
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> this is a similar patch to that from my 'lock in resources' series,
> but without the lock part
>
> this way we can have the tooltips now and add the locks later if we want
I do not like that we have now all those "Status: undefined, HA State: undefined"
for all tree nodes[0], not only leaf nodes...
[0]: https://i.imgur.com/K9qygmA.png
>
> www/manager6/tree/ResourceTree.js | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js
> index 28135d0e..db868262 100644
> --- a/www/manager6/tree/ResourceTree.js
> +++ b/www/manager6/tree/ResourceTree.js
> @@ -131,12 +131,26 @@ Ext.define('PVE.tree.ResourceTree', {
> info.text = status + info.text;
> },
>
> + setToolTip: function(info) {
> + if (info.type === 'pool') {
> + return;
> + }
> +
> + var qtips = [gettext('Status') + ': ' + (info.qmpstatus || info.status)];
> + if (info.hastate != 'unmanaged') {
> + qtips.push(gettext('HA State') + ": " + info.hastate);
> + }
> +
> + info.qtip = qtips.join(', ');
> + },
> +
> // private
> addChildSorted: function(node, info) {
> var me = this;
>
> me.setIconCls(info);
> me.setText(info);
> + me.setToolTip(info);
>
> var defaults;
> if (info.groupbyid) {
> @@ -301,6 +315,7 @@ Ext.define('PVE.tree.ResourceTree', {
> Ext.apply(info, item.data);
> me.setIconCls(info);
> me.setText(info);
> + me.setToolTip(info);
> olditem.commit();
> }
> if ((!item || moved) && olditem.isLeaf()) {
>
More information about the pve-devel
mailing list