]> git.proxmox.com Git - proxmox-backup.git/blob - www/Utils.js
ui: add some task log description mappings
[proxmox-backup.git] / www / Utils.js
1 /*global Proxmox */
2 Ext.ns('PBS');
3
4 console.log("Starting Backup Server GUI");
5
6 Ext.define('PBS.Utils', {
7 singleton: true,
8
9 updateLoginData: function(data) {
10 Proxmox.CSRFPreventionToken = data.CSRFPreventionToken;
11 Proxmox.UserName = data.username;
12 //console.log(data.ticket);
13 // fixme: use secure flag once we have TLS
14 //Ext.util.Cookies.set('PBSAuthCookie', data.ticket, null, '/', null, true );
15 Ext.util.Cookies.set('PBSAuthCookie', data.ticket, null, '/', null, false);
16 },
17
18 dataStorePrefix: 'DataStore-',
19
20 getDataStoreFromPath: function(path) {
21 return path.slice(PBS.Utils.dataStorePrefix.length);
22 },
23
24 isDataStorePath: function(path) {
25 return path.indexOf(PBS.Utils.dataStorePrefix) === 0;
26 },
27
28 constructor: function() {
29 var me = this;
30
31 // do whatever you want here
32 Proxmox.Utils.override_task_descriptions({
33 garbage_collection: ['Datastore', gettext('Garbage collect') ],
34 backup: [ '', gettext('Backup') ],
35 reader: [ '', gettext('Read datastore objects') ], // FIXME: better one
36 });
37 }
38 });