public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 3/5] ui: form/DataStoreSelector: show maintenance mode in selector
Date: Tue, 17 May 2022 08:52:13 +0200	[thread overview]
Message-ID: <20220517065215.327699-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20220517065215.327699-1-d.csapak@proxmox.com>

to not having to query the activeTasks everywhere, change the renderer
to omit the check/spinner when no activeTasks are given

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/Utils.js                  | 17 ++++++++++-------
 www/form/DataStoreSelector.js |  9 +++++++++
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/www/Utils.js b/www/Utils.js
index 838b4511..b277cd99 100644
--- a/www/Utils.js
+++ b/www/Utils.js
@@ -662,14 +662,17 @@ Ext.define('PBS.Utils', {
 
 	let [type, message] = PBS.Utils.parseMaintenanceMode(mode);
 
-	const conflictingTasks = activeTasks.write + (type === 'offline' ? activeTasks.read : 0);
-
 	let extra = '';
-	if (conflictingTasks > 0) {
-	    extra += '| <i class="fa fa-spinner fa-pulse fa-fw"></i> ';
-	    extra += Ext.String.format(gettext('{0} conflicting tasks still active.'), conflictingTasks);
-	} else {
-	    extra += '<i class="fa fa-check"></i>';
+
+	if (activeTasks !== undefined) {
+	    const conflictingTasks = activeTasks.write + (type === 'offline' ? activeTasks.read : 0);
+
+	    if (conflictingTasks > 0) {
+		extra += '| <i class="fa fa-spinner fa-pulse fa-fw"></i> ';
+		extra += Ext.String.format(gettext('{0} conflicting tasks still active.'), conflictingTasks);
+	    } else {
+		extra += '<i class="fa fa-check"></i>';
+	    }
 	}
 
 	if (message) {
diff --git a/www/form/DataStoreSelector.js b/www/form/DataStoreSelector.js
index a1471a84..90f20bee 100644
--- a/www/form/DataStoreSelector.js
+++ b/www/form/DataStoreSelector.js
@@ -29,6 +29,15 @@ Ext.define('PBS.form.DataStoreSelector', {
 		renderer: Ext.String.htmlEncode,
 		flex: 1,
 	    },
+	    {
+		header: gettext('Maintenance'),
+		sortable: true,
+		dataIndex: 'maintenance',
+		renderer: (value) => {
+		    return PBS.Utils.renderMaintenance(value);
+		},
+		flex: 1,
+	    }
 	],
     },
 });
-- 
2.30.2





  parent reply	other threads:[~2022-05-17  6:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17  6:52 [pbs-devel] [PATCH proxmox-backup 1/5] tape/pool_writer: give proper types to 'contains_snapshot' Dominik Csapak
2022-05-17  6:52 ` [pbs-devel] [PATCH proxmox-backup 2/5] ui: form/NamespaceSelector: show proper emptyText Dominik Csapak
2022-05-17 11:41   ` [pbs-devel] applied: " Thomas Lamprecht
2022-05-17  6:52 ` Dominik Csapak [this message]
2022-05-17  8:53   ` [pbs-devel] applied: [PATCH proxmox-backup 3/5] ui: form/DataStoreSelector: show maintenance mode in selector Thomas Lamprecht
2022-05-17  6:52 ` [pbs-devel] [PATCH proxmox-backup 4/5] ui: datastore/Summary: change storage axis to power of two Dominik Csapak
2022-05-17  8:09   ` Thomas Lamprecht
2022-05-17  8:20     ` Dominik Csapak
2022-05-17  8:32       ` Thomas Lamprecht
2022-05-17  6:52 ` [pbs-devel] [PATCH proxmox-backup 5/5] ui: SyncView/SyncJobEdit: unify store/namespace gettext Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220517065215.327699-3-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal