public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Hannes Laimer <h.laimer@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 3/4] ui: update icon in datastore list when in maintenance mode
Date: Fri, 15 Apr 2022 07:28:16 +0000	[thread overview]
Message-ID: <20220415072817.14768-4-h.laimer@proxmox.com> (raw)
In-Reply-To: <20220415072817.14768-1-h.laimer@proxmox.com>

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
 www/NavigationTree.js | 13 +++++++++++--
 www/css/ext6-pbs.css  | 20 ++++++++++++++++++++
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/www/NavigationTree.js b/www/NavigationTree.js
index 576d05ab..bdaef538 100644
--- a/www/NavigationTree.js
+++ b/www/NavigationTree.js
@@ -1,6 +1,6 @@
 Ext.define('pbs-datastore-list', {
     extend: 'Ext.data.Model',
-    fields: ['name', 'comment'],
+    fields: ['name', 'comment', 'maintenance'],
     proxy: {
         type: 'proxmox',
         url: "/api2/json/admin/datastore",
@@ -230,13 +230,22 @@ Ext.define('PBS.view.main.NavigationTree', {
 		    j++;
 		}
 
+		const maintenance = records[i].data.maintenance;
+		const iconCls = maintenance ? 'fa fa-database pmx-tree-icon-custom maintenance' : 'fa fa-database';
 		if (getChildTextAt(j).localeCompare(name) !== 0) {
 		    list.insertChild(j, {
 			text: name,
 			path: `DataStore-${name}`,
-			iconCls: 'fa fa-database',
+			iconCls,
 			leaf: true,
 		    });
+		} else {
+		    list.replaceChild({
+			text: name,
+			path: `DataStore-${name}`,
+			iconCls,
+			leaf: true,
+		    }, list.getChildAt(j));
 		}
 	    }
 
diff --git a/www/css/ext6-pbs.css b/www/css/ext6-pbs.css
index 2edfa59e..471db580 100644
--- a/www/css/ext6-pbs.css
+++ b/www/css/ext6-pbs.css
@@ -264,6 +264,26 @@ span.snapshot-comment-column {
     background-image:url(../images/icon-maintenance.svg);
 }
 
+/* the small icons TODO move to proxmox-widget-toolkit */
+.pmx-tree-icon-custom:after {
+    position: relative;
+    left: -4px;
+    top: 2px;
+    font-size: 0.8em;
+    text-shadow: -1px 0px 2px #fff;
+    content: "\ ";
+}
+
+/* datastore maintenance */
+.pmx-tree-icon-custom.maintenance:after {
+    content: "\f0ad";
+    color: #000;
+}
+
+.pmx-tree-icon-custom.maintenance:before {
+    color: #888;
+}
+
 /*' PBS specific icons */
 
 .pbs-icon-tape {
-- 
2.30.2





  parent reply	other threads:[~2022-04-15  7:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15  7:28 [pbs-devel] [PATCH proxmox-backup 0/4] improve ui for " Hannes Laimer
2022-04-15  7:28 ` [pbs-devel] [PATCH proxmox-backup 1/4] ui: add summary mask when in " Hannes Laimer
2022-04-25  6:27   ` Thomas Lamprecht
2022-04-15  7:28 ` [pbs-devel] [PATCH proxmox-backup 2/4] api2: DataStoreListItem add maintenance info Hannes Laimer
2022-04-19 11:19   ` Fabian Grünbichler
2022-04-25  6:31   ` Thomas Lamprecht
2022-04-15  7:28 ` Hannes Laimer [this message]
2022-04-15  7:28 ` [pbs-devel] [PATCH proxmox-backup 4/4][optional] ui: update datastore list more often Hannes Laimer

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=20220415072817.14768-4-h.laimer@proxmox.com \
    --to=h.laimer@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