proxmox-backup/www/Utils.js
Dominik Csapak c0ac207453 ui: add ACL panel to datastores
by introducing a datastorepanel (a TabPanel) which holds the content
and acl panel for now.

to be able to handle this in the router, we have to change the logic
of how to select the datastore from using the subpath to putting it
into the path (and extracting it when necessary)

if we need this again (e.g. possibly for remotes), we can further
refactor this logic to be more generic

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-05-20 13:27:13 +02:00

34 lines
824 B
JavaScript

/*global Proxmox */
Ext.ns('PBS');
console.log("Starting Backup Server GUI");
Ext.define('PBS.Utils', {
singleton: true,
updateLoginData: function(data) {
Proxmox.CSRFPreventionToken = data.CSRFPreventionToken;
Proxmox.UserName = data.username;
//console.log(data.ticket);
// 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);
},
dataStorePrefix: 'DataStore-',
getDataStoreFromPath: function(path) {
return path.slice(PBS.Utils.dataStorePrefix.length);
},
isDataStorePath: function(path) {
return path.indexOf(PBS.Utils.dataStorePrefix) === 0;
},
constructor: function() {
var me = this;
// do whatever you want here
}
});