]>
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', 'keep-last',
15 'keep-hourly', 'keep-daily', 'keep-weekly', 'keep-monthly', 'keep-yearly',
19 url
: "/api2/json/config/datastore",
24 Ext
.define('PBS.DataStoreConfig', {
25 extend
: 'Ext.grid.GridPanel',
26 alias
: 'widget.pbsDataStoreConfig',
28 title
: gettext('Datastore Configuration'),
31 xclass
: 'Ext.app.ViewController',
33 createDataStore: function() {
35 Ext
.create('PBS.DataStoreEdit', {
44 editDataStore: function() {
46 let view
= me
.getView();
47 let selection
= view
.getSelection();
48 if (selection
.length
< 1) return;
50 let name
= encodeURIComponent(selection
[0].data
.name
);
51 Ext
.create('PBS.DataStoreEdit', {
61 onVerify: function() {
62 var view
= this.getView();
64 let rec
= view
.selModel
.getSelection()[0];
65 if (!(rec
&& rec
.data
)) return;
68 Proxmox
.Utils
.API2Request({
69 url
: `/admin/datastore/${data.name}/verify`,
71 failure: function(response
) {
72 Ext
.Msg
.alert(gettext('Error'), response
.htmlStatus
);
74 success: function(response
, options
) {
75 Ext
.create('Proxmox.window.TaskViewer', {
76 upid
: response
.result
.data
,
82 garbageCollect: function() {
84 let view
= me
.getView();
85 let selection
= view
.getSelection();
86 if (selection
.length
< 1) return;
88 let name
= encodeURIComponent(selection
[0].data
.name
);
89 Proxmox
.Utils
.API2Request({
90 url
: `/admin/datastore/${name}/gc`,
92 failure: function(response
) {
93 Ext
.Msg
.alert(gettext('Error'), response
.htmlStatus
);
95 success: function(response
, options
) {
96 Ext
.create('Proxmox.window.TaskViewer', {
97 upid
: response
.result
.data
,
103 reload: function() { this.getView().getStore().rstore
.load(); },
105 init: function(view
) {
106 Proxmox
.Utils
.monStoreErrors(view
, view
.getStore().rstore
);
113 autoDestroyRstore
: true,
117 storeid
: 'pbs-data-store-config',
118 model
: 'pbs-data-store-config',
126 xtype
: 'proxmoxButton',
128 text
: gettext('Create'),
129 handler
: 'createDataStore',
132 xtype
: 'proxmoxButton',
133 text
: gettext('Edit'),
135 handler
: 'editDataStore',
140 xtype
: 'proxmoxButton',
141 text
: gettext('Verify'),
146 xtype
: 'proxmoxButton',
147 text
: gettext('Start GC'),
149 handler
: 'garbageCollect',
155 header
: gettext('Name'),
161 header
: gettext('Path'),
167 header
: gettext('GC Schedule'),
170 dataIndex
: 'gc-schedule',
173 header
: gettext('Prune Schedule'),
176 dataIndex
: 'prune-schedule',
179 header
: gettext('Keep'),
182 text
: gettext('Last'),
183 dataIndex
: 'keep-last',
187 text
: gettext('Hourly'),
188 dataIndex
: 'keep-hourly',
192 text
: gettext('Daily'),
193 dataIndex
: 'keep-daily',
197 text
: gettext('Weekly'),
198 dataIndex
: 'keep-weekly',
202 text
: gettext('Monthly'),
203 dataIndex
: 'keep-monthly',
207 text
: gettext('Yearly'),
208 dataIndex
: 'keep-yearly',
214 header
: gettext('Comment'),
216 dataIndex
: 'comment',
217 renderer
: Ext
.String
.htmlEncode
,
224 itemdblclick
: 'editDataStore',