ui: add calendar event selector

modelled after the PVE one, but we are not 1:1 compatible and need
deleteEmpty support. For now let's just have some duplicate code, but
we should try to move this to widget toolkit ASAP.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2020-07-21 19:32:25 +02:00
parent 06a94edcf6
commit 41e4388005
4 changed files with 73 additions and 3 deletions

View File

@ -15,6 +15,9 @@ Ext.define('PBS.DataStoreEdit', {
let baseurl = '/api2/extjs/config/datastore';
me.isCreate = !name;
if (!me.isCreate) {
me.defaultFocus = 'textfield[name=comment]';
}
me.url = name ? baseurl + '/' + name : baseurl;
me.method = name ? 'PUT' : 'POST';
me.autoLoad = !!name;
@ -51,17 +54,19 @@ Ext.define('PBS.DataStoreEdit', {
],
column2: [
{
xtype: 'proxmoxtextfield',
xtype: 'pbsCalendarEvent',
name: 'gc-schedule',
fieldLabel: gettext("GC Schedule"),
emptyText: gettext('none'),
cbind: {
deleteEmpty: '{!isCreate}',
},
},
{
xtype: 'proxmoxtextfield',
xtype: 'pbsCalendarEvent',
name: 'prune-schedule',
fieldLabel: gettext("Prune Schedule"),
emptyText: gettext('none'),
cbind: {
deleteEmpty: '{!isCreate}',
},

View File

@ -68,7 +68,7 @@ Ext.define('PBS.window.SyncJobEdit', {
},
{
fieldLabel: gettext('Schedule'),
xtype: 'proxmoxtextfield',
xtype: 'pbsCalendarEvent',
name: 'schedule',
emptyText: gettext('none'),
cbind: {