From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id CF3D4CDCF for ; Tue, 19 Sep 2023 15:38:47 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B9355B590 for ; Tue, 19 Sep 2023 15:38:47 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 19 Sep 2023 15:38:47 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id E150347FCC for ; Tue, 19 Sep 2023 15:38:46 +0200 (CEST) Message-ID: <32298ed3-1dc7-4e6f-9797-218c12355633@proxmox.com> Date: Tue, 19 Sep 2023 15:38:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Lukas Wagner To: Proxmox Backup Server development discussion , Hannes Laimer References: <20230915065457.352953-1-h.laimer@proxmox.com> <20230915065457.352953-18-h.laimer@proxmox.com> Content-Language: de-AT, en-US In-Reply-To: <20230915065457.352953-18-h.laimer@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.032 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] [PATCH proxmox-backup 17/23] ui: add datastore status mask for unplugged removable datastores X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Sep 2023 13:38:47 -0000 On 9/15/23 08:54, Hannes Laimer wrote: > diff --git a/www/datastore/Summary.js b/www/datastore/Summary.js > index dfff6e7f..d80c4a08 100644 > --- a/www/datastore/Summary.js > +++ b/www/datastore/Summary.js > @@ -61,16 +61,20 @@ Ext.define('PBS.DataStoreInfo', { > Proxmox.Utils.API2Request({ > url: `/config/datastore/${me.view.datastore}`, > success: function(response) { > - const config = response.result.data; > - if (config['maintenance-mode']) { > - const [_type, msg] = PBS.Utils.parseMaintenanceMode(config['maintenance-mode']); > - me.view.el.mask( > - `${gettext('Datastore is in maintenance mode')}${msg ? ': ' + msg : ''}`, > - 'fa pbs-maintenance-mask', > - ); > - } else { > + const maintenanceString = response.result.data['maintenance-mode']; > + if (!maintenanceString) { > me.view.el.mask(gettext('Datastore is not available')); > + return; > } > + > + const [type, msg] = PBS.Utils.parseMaintenanceMode(maintenanceString); > + const isUnplugged = type === 'unplugged'; > + const maskMessage = isUnplugged > + ? gettext('Datastore is unplugged') > + : `${gettext('Datastore is in maintenance mode')}${msg ? ': ' + msg : ''}`; I know this expression existed before, but maybe use the opportunity to make it a bit more readable? It's a bit hard to parse for my brain :) -- - Lukas