]>
git.proxmox.com Git - proxmox-backup.git/blob - www/config/DataStoreConfig.js
1 Ext
.define('pbs-datastore-list', {
2 extend
: 'Ext.data.Model',
3 fields
: ['name', 'comment'],
6 url
: "/api2/json/admin/datastore",
11 Ext
.define('pbs-data-store-config', {
12 extend
: 'Ext.data.Model',
14 'name', 'path', 'comment', 'gc-schedule', 'prune-schedule',
15 'verify-schedule', 'keep-last', 'keep-hourly', 'keep-daily',
16 'keep-weekly', 'keep-monthly', 'keep-yearly',
20 url
: "/api2/json/config/datastore",
25 Ext
.define('PBS.DataStoreConfig', {
26 extend
: 'Ext.grid.GridPanel',
27 alias
: 'widget.pbsDataStoreConfig',
29 title
: gettext('Datastore Configuration'),
32 xclass
: 'Ext.app.ViewController',
34 createDataStore: function() {
36 Ext
.create('PBS.DataStoreEdit', {
45 editDataStore: function() {
47 let view
= me
.getView();
48 let selection
= view
.getSelection();
49 if (selection
.length
< 1) return;
51 let name
= encodeURIComponent(selection
[0].data
.name
);
52 Ext
.create('PBS.DataStoreEdit', {
62 onVerify: function() {
63 var view
= this.getView();
65 let rec
= view
.selModel
.getSelection()[0];
66 if (!(rec
&& rec
.data
)) return;
69 Proxmox
.Utils
.API2Request({
70 url
: `/admin/datastore/${data.name}/verify`,
72 failure: function(response
) {
73 Ext
.Msg
.alert(gettext('Error'), response
.htmlStatus
);
75 success: function(response
, options
) {
76 Ext
.create('Proxmox.window.TaskViewer', {
77 upid
: response
.result
.data
,
83 garbageCollect: function() {
85 let view
= me
.getView();
86 let selection
= view
.getSelection();
87 if (selection
.length
< 1) return;
89 let name
= encodeURIComponent(selection
[0].data
.name
);
90 Proxmox
.Utils
.API2Request({
91 url
: `/admin/datastore/${name}/gc`,
93 failure: function(response
) {
94 Ext
.Msg
.alert(gettext('Error'), response
.htmlStatus
);
96 success: function(response
, options
) {
97 Ext
.create('Proxmox.window.TaskViewer', {
98 upid
: response
.result
.data
,
104 reload: function() { this.getView().getStore().rstore
.load(); },
106 init: function(view
) {
107 Proxmox
.Utils
.monStoreErrors(view
, view
.getStore().rstore
);
114 autoDestroyRstore
: true,
118 storeid
: 'pbs-data-store-config',
119 model
: 'pbs-data-store-config',
127 xtype
: 'proxmoxButton',
129 text
: gettext('Create'),
130 handler
: 'createDataStore',
133 xtype
: 'proxmoxButton',
134 text
: gettext('Edit'),
136 handler
: 'editDataStore',
141 xtype
: 'proxmoxButton',
142 text
: gettext('Verify'),
147 xtype
: 'proxmoxButton',
148 text
: gettext('Start GC'),
150 handler
: 'garbageCollect',
156 header
: gettext('Name'),
162 header
: gettext('Path'),
168 header
: gettext('GC Schedule'),
171 dataIndex
: 'gc-schedule',
174 header
: gettext('Prune Schedule'),
177 dataIndex
: 'prune-schedule',
180 header
: gettext('Keep'),
183 text
: gettext('Last'),
184 dataIndex
: 'keep-last',
188 text
: gettext('Hourly'),
189 dataIndex
: 'keep-hourly',
193 text
: gettext('Daily'),
194 dataIndex
: 'keep-daily',
198 text
: gettext('Weekly'),
199 dataIndex
: 'keep-weekly',
203 text
: gettext('Monthly'),
204 dataIndex
: 'keep-monthly',
208 text
: gettext('Yearly'),
209 dataIndex
: 'keep-yearly',
215 header
: gettext('Comment'),
217 dataIndex
: 'comment',
218 renderer
: Ext
.String
.htmlEncode
,
225 itemdblclick
: 'editDataStore',