mirror of
https://git.proxmox.com/git/pmg-gui
synced 2025-06-02 15:24:34 +00:00
41 lines
825 B
JavaScript
41 lines
825 B
JavaScript
Ext.define('PMG.Application', {
|
|
extend: 'Ext.app.Application',
|
|
|
|
name: 'PMG',
|
|
|
|
// default fragment for the router
|
|
defaultToken: 'pmgDashboard',
|
|
|
|
stores: [
|
|
'NavigationStore'
|
|
],
|
|
|
|
layout: 'fit',
|
|
|
|
realignWindows: function() {
|
|
var modalwindows = Ext.ComponentQuery.query('window[modal]');
|
|
Ext.Array.forEach(modalwindows, function(item) {
|
|
item.center();
|
|
});
|
|
},
|
|
|
|
launch: function() {
|
|
var me = this;
|
|
// show login window if not loggedin
|
|
var loggedin = Proxmox.Utils.authOK();
|
|
Ext.on('resize', me.realignWindows);
|
|
|
|
if (loggedin) {
|
|
if (location.pathname === "/quarantine") {
|
|
Ext.create({ xtype: 'quarantineview' });
|
|
} else {
|
|
Ext.create({ xtype: 'mainview' });
|
|
}
|
|
} else {
|
|
Ext.create({ xtype: 'loginview' });
|
|
}
|
|
}
|
|
});
|
|
|
|
Ext.application('PMG.Application');
|