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 v2 1/4] ui: add GroupSelector
Date: Mon, 29 Nov 2021 15:39:40 +0100	[thread overview]
Message-ID: <20211129143943.1598243-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20211129143943.1598243-1-d.csapak@proxmox.com>

to select either a group from a datastore

for now it is expected to set the data in the store manually

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/Makefile              |  1 +
 www/form/GroupSelector.js | 54 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)
 create mode 100644 www/form/GroupSelector.js

diff --git a/www/Makefile b/www/Makefile
index 616c3e12..c975387c 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -42,6 +42,7 @@ JSSRC=							\
 	form/DataStoreSelector.js			\
 	form/CalendarEvent.js				\
 	form/PermissionPathSelector.js			\
+	form/GroupSelector.js				\
 	data/RunningTasksStore.js			\
 	button/TaskButton.js				\
 	config/UserView.js				\
diff --git a/www/form/GroupSelector.js b/www/form/GroupSelector.js
new file mode 100644
index 00000000..4bf51104
--- /dev/null
+++ b/www/form/GroupSelector.js
@@ -0,0 +1,54 @@
+Ext.define('pbs-groups', {
+    extend: 'Ext.data.Model',
+    fields: [
+	'backup-type',
+	'backup-id',
+	{
+	    name: 'group',
+	    type: 'string',
+	    convert: function(value, record) {
+		if (record.data['backup-type'] && record.data['backup-id']) {
+		    return `${record.data['backup-type']}/${record.data['backup-id']}`;
+		}
+		return value;
+	    },
+	},
+    ],
+    proxy: {
+	type: 'proxmox',
+    },
+});
+
+Ext.define('PBS.form.GroupSelector', {
+    extend: 'Proxmox.form.ComboGrid',
+    alias: 'widget.pbsGroupSelector',
+
+    allowBlank: false,
+    autoSelect: false,
+    notFoundIsValid: true,
+    editable: true,
+    valueField: 'group',
+    displayField: 'group',
+
+    store: {
+	sorters: 'group',
+	model: 'pbs-groups',
+    },
+
+    listConfig: {
+	minHeight: 80,
+	emptyText: gettext('No Groups'),
+	viewConfig: {
+	    deferEmptyText: false,
+	},
+	columns: [
+	    {
+		header: gettext('Group'),
+		sortable: true,
+		dataIndex: 'group',
+		renderer: Ext.String.htmlEncode,
+		flex: 1,
+	    },
+	],
+    },
+});
-- 
2.30.2





  reply	other threads:[~2021-11-29 14:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 14:39 [pbs-devel] [PATCH proxmox-backup v2 0/4] ui for group-filters Dominik Csapak
2021-11-29 14:39 ` Dominik Csapak [this message]
2021-11-29 14:39 ` [pbs-devel] [PATCH proxmox-backup v2 2/4] ui: add GroupFilter form field(container) Dominik Csapak
2021-11-29 14:39 ` [pbs-devel] [PATCH proxmox-backup v2 3/4] ui: tape/BackupJobEdit: add second tab with group filters Dominik Csapak
2021-11-29 14:39 ` [pbs-devel] [PATCH proxmox-backup v2 4/4] ui: SyncJobEdit: " Dominik Csapak
2021-12-01  5:49 ` [pbs-devel] applied: [PATCH proxmox-backup v2 0/4] ui for group-filters 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=20211129143943.1598243-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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal