public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 4/4] ui: Set datastore usage related titles based on backend
Date: Thu, 31 Jul 2025 09:39:50 +0200	[thread overview]
Message-ID: <20250731073950.73526-6-c.ebner@proxmox.com> (raw)
In-Reply-To: <20250731073950.73526-1-c.ebner@proxmox.com>

If the datastore is backed by S3, replace the titles in the datastore
summary storage usage and the storage rdd chart to include the
information that this is local cache storage usage.

Further, the estimated full values are also not shown for local
datastore caches.

The intention is to make this clear to the user until a more powerful
summary panel is implemented specifically for s3 backed datastores.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 www/datastore/DataStoreListSummary.js | 10 ++++++++--
 www/datastore/Summary.js              | 12 ++++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/www/datastore/DataStoreListSummary.js b/www/datastore/DataStoreListSummary.js
index ff88afaa0..dad51fbd6 100644
--- a/www/datastore/DataStoreListSummary.js
+++ b/www/datastore/DataStoreListSummary.js
@@ -24,6 +24,7 @@ Ext.define('PBS.datastore.DataStoreListSummary', {
             error: '',
             removable: false,
             maintenance: '',
+            isS3: false,
         },
     },
     setTasks: function (taskdata, since) {
@@ -115,7 +116,12 @@ Ext.define('PBS.datastore.DataStoreListSummary', {
             return entry;
         });
 
-        me.lookup('historychart').setData(data);
+        let historyChart = me.lookup('historychart');
+        if (statusData['backend-type'] === 's3') {
+            vm.set('isS3', true);
+            historyChart.setTitle(gettext('Cache Usage History'));
+        }
+        historyChart.setData(data);
     },
 
     items: [
@@ -189,7 +195,7 @@ Ext.define('PBS.datastore.DataStoreListSummary', {
                         data: {
                             text: '{full}',
                         },
-                        visible: '{!error}',
+                        visible: '{!error && !isS3}',
                     },
                 },
                 {
diff --git a/www/datastore/Summary.js b/www/datastore/Summary.js
index cdb34aea3..af0363fc1 100644
--- a/www/datastore/Summary.js
+++ b/www/datastore/Summary.js
@@ -94,6 +94,10 @@ Ext.define('PBS.DataStoreInfo', {
             let counts = store.getById('counts').data.value;
             let used = store.getById('used').data.value;
             let total = store.getById('avail').data.value + used;
+            let backendType = store.getById('backend-type').data.value;
+            if (backendType === 's3') {
+                me.lookup('usage').title = gettext('Local Cache Usage');
+            }
 
             let usage = Proxmox.Utils.render_size_usage(used, total, true);
             vm.set('usagetext', usage);
@@ -152,6 +156,7 @@ Ext.define('PBS.DataStoreInfo', {
         {
             iconCls: 'fa fa-fw fa-hdd-o',
             title: gettext('Usage'),
+            reference: 'usage',
             bind: {
                 data: {
                     usage: '{usage}',
@@ -337,6 +342,7 @@ Ext.define('PBS.DataStoreSummary', {
         {
             xtype: 'proxmoxRRDChart',
             title: gettext('Storage usage (bytes)'),
+            name: 'usage-rrd-chart',
             fields: ['unpriv-total', 'used'],
             fieldTitles: [gettext('Total'), gettext('Storage usage')],
         },
@@ -437,6 +443,12 @@ Ext.define('PBS.DataStoreSummary', {
                 unmountBtn.setDisabled(false);
                 mountBtn.setDisabled(true);
                 lastRequestWasFailue = false;
+
+                let backendType = s.getById('backend-type').data.value;
+                if (backendType === 's3') {
+                    me.down('[name=usage-rrd-chart]').setTitle(gettext('Local Cache Usage (bytes)'));
+                }
+
             }
         });
 
-- 
2.47.2



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


      parent reply	other threads:[~2025-07-31  7:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-31  7:39 [pbs-devel] [RFC proxmox{, -backup} 0/5] switch local storage usage titles based on datastore backend Christian Ebner
2025-07-31  7:39 ` [pbs-devel] [PATCH proxmox 1/1] pbs-api-types: add backend type to datastore's status items Christian Ebner
2025-07-31  7:39 ` [pbs-devel] [PATCH proxmox-backup 1/4] api: status: expose backend type in datastore status list item Christian Ebner
2025-07-31  7:39 ` [pbs-devel] [PATCH proxmox-backup 2/4] datastore: introduce helper to get store's backend type Christian Ebner
2025-07-31  7:39 ` [pbs-devel] [PATCH proxmox-backup 3/4] api: datastore: expose the datastore backend type in the status output Christian Ebner
2025-07-31  7:39 ` Christian Ebner [this message]

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=20250731073950.73526-6-c.ebner@proxmox.com \
    --to=c.ebner@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