2018-12-05 11:39:40 +00:00
|
|
|
/*global Proxmox */
|
|
|
|
Ext.ns('PBS');
|
|
|
|
|
|
|
|
console.log("Starting Backup Server GUI");
|
|
|
|
|
|
|
|
Ext.define('PBS.Utils', {
|
|
|
|
singleton: true,
|
|
|
|
|
2019-01-30 14:14:20 +00:00
|
|
|
updateLoginData: function(data) {
|
|
|
|
Proxmox.CSRFPreventionToken = data.CSRFPreventionToken;
|
|
|
|
Proxmox.UserName = data.username;
|
2019-12-17 14:44:34 +00:00
|
|
|
//console.log(data.ticket);
|
2019-01-31 09:08:08 +00:00
|
|
|
// fixme: use secure flag once we have TLS
|
|
|
|
//Ext.util.Cookies.set('PBSAuthCookie', data.ticket, null, '/', null, true );
|
|
|
|
Ext.util.Cookies.set('PBSAuthCookie', data.ticket, null, '/', null, false);
|
2019-01-30 14:14:20 +00:00
|
|
|
},
|
|
|
|
|
2020-05-20 10:15:38 +00:00
|
|
|
dataStorePrefix: 'DataStore-',
|
|
|
|
|
|
|
|
getDataStoreFromPath: function(path) {
|
|
|
|
return path.slice(PBS.Utils.dataStorePrefix.length);
|
|
|
|
},
|
|
|
|
|
|
|
|
isDataStorePath: function(path) {
|
|
|
|
return path.indexOf(PBS.Utils.dataStorePrefix) === 0;
|
|
|
|
},
|
|
|
|
|
2018-12-05 11:39:40 +00:00
|
|
|
constructor: function() {
|
|
|
|
var me = this;
|
|
|
|
|
|
|
|
// do whatever you want here
|
2020-05-25 17:06:47 +00:00
|
|
|
Proxmox.Utils.override_task_descriptions({
|
|
|
|
garbage_collection: ['Datastore', gettext('Garbage collect') ],
|
|
|
|
backup: [ '', gettext('Backup') ],
|
|
|
|
reader: [ '', gettext('Read datastore objects') ], // FIXME: better one
|
|
|
|
});
|
2018-12-05 11:39:40 +00:00
|
|
|
}
|
|
|
|
});
|