]>
Commit | Line | Data |
---|---|---|
98ad58fb DC |
1 | Ext.define('PBS.DataStoreEdit', { |
2 | extend: 'Proxmox.window.Edit', | |
3 | alias: 'widget.pbsDataStoreEdit', | |
4 | mixins: ['Proxmox.Mixin.CBind'], | |
5 | ||
6 | subject: gettext('Datastore'), | |
7 | isAdd: true, | |
8 | ||
1278aeec DC |
9 | bodyPadding: 0, |
10 | ||
98ad58fb DC |
11 | cbindData: function(initialConfig) { |
12 | var me = this; | |
13 | ||
14 | let name = initialConfig.name; | |
15 | let baseurl = '/api2/extjs/config/datastore'; | |
16 | ||
17 | me.isCreate = !name; | |
18 | me.url = name ? baseurl + '/' + name : baseurl; | |
19 | me.method = name ? 'PUT' : 'POST'; | |
20 | me.autoLoad = !!name; | |
21 | return {}; | |
22 | }, | |
23 | ||
67042466 TL |
24 | items: { |
25 | xtype: 'tabpanel', | |
26 | bodyPadding: 10, | |
27 | items: [ | |
28 | { | |
29 | title: gettext('General'), | |
30 | xtype: 'inputpanel', | |
31 | column1: [ | |
32 | { | |
33 | xtype: 'pmxDisplayEditField', | |
34 | cbind: { | |
35 | editable: '{isCreate}', | |
1278aeec | 36 | }, |
67042466 TL |
37 | name: 'name', |
38 | allowBlank: false, | |
39 | fieldLabel: gettext('Name'), | |
40 | }, | |
41 | { | |
42 | xtype: 'pmxDisplayEditField', | |
43 | cbind: { | |
44 | editable: '{isCreate}', | |
1278aeec | 45 | }, |
67042466 TL |
46 | name: 'path', |
47 | allowBlank: false, | |
48 | fieldLabel: gettext('Backing Path'), | |
49 | emptyText: gettext('An absolute path'), | |
50 | }, | |
51 | ], | |
52 | column2: [ | |
53 | { | |
54 | xtype: 'proxmoxtextfield', | |
55 | name: 'gc-schedule', | |
56 | fieldLabel: gettext("GC Schedule"), | |
57 | cbind: { | |
58 | deleteEmpty: '{!isCreate}', | |
1278aeec | 59 | }, |
67042466 TL |
60 | }, |
61 | { | |
62 | xtype: 'proxmoxtextfield', | |
63 | name: 'prune-schedule', | |
64 | fieldLabel: gettext("Prune Schedule"), | |
65 | cbind: { | |
66 | deleteEmpty: '{!isCreate}', | |
1278aeec | 67 | }, |
67042466 TL |
68 | }, |
69 | ], | |
70 | columnB: [ | |
71 | { | |
72 | xtype: 'textfield', | |
73 | name: 'comment', | |
74 | fieldLabel: gettext('Comment'), | |
75 | }, | |
76 | ], | |
77 | }, | |
78 | { | |
79 | title: gettext('Prune Options'), | |
80 | xtype: 'inputpanel', | |
81 | column1: [ | |
82 | { | |
83 | xtype: 'proxmoxintegerfield', | |
84 | fieldLabel: gettext('Keep Last'), | |
85 | name: 'keep-last', | |
86 | cbind: { | |
87 | deleteEmpty: '{!isCreate}', | |
1278aeec | 88 | }, |
67042466 TL |
89 | minValue: 1, |
90 | allowBlank: true, | |
91 | }, | |
92 | { | |
93 | xtype: 'proxmoxintegerfield', | |
94 | fieldLabel: gettext('Keep Daily'), | |
95 | name: 'keep-daily', | |
96 | cbind: { | |
97 | deleteEmpty: '{!isCreate}', | |
1278aeec | 98 | }, |
67042466 TL |
99 | minValue: 1, |
100 | allowBlank: true, | |
101 | }, | |
102 | { | |
103 | xtype: 'proxmoxintegerfield', | |
104 | fieldLabel: gettext('Keep Monthly'), | |
105 | name: 'keep-monthly', | |
106 | cbind: { | |
107 | deleteEmpty: '{!isCreate}', | |
1278aeec | 108 | }, |
67042466 TL |
109 | minValue: 1, |
110 | allowBlank: true, | |
111 | }, | |
112 | ], | |
113 | column2: [ | |
114 | { | |
115 | xtype: 'proxmoxintegerfield', | |
116 | fieldLabel: gettext('Keep Hourly'), | |
117 | name: 'keep-hourly', | |
118 | cbind: { | |
119 | deleteEmpty: '{!isCreate}', | |
1278aeec | 120 | }, |
67042466 TL |
121 | minValue: 1, |
122 | allowBlank: true, | |
123 | }, | |
124 | { | |
125 | xtype: 'proxmoxintegerfield', | |
126 | fieldLabel: gettext('Keep Weekly'), | |
127 | name: 'keep-weekly', | |
128 | cbind: { | |
129 | deleteEmpty: '{!isCreate}', | |
1278aeec | 130 | }, |
67042466 TL |
131 | minValue: 1, |
132 | allowBlank: true, | |
133 | }, | |
134 | { | |
135 | xtype: 'proxmoxintegerfield', | |
136 | fieldLabel: gettext('Keep Yearly'), | |
137 | name: 'keep-yearly', | |
138 | cbind: { | |
139 | deleteEmpty: '{!isCreate}', | |
1278aeec | 140 | }, |
67042466 TL |
141 | minValue: 1, |
142 | allowBlank: true, | |
143 | }, | |
144 | ], | |
145 | }, | |
146 | ], | |
147 | }, | |
98ad58fb | 148 | }); |