]> git.proxmox.com Git - proxmox-backup.git/blob - www/window/SyncJobEdit.js
ui: add calendar event selector
[proxmox-backup.git] / www / window / SyncJobEdit.js
1 Ext.define('PBS.window.SyncJobEdit', {
2 extend: 'Proxmox.window.Edit',
3 alias: 'widget.pbsSyncJobEdit',
4 mixins: ['Proxmox.Mixin.CBind'],
5
6 userid: undefined,
7
8 isAdd: true,
9
10 subject: gettext('SyncJob'),
11
12 fieldDefaults: { labelWidth: 120 },
13
14 cbindData: function(initialConfig) {
15 let me = this;
16
17 let baseurl = '/api2/extjs/config/sync';
18 let id = initialConfig.id;
19
20 me.isCreate = !id;
21 me.url = id ? `${baseurl}/${id}` : baseurl;
22 me.method = id ? 'PUT' : 'POST';
23 me.autoLoad = !!id;
24 return { };
25 },
26
27 items: {
28 xtype: 'inputpanel',
29 column1: [
30 {
31 fieldLabel: gettext('Sync Job ID'),
32 xtype: 'pmxDisplayEditField',
33 name: 'id',
34 renderer: Ext.htmlEncode,
35 allowBlank: false,
36 minLength: 4,
37 cbind: {
38 editable: '{isCreate}',
39 },
40 },
41 {
42 fieldLabel: gettext('Source Remote'),
43 xtype: 'pbsRemoteSelector',
44 allowBlank: false,
45 name: 'remote',
46 },
47 {
48 fieldLabel: gettext('Source Datastore'),
49 xtype: 'proxmoxtextfield',
50 allowBlank: false,
51 name: 'remote-store',
52 },
53 {
54 fieldLabel: gettext('Local Datastore'),
55 xtype: 'pbsDataStoreSelector',
56 allowBlank: false,
57 name: 'store',
58 },
59 ],
60
61 column2: [
62 {
63 fieldLabel: gettext('Remove vanished'),
64 xtype: 'proxmoxcheckbox',
65 name: 'remove-vanished',
66 uncheckedValue: false,
67 value: false,
68 },
69 {
70 fieldLabel: gettext('Schedule'),
71 xtype: 'pbsCalendarEvent',
72 name: 'schedule',
73 emptyText: gettext('none'),
74 cbind: {
75 deleteEmpty: '{!isCreate}',
76 },
77 },
78 ],
79
80 columnB: [
81 {
82 fieldLabel: gettext('Comment'),
83 xtype: 'proxmoxtextfield',
84 name: 'comment',
85 cbind: {
86 deleteEmpty: '{!isCreate}',
87 },
88 },
89 ],
90 },
91 });