]> git.proxmox.com Git - proxmox-backup.git/blob - www/tape/window/PoolEdit.js
tape: ui - remove drive from pool config
[proxmox-backup.git] / www / tape / window / PoolEdit.js
1 Ext.define('PBS.TapeManagement.PoolEditWindow', {
2 extend: 'Proxmox.window.Edit',
3 alias: 'widget.pbsPoolEditWindow',
4 mixins: ['Proxmox.Mixin.CBind'],
5
6 isCreate: true,
7 isAdd: true,
8 subject: gettext('Media Pool'),
9 cbindData: function(initialConfig) {
10 let me = this;
11
12 let poolid = initialConfig.poolid;
13 let baseurl = '/api2/extjs/config/media-pool';
14
15 me.isCreate = !poolid;
16 me.url = poolid ? `${baseurl}/${encodeURIComponent(poolid)}` : baseurl;
17 me.method = poolid ? 'PUT' : 'POST';
18
19 return { };
20 },
21
22 items: [
23 {
24 fieldLabel: gettext('Name'),
25 name: 'name',
26 xtype: 'pmxDisplayEditField',
27 renderer: Ext.htmlEncode,
28 allowBlank: false,
29 cbind: {
30 editable: '{isCreate}',
31 },
32 },
33 {
34 fieldLabel: gettext('Allocation'),
35 xtype: 'pbsAllocationSelector',
36 name: 'allocation',
37 skipEmptyText: true,
38 allowBlank: true,
39 autoSelect: false,
40 cbind: {
41 deleteEmpty: '{!isCreate}',
42 },
43 },
44 {
45 fieldLabel: gettext('Retention'),
46 xtype: 'pbsRetentionSelector',
47 name: 'retention',
48 skipEmptyText: true,
49 allowBlank: true,
50 autoSelect: false,
51 cbind: {
52 deleteEmpty: '{!isCreate}',
53 },
54 },
55 ],
56 });
57