From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [RFC v2 manager 16/20] content view: allow specifying which columns to show on init
Date: Wed, 16 Sep 2020 14:50:37 +0200 [thread overview]
Message-ID: <20200916125041.4151-17-f.ebner@proxmox.com> (raw)
In-Reply-To: <20200916125041.4151-1-f.ebner@proxmox.com>
depending on the content type we might want to show different
information, e.g. parent for cloned VM/CT images (would have to
be added to the model first)
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
www/manager6/storage/ContentView.js | 60 +++++++++++++++++------------
1 file changed, 35 insertions(+), 25 deletions(-)
diff --git a/www/manager6/storage/ContentView.js b/www/manager6/storage/ContentView.js
index 3b6b817a..0f1bbc0c 100644
--- a/www/manager6/storage/ContentView.js
+++ b/www/manager6/storage/ContentView.js
@@ -311,35 +311,45 @@ Ext.define('PVE.storage.ContentView', {
}
);
+ var availableColumns = {
+ 'name': {
+ header: gettext('Name'),
+ flex: 1,
+ sortable: true,
+ renderer: PVE.Utils.render_storage_content,
+ dataIndex: 'text'
+ },
+ 'date': {
+ header: gettext('Date'),
+ width: 150,
+ dataIndex: 'vdate'
+ },
+ 'format': {
+ header: gettext('Format'),
+ width: 100,
+ dataIndex: 'format'
+ },
+ 'size': {
+ header: gettext('Size'),
+ width: 100,
+ renderer: Proxmox.Utils.format_size,
+ dataIndex: 'size'
+ },
+ };
+
+ if (!me.showColumns) {
+ me.showColumns = ['name', 'date', 'format', 'size'];
+ }
+ var columns = [];
+ me.showColumns.forEach(function(datum) {
+ columns.push(availableColumns[datum]);
+ });
+
Ext.apply(me, {
store: store,
selModel: sm,
tbar: me.tbar,
- columns: [
- {
- header: gettext('Name'),
- flex: 1,
- sortable: true,
- renderer: PVE.Utils.render_storage_content,
- dataIndex: 'text'
- },
- {
- header: gettext('Date'),
- width: 150,
- dataIndex: 'vdate'
- },
- {
- header: gettext('Format'),
- width: 100,
- dataIndex: 'format'
- },
- {
- header: gettext('Size'),
- width: 100,
- renderer: Proxmox.Utils.format_size,
- dataIndex: 'size'
- }
- ],
+ columns: columns,
listeners: {
activate: reload
}
--
2.20.1
next prev parent reply other threads:[~2020-09-16 12:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-16 12:50 [pve-devel] [PATCH-SERIES v2 manager] split up content view into a view for each type Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 01/20] fix extension filter for upload window Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 02/20] config panel: allow new nodes to be added later Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 03/20] storage panel/browser: use insertNodes function Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 04/20] add CD ROM and lxc icons for treelist-item-icon Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 05/20] use separate view for each content type Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 06/20] remove the now unnecessary grouping by " Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 07/20] remove the now unneccessary content type column Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 08/20] content view: allow specifying title bar elements for init Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 09/20] turn {nodename, storage, sm} into object variables Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 10/20] add upload button conditionally Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 11/20] create and use TemplateView Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 12/20] create and use BackupView Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 13/20] get rid of unneccessary enableFn's Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 14/20] create ImageView and use it for VM and CT images Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 15/20] simplify reload call Fabian Ebner
2020-09-16 12:50 ` Fabian Ebner [this message]
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 17/20] group backups by backup groups in backup view Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 18/20] allow child classes of ContentView to specify their own listeners Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 19/20] add CSS for button in grid's group header Fabian Ebner
2020-09-16 12:50 ` [pve-devel] [PATCH v2 manager 20/20] backup view: add prune window Fabian Ebner
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=20200916125041.4151-17-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-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