From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 2/6] ui: refactor get_type_icon_cls
Date: Tue, 2 Feb 2021 14:00:35 +0100 [thread overview]
Message-ID: <20210202130039.6564-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20210202130039.6564-1-d.csapak@proxmox.com>
we need this later again
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
www/Utils.js | 12 ++++++++++++
www/datastore/Content.js | 10 ++--------
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/www/Utils.js b/www/Utils.js
index e6ea64ea..acfc4556 100644
--- a/www/Utils.js
+++ b/www/Utils.js
@@ -260,6 +260,18 @@ Ext.define('PBS.Utils', {
return dedup;
},
+ get_type_icon_cls: function(btype) {
+ var cls = '';
+ if (btype.startsWith('vm')) {
+ cls = 'fa-desktop';
+ } else if (btype.startsWith('ct')) {
+ cls = 'fa-cube';
+ } else if (btype.startsWith('host')) {
+ cls = 'fa-building';
+ }
+ return cls;
+ },
+
constructor: function() {
var me = this;
diff --git a/www/datastore/Content.js b/www/datastore/Content.js
index 12dacb89..d0cf3e0b 100644
--- a/www/datastore/Content.js
+++ b/www/datastore/Content.js
@@ -105,14 +105,8 @@ Ext.define('PBS.DataStoreContent', {
continue;
}
- var cls = '';
- if (btype === 'vm') {
- cls = 'fa-desktop';
- } else if (btype === 'ct') {
- cls = 'fa-cube';
- } else if (btype === 'host') {
- cls = 'fa-building';
- } else {
+ var cls = PBS.Utils.get_type_icon_cls(btype);
+ if (cls === "") {
console.warn(`got unknown backup-type '${btype}'`);
continue; // FIXME: auto render? what do?
}
--
2.20.1
next prev parent reply other threads:[~2021-02-02 13:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-02 13:00 [pbs-devel] [PATCH proxmox-backup 1/6] api2/types/tape/media: add media_set_ctime to MediaContentEntry Dominik Csapak
2021-02-02 13:00 ` Dominik Csapak [this message]
2021-02-02 13:00 ` [pbs-devel] [PATCH proxmox-backup 3/6] ui: tape: rework BackupOverview Dominik Csapak
2021-02-02 13:00 ` [pbs-devel] [PATCH proxmox-backup 4/6] ui: tape: TapeBackupWindow: add missing DriveSelector Dominik Csapak
2021-02-02 13:00 ` [pbs-devel] [PATCH proxmox-backup 5/6] ui: tape: add Restore Window Dominik Csapak
2021-02-02 13:00 ` [pbs-devel] [PATCH proxmox-backup 6/6] ui: tape: add TapeInventory panel Dominik Csapak
2021-02-02 13:49 ` [pbs-devel] applied: [PATCH proxmox-backup 1/6] api2/types/tape/media: add media_set_ctime to MediaContentEntry Dietmar Maurer
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=20210202130039.6564-2-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