mirror of
https://git.proxmox.com/git/pmg-gui
synced 2025-06-05 07:38:26 +00:00

this is the main application class, which is responsible for loading the main/login view also for recentering modal windows Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
32 lines
665 B
JavaScript
32 lines
665 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);
|
|
Ext.create({ xtype: loggedin ? 'mainview' : 'loginview' });
|
|
}
|
|
});
|
|
|
|
Ext.application('PMG.Application');
|