[pbs-devel] [PATCH v2 proxmox-backup 09/15] ui: add verify job edit window

Dominik Csapak d.csapak at proxmox.com
Thu Oct 8 11:58:59 CEST 2020


one comment inline

On 10/7/20 11:03 AM, Hannes Laimer wrote:
> Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
> ---
>   www/Makefile                |  1 +
>   www/window/VerifyJobEdit.js | 89 +++++++++++++++++++++++++++++++++++++
>   2 files changed, 90 insertions(+)
>   create mode 100644 www/window/VerifyJobEdit.js
> 
> diff --git a/www/Makefile b/www/Makefile
> index a6c46718..e04af930 100644
> --- a/www/Makefile
> +++ b/www/Makefile
> @@ -20,6 +20,7 @@ JSSRC=							\
>   	config/DataStoreConfig.js			\
>   	window/UserEdit.js				\
>   	window/UserPassword.js				\
> +	window/VerifyJobEdit.js				\
>   	window/RemoteEdit.js				\
>   	window/SyncJobEdit.js				\
>   	window/ACLEdit.js				\
> diff --git a/www/window/VerifyJobEdit.js b/www/window/VerifyJobEdit.js
> new file mode 100644
> index 00000000..985d2ef6
> --- /dev/null
> +++ b/www/window/VerifyJobEdit.js
> @@ -0,0 +1,89 @@
> +Ext.define('PBS.window.VerifyJobEdit', {
> +    extend: 'Proxmox.window.Edit',
> +    alias: 'widget.pbsVerifyJobEdit',
> +    mixins: ['Proxmox.Mixin.CBind'],
> +
> +    userid: undefined,
> +
> +    onlineHelp: 'verifyjobs',
> +
> +    isAdd: true,
> +
> +    subject: gettext('VerifyJob'),
> +
> +    fieldDefaults: { labelWidth: 120 },
> +
> +    cbindData: function(initialConfig) {
> +	let me = this;
> +
> +	let baseurl = '/api2/extjs/config/verify';
> +	let id = initialConfig.id;
> +
> +	me.isCreate = !id;
> +	me.url = id ? `${baseurl}/${id}` : baseurl;
> +	me.method = id ? 'PUT' : 'POST';
> +	me.autoLoad = !!id;
> +	return { };
> +    },
> +
> +    items: {
> +	xtype: 'inputpanel',
> +	column1: [
> +	    {
> +		fieldLabel: gettext('Verify Job ID'),
> +		xtype: 'pmxDisplayEditField',
> +		name: 'id',
> +		renderer: Ext.htmlEncode,
> +		allowBlank: false,
> +		minLength: 4,
> +		cbind: {
> +		    editable: '{isCreate}',
> +		},
> +	    },
> +	    {
> +		fieldLabel: gettext('Datastore'),
> +		xtype: 'pbsDataStoreSelector',
> +		allowBlank: false,
> +		name: 'store',
> +	    },
> +	    {
> +		xtype: 'proxmoxintegerfield',
> +		fieldLabel: gettext('Days valid'),
> +		minValue: 1,
> +		value: '',
> +		allowBlank: true,
> +		name: 'outdated-after'

i would also add a

cbind: {
     deleteEmpty: '{!isCreate}'
}

here (basically every field that is optional and can be empty should 
have that)

> +	    },
> +	],
> +
> +	column2: [
> +	    {
> +		fieldLabel: gettext('Ignore verified'),
> +		xtype: 'proxmoxcheckbox',
> +		name: 'ignore-verified',
> +		uncheckedValue: false,
> +		value: true,
> +	    },
> +	    {
> +		fieldLabel: gettext('Schedule'),
> +		xtype: 'pbsCalendarEvent',
> +		name: 'schedule',
> +		emptyText: gettext('none'),
> +		cbind: {
> +		    deleteEmpty: '{!isCreate}',
> +		},
> +	    },
> +	],
> +
> +	columnB: [
> +	    {
> +		fieldLabel: gettext('Comment'),
> +		xtype: 'proxmoxtextfield',
> +		name: 'comment',
> +		cbind: {
> +		    deleteEmpty: '{!isCreate}',
> +		},
> +	    },
> +	],
> +    },
> +});
> 






More information about the pbs-devel mailing list