From 709584719d5931f03869ab01459c3951ce2fa1b2 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 29 May 2020 10:53:40 +0200 Subject: [PATCH] ui: add RemoteSelector and DataStoreSelector Signed-off-by: Dominik Csapak --- www/Makefile | 2 ++ www/form/DataStoreSelector.js | 34 +++++++++++++++++++++++++++++ www/form/RemoteSelector.js | 40 +++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 www/form/DataStoreSelector.js create mode 100644 www/form/RemoteSelector.js diff --git a/www/Makefile b/www/Makefile index 46c7e7bc..fb5b1d55 100644 --- a/www/Makefile +++ b/www/Makefile @@ -6,6 +6,8 @@ IMAGES := \ JSSRC= \ form/UserSelector.js \ + form/RemoteSelector.js \ + form/DataStoreSelector.js \ config/UserView.js \ config/RemoteView.js \ config/ACLView.js \ diff --git a/www/form/DataStoreSelector.js b/www/form/DataStoreSelector.js new file mode 100644 index 00000000..692ca6a5 --- /dev/null +++ b/www/form/DataStoreSelector.js @@ -0,0 +1,34 @@ +Ext.define('PBS.form.DataStoreSelector', { + extend: 'Proxmox.form.ComboGrid', + alias: 'widget.pbsDataStoreSelector', + + allowBlank: false, + autoSelect: false, + valueField: 'store', + displayField: 'store', + + store: { + model: 'pbs-datastore-list', + autoLoad: true, + sorters: 'store', + }, + + listConfig: { + columns: [ + { + header: gettext('DataStore'), + sortable: true, + dataIndex: 'store', + renderer: Ext.String.htmlEncode, + flex: 1, + }, + { + header: gettext('Comment'), + sortable: true, + dataIndex: 'comment', + renderer: Ext.String.htmlEncode, + flex: 1, + }, + ], + }, +}); diff --git a/www/form/RemoteSelector.js b/www/form/RemoteSelector.js new file mode 100644 index 00000000..3f55ef1f --- /dev/null +++ b/www/form/RemoteSelector.js @@ -0,0 +1,40 @@ +Ext.define('PBS.form.RemoteSelector', { + extend: 'Proxmox.form.ComboGrid', + alias: 'widget.pbsRemoteSelector', + + allowBlank: false, + autoSelect: false, + valueField: 'name', + displayField: 'name', + + store: { + model: 'pmx-remotes', + autoLoad: true, + sorters: 'name', + }, + + listConfig: { + columns: [ + { + header: gettext('Remote'), + sortable: true, + dataIndex: 'name', + renderer: Ext.String.htmlEncode, + flex: 1, + }, + { + header: gettext('Host'), + sortable: true, + dataIndex: 'host', + flex: 1, + }, + { + header: gettext('User name'), + sortable: true, + dataIndex: 'userid', + renderer: Ext.String.htmlEncode, + flex: 1, + }, + ], + }, +});