From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <t.lamprecht@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 9BCAA63DC9
 for <pve-devel@lists.proxmox.com>; Wed, 25 Nov 2020 17:17:53 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 8B3231CCDB
 for <pve-devel@lists.proxmox.com>; Wed, 25 Nov 2020 17:17:53 +0100 (CET)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [212.186.127.180])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id B164F1CCD0
 for <pve-devel@lists.proxmox.com>; Wed, 25 Nov 2020 17:17:49 +0100 (CET)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 80AE243B75;
 Wed, 25 Nov 2020 17:17:49 +0100 (CET)
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
 Alexandre Derumier <aderumier@odiso.com>
References: <20201124135221.2856467-1-aderumier@odiso.com>
 <20201124135221.2856467-13-aderumier@odiso.com>
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
Message-ID: <7c28f8ba-738a-4809-ab9b-4c11a9f565ef@proxmox.com>
Date: Wed, 25 Nov 2020 17:17:48 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101
 Thunderbird/83.0
MIME-Version: 1.0
In-Reply-To: <20201124135221.2856467-13-aderumier@odiso.com>
Content-Type: text/plain; charset=UTF-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.078 Adjusted score from AWL reputation of From: address
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 NICE_REPLY_A           -0.001 Looks like a legit reply (A)
 RCVD_IN_DNSWL_MED        -2.3 Sender listed at https://www.dnswl.org/,
 medium trust
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more
 information. [proxmox.com]
Subject: Re: [pve-devel] [PATCH v7 pve-manager 12/15] sdn: display pending
 values
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Wed, 25 Nov 2020 16:17:53 -0000

On 24.11.20 14:52, Alexandre Derumier wrote:
> Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
> ---
>  www/manager6/Utils.js              | 29 ++++++++++++++++++
>  www/manager6/sdn/ControllerView.js | 39 +++++++++++++++++++++---
>  www/manager6/sdn/SubnetView.js     | 49 +++++++++++++++++++++++++++---=

>  www/manager6/sdn/VnetView.js       | 31 +++++++++++++++++--
>  www/manager6/sdn/ZoneView.js       | 47 +++++++++++++++++++++++++---
>  5 files changed, 181 insertions(+), 14 deletions(-)
>=20
> diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
> index 5440b972..257af3fd 100644
> --- a/www/manager6/Utils.js
> +++ b/www/manager6/Utils.js
> @@ -175,6 +175,35 @@ Ext.define('PVE.Utils', { utilities: {
>  	'HEALTH_ERR':'critical'
>      },
> =20
> +    render_sdn_pending: function(rec,value,key, index) {
> +        if (rec.data.state =3D=3D=3D 'deleted') {
> +            if (value =3D=3D=3D undefined) {
> +                return '';
> +            } else {
> +                return '<div style=3D"text-decoration: line-through;">=
'+ value +'</div>';
> +            }
> +
> +        } else if (rec.data.state =3D=3D=3D 'new') {
> +            if(index =3D=3D=3D undefined) {
> +                value =3D rec.data.pending[key];
> +            }
> +            if (value =3D=3D=3D undefined || value =3D=3D=3D null) {
> +                value =3D '';
> +            }
> +            return '<div style=3D"color:green">' + value + '</div>';
> +        } else if (rec.data.state =3D=3D=3D 'changed') {
> +            if (value =3D=3D=3D undefined || value =3D=3D=3D null) {
> +                value =3D '<br>';
> +            }
> +            if (rec.data.pending[key] =3D=3D=3D undefined || rec.data.=
pending[key] =3D=3D=3D null) {
> +                rec.data.pending[key] =3D value;
> +            }
> +           return '<div style=3D"text-decoration: line-through;">'+ va=
lue +'</div>' + '<div style=3D"color:orange">' + rec.data.pending[key] + =
'</div>';
> +        } else {
> +            return value;
> +        }
> +    },
> +
>      render_ceph_health: function(healthObj) {
>  	var state =3D {
>  	    iconCls: PVE.Utils.get_health_icon(),


This feels really subtle as one initially has no idea why all is green, f=
or
example. Visually and contrast wise it looks also a bit weird, IMO.

The strike-through for pending changes looks OK, I'd avoid the red though=
=2E

Further, I'd avoid to use style on the whole row to mark something as
pending-new or pending-change.

How about using a dedicated Pending column, which shows the state in text=

form. You could checkout the render_backup_encryption helper[0] for how o=
ne
can produce a combination of text, icons and even tooltips.
(albeit the icon choice would be a bit hard here, so just text is fine to=
o
IMO).

[0]: https://git.proxmox.com/?p=3Dpve-manager.git;a=3Dblob;f=3Dwww/manage=
r6/Utils.js;h=3D6e6498a21919ca4dd2cb65ab02a1a1730d4c2d36;hb=3DHEAD#l224