]> git.proxmox.com Git - proxmox-backup.git/blame - www/window/NamespaceEdit.js
ui: show removed and pending data of last run in bytes
[proxmox-backup.git] / www / window / NamespaceEdit.js
CommitLineData
a7f5e641
TL
1Ext.define('PBS.window.NamespaceEdit', {
2 extend: 'Proxmox.window.Edit',
3 xtype: 'pbsNamespaceEdit', // for now rather "NamespaceAdd"
4 mixins: ['Proxmox.Mixin.CBind'],
5
72e344a1 6 onlineHelp: 'storage-namespaces',
a7f5e641
TL
7
8 isCreate: true,
9 subject: gettext('Namespace'),
10 // avoid that the trigger of the combogrid fields open on window show
3d2baf41 11 defaultFocus: 'proxmoxtextfield[name=name]',
a7f5e641
TL
12
13 cbind: {
14 url: '/api2/extjs/admin/datastore/{datastore}/namespace',
15 },
16 method: 'POST',
17
18 width: 450,
19 fieldDefaults: {
20 labelWidth: 120,
21 },
22
23 items: {
24 xtype: 'inputpanel',
25 onGetValues: function(values) {
26 if (values.parent === '') {
27 delete values.parent;
28 }
29 return values;
30 },
31 items: [
32 {
33 xtype: 'pbsNamespaceSelector',
34 name: 'parent',
35 fieldLabel: gettext('Parent Namespace'),
36 cbind: {
15808a90 37 value: '{namespace}',
a7f5e641
TL
38 datastore: '{datastore}',
39 },
40 },
41 {
42 xtype: 'proxmoxtextfield',
43 name: 'name',
44 fieldLabel: gettext('Namespace Name'),
45 value: '',
46 allowBlank: false,
47 maxLength: 31,
48 regex: PBS.Utils.SAFE_ID_RE,
49 regexText: gettext("Only alpha numerical, '_' and '-' (if not at start) allowed"),
50 },
51 ],
52 },
53});
60b9676f
TL
54
55Ext.define('PBS.window.NamespaceDelete', {
3d2baf41 56 extend: 'Proxmox.window.SafeDestroy',
60b9676f
TL
57 xtype: 'pbsNamespaceDelete',
58 mixins: ['Proxmox.Mixin.CBind'],
59
60b9676f
TL
60 viewModel: {},
61
3d2baf41
TL
62 autoShow: true,
63 taskName: 'delete-namespace',
60b9676f
TL
64
65 cbind: {
66 url: '/api2/extjs/admin/datastore/{datastore}/namespace',
67 },
3d2baf41
TL
68 additionalItems: [
69 {
70 xtype: 'proxmoxcheckbox',
71 name: 'delete-groups',
72 reference: 'rmGroups',
73 boxLabel: gettext('Delete all Backup Groups'),
74 value: false,
75 listeners: {
76 change: function(field, value) {
77 let win = field.up('proxmoxSafeDestroy');
78 if (value) {
79 win.params['delete-groups'] = value;
80 } else {
81 delete win.params['delete-groups'];
82 }
60b9676f 83 },
60b9676f 84 },
3d2baf41
TL
85 },
86 {
87 xtype: 'box',
88 padding: '5 0 0 0',
89 html: `<span class="pmx-hint">${gettext('Note')}</span>: `
90 + gettext('This will permanently remove all backups from the current namespace and all namespaces below it!'),
91 bind: {
92 hidden: '{!rmGroups.checked}',
60b9676f 93 },
3d2baf41
TL
94 },
95 ],
96
97 initComponent: function() {
98 let me = this;
99 me.title = Ext.String.format(gettext("Destroy Namespace '{0}'"), me.namespace);
100 me.params = { ns: me.namespace };
101
102 me.callParent();
60b9676f
TL
103 },
104});