]> git.proxmox.com Git - proxmox-backup.git/blob - www/datastore/PruneAndGC.js
ui: add all online help refs found in docs
[proxmox-backup.git] / www / datastore / PruneAndGC.js
1 Ext.define('PBS.DataStorePruneAndGC', {
2 extend: 'Proxmox.grid.ObjectGrid',
3 alias: 'widget.pbsDataStorePruneAndGC',
4 mixins: ['Proxmox.Mixin.CBind'],
5
6 onlineHelp: 'maintenance_pruning',
7
8 cbindData: function(initial) {
9 let me = this;
10
11 me.datastore = encodeURIComponent(me.datastore);
12 me.url = `/api2/json/config/datastore/${me.datastore}`;
13 me.editorConfig = {
14 url: `/api2/extjs/config/datastore/${me.datastore}`,
15 };
16 return {};
17 },
18
19 controller: {
20 xclass: 'Ext.app.ViewController',
21
22 edit: function() { this.getView().run_editor(); },
23
24 garbageCollect: function() {
25 let me = this;
26 let view = me.getView();
27 Proxmox.Utils.API2Request({
28 url: `/admin/datastore/${view.datastore}/gc`,
29 method: 'POST',
30 failure: function(response) {
31 Ext.Msg.alert(gettext('Error'), response.htmlStatus);
32 },
33 success: function(response, options) {
34 Ext.create('Proxmox.window.TaskViewer', {
35 upid: response.result.data,
36 }).show();
37 },
38 });
39 },
40 },
41
42 tbar: [
43 {
44 xtype: 'proxmoxButton',
45 text: gettext('Edit'),
46 disabled: true,
47 handler: 'edit',
48 },
49 '-',
50 {
51 xtype: 'proxmoxButton',
52 text: gettext('Start Garbage Collection'),
53 selModel: null,
54 handler: 'garbageCollect',
55 },
56 ],
57
58 listeners: {
59 activate: function() { this.rstore.startUpdate(); },
60 destroy: function() { this.rstore.stopUpdate(); },
61 deactivate: function() { this.rstore.stopUpdate(); },
62 itemdblclick: 'edit',
63 },
64
65 rows: {
66 "gc-schedule": {
67 required: true,
68 defaultValue: Proxmox.Utils.NoneText,
69 header: gettext('Garbage Collection Schedule'),
70 editor: {
71 xtype: 'proxmoxWindowEdit',
72 title: gettext('GC Schedule'),
73 items: {
74 xtype: 'pbsCalendarEvent',
75 name: 'gc-schedule',
76 fieldLabel: gettext("GC Schedule"),
77 emptyText: Proxmox.Utils.noneText,
78 deleteEmpty: true,
79 },
80 },
81 },
82 "prune-schedule": {
83 required: true,
84 defaultValue: Proxmox.Utils.NoneText,
85 header: gettext('Prune Schedule'),
86 editor: {
87 xtype: 'proxmoxWindowEdit',
88 title: gettext('Prune Schedule'),
89 items: {
90 xtype: 'pbsCalendarEvent',
91 name: 'prune-schedule',
92 fieldLabel: gettext("Prune Schedule"),
93 emptyText: Proxmox.Utils.noneText,
94 deleteEmpty: true,
95 },
96 },
97 },
98 "keep-last": {
99 required: true,
100 header: gettext('Keep Last'),
101 editor: {
102 xtype: 'proxmoxWindowEdit',
103 title: gettext('Prune Options'),
104 onlineHelp: 'maintenance_pruning',
105 items: {
106 xtype: 'pbsPruneInputPanel',
107 isCreate: false,
108 },
109 },
110 },
111 "keep-hourly": {
112 required: true,
113 header: gettext('Keep Hourly'),
114 editor: {
115 xtype: 'proxmoxWindowEdit',
116 title: gettext('Prune Options'),
117 onlineHelp: 'maintenance_pruning',
118 items: {
119 xtype: 'pbsPruneInputPanel',
120 },
121 },
122 },
123 "keep-daily": {
124 required: true,
125 header: gettext('Keep Daily'),
126 editor: {
127 xtype: 'proxmoxWindowEdit',
128 title: gettext('Prune Options'),
129 onlineHelp: 'maintenance_pruning',
130 items: {
131 xtype: 'pbsPruneInputPanel',
132 },
133 },
134 },
135 "keep-weekly": {
136 required: true,
137 header: gettext('Keep Weekly'),
138 editor: {
139 xtype: 'proxmoxWindowEdit',
140 title: gettext('Prune Options'),
141 onlineHelp: 'maintenance_pruning',
142 items: {
143 xtype: 'pbsPruneInputPanel',
144 },
145 },
146 },
147 "keep-monthly": {
148 required: true,
149 header: gettext('Keep Monthly'),
150 editor: {
151 xtype: 'proxmoxWindowEdit',
152 title: gettext('Prune Options'),
153 onlineHelp: 'maintenance_pruning',
154 items: {
155 xtype: 'pbsPruneInputPanel',
156 },
157 },
158 },
159 "keep-yearly": {
160 required: true,
161 header: gettext('Keep Yearly'),
162 editor: {
163 xtype: 'proxmoxWindowEdit',
164 title: gettext('Prune Options'),
165 onlineHelp: 'maintenance_pruning',
166 items: {
167 xtype: 'pbsPruneInputPanel',
168 },
169 },
170 },
171 },
172 });