]> git.proxmox.com Git - pmg-gui.git/blob - js/Application.js
add new quarantine view
[pmg-gui.git] / js / Application.js
1 Ext.define('PMG.Application', {
2 extend: 'Ext.app.Application',
3
4 name: 'PMG',
5
6 // default fragment for the router
7 defaultToken: 'pmgDashboard',
8
9 stores: [
10 'NavigationStore'
11 ],
12
13 layout: 'fit',
14
15 realignWindows: function() {
16 var modalwindows = Ext.ComponentQuery.query('window[modal]');
17 Ext.Array.forEach(modalwindows, function(item) {
18 item.center();
19 });
20 },
21
22 launch: function() {
23 var me = this;
24 // show login window if not loggedin
25 var loggedin = Proxmox.Utils.authOK();
26 Ext.on('resize', me.realignWindows);
27
28 if (loggedin) {
29 if (location.pathname === "/quarantine") {
30 Ext.create({ xtype: 'quarantineview' });
31 } else {
32 Ext.create({ xtype: 'mainview' });
33 }
34 } else {
35 Ext.create({ xtype: 'loginview' });
36 }
37 }
38 });
39
40 Ext.application('PMG.Application');