var rt = me.down('pveResourceTree');
rt.setDatacenterText(loginData.clustername);
+ PVE.ClusterName = loginData.clustername;
if (loginData.cap) {
Ext.state.Manager.set('GuiCap', loginData.cap);
var me = this;
Proxmox.Utils.authClear();
+ Ext.state.Manager.clear('GuiCap');
Proxmox.UserName = null;
me.loginData = null;
me.login = null;
me.updateLoginData(data);
Proxmox.Utils.checked_command(function() {}); // display subscription status
- }
+ },
});
}
me.onLogin(null);
me.login.show();
},
- initComponent : function() {
+ initComponent: function() {
var me = this;
Ext.tip.QuickTipManager.init();
if (!Proxmox.Utils.authOK()) {
me.showLogin();
- } else {
+ } else {
if (me.loginData) {
me.onLogin(me.loginData);
}
}
Ext.Ajax.request({
- params: {
+ params: {
username: Proxmox.UserName,
- password: ticket
+ password: ticket,
},
url: '/api2/json/access/ticket',
method: 'POST',
success: function(response, opts) {
var obj = Ext.decode(response.responseText);
me.updateLoginData(obj.data);
- }
+ },
});
},
- interval: 15*60*1000
+ interval: 15*60*1000,
});
-
- }
+ },
});
Ext.define('PVE.StdWorkspace', {
// private
setContent: function(comp) {
var me = this;
-
+
var cont = me.child('#content');
var lay = cont.getLayout();
cont.add(comp);
if (cur !== null && lay.getNext()) {
lay.next();
- var task = Ext.create('Ext.util.DelayedTask', function(){
+ var task = Ext.create('Ext.util.DelayedTask', function() {
cont.remove(cur);
});
task.delay(10);
}
- }
- else {
+ } else {
// helper for cleaning the content when logging out
cont.removeAll();
}
success: function(response) {
PVE.VersionInfo = response.result.data;
me.updateVersionInfo();
- }
+ },
});
Proxmox.Utils.API2Request({
updateUserInfo: function() {
var me = this;
var ui = me.query('#userinfo')[0];
- ui.setText(Proxmox.UserName || '');
+ ui.setText(Ext.String.htmlEncode(Proxmox.UserName || ''));
ui.updateLayout();
},
ui.updateLayout();
},
- initComponent : function() {
+ initComponent: function() {
var me = this;
Ext.History.init();
lxc: 'PVE.lxc.Config',
storage: 'PVE.storage.Browser',
sdn: 'PVE.sdn.Browser',
- pool: 'pvePoolConfig'
+ pool: 'pvePoolConfig',
};
var comp = {
- xtype: tlckup[n.data.type || 'root'] ||
+ xtype: tlckup[n.data.type || 'root'] ||
'pvePanelConfig',
showSearch: (n.data.id === 'root') ||
Ext.isDefined(n.data.groupbyid),
pveSelNode: n,
workspace: me,
- viewFilter: selview.getViewFilter()
+ viewFilter: selview.getViewFilter(),
};
PVE.curSelectedNode = n;
me.setContent(comp);
}
- }
- }
- }
+ },
+ },
+ },
});
- selview.on('select', function(combo, records) {
+ selview.on('select', function(combo, records) {
if (records) {
var view = combo.getViewFilter();
rtree.setViewFilter(view);
handler: function() {
var wiz = Ext.create('PVE.qemu.CreateWizard', {});
wiz.show();
- }
+ },
});
var createCT = Ext.createWidget('button', {
handler: function() {
var wiz = Ext.create('PVE.lxc.CreateWizard', {});
wiz.show();
- }
+ },
});
sprovider.on('statechange', function(sp, key, value) {
items: [
{
region: 'north',
- layout: {
+ layout: {
type: 'hbox',
- align: 'middle'
+ align: 'middle',
},
- baseCls: 'x-plain',
+ baseCls: 'x-plain',
defaults: {
- baseCls: 'x-plain'
+ baseCls: 'x-plain',
},
border: false,
margin: '2 0 2 5',
items: [
{
- html: '<a class="x-unselectable" target=_blank href="https://www.proxmox.com">' +
- '<img style="padding-top:4px;padding-right:5px" src="/pve2/images/proxmox_logo.png"/></a>'
+ xtype: 'proxmoxlogo',
},
{
minWidth: 150,
id: 'versioninfo',
- html: 'Virtual Environment'
+ html: 'Virtual Environment',
},
{
xtype: 'pveGlobalSearchField',
- tree: rtree
+ tree: rtree,
},
{
- flex: 1
+ flex: 1,
},
{
xtype: 'proxmoxHelpButton',
listenToGlobalEvent: false,
onlineHelp: 'pve_documentation_index',
text: gettext('Documentation'),
- margin: '0 5 0 0'
+ margin: '0 5 0 0',
},
- createVM,
+ createVM,
createCT,
{
pack: 'end',
style: {
// proxmox dark grey p light grey as border
backgroundColor: '#464d4d',
- borderColor: '#ABBABA'
+ borderColor: '#ABBABA',
},
iconCls: 'fa fa-user',
menu: [
handler: function() {
var win = Ext.create('PVE.window.Settings');
win.show();
- }
+ },
},
{
text: gettext('Password'),
iconCls: 'fa fa-fw fa-key',
handler: function() {
var win = Ext.create('Proxmox.window.PasswordEdit', {
- userid: Proxmox.UserName
+ userid: Proxmox.UserName,
});
win.show();
- }
+ },
},
{
text: 'TFA',
iconCls: 'fa fa-fw fa-lock',
handler: function(btn, event, rec) {
- var win = Ext.create('PVE.window.TFAEdit',{
- userid: Proxmox.UserName
+ var win = Ext.create('PVE.window.TFAEdit', {
+ userid: Proxmox.UserName,
});
win.show();
- }
+ },
},
{
- text: gettext('API Tokens'),
- iconCls: 'fa fa-fw fa-user-o',
- handler: function(btn, event, rec) {
- var win = Ext.create('PVE.window.TokenView',{
- userid: Proxmox.UserName
- });
- win.show();
- }
+ iconCls: 'fa fa-language',
+ text: gettext('Language'),
+ handler: function() {
+ Ext.create('Proxmox.window.LanguageEditWindow')
+ .show();
+ },
},
'-',
{
comp.getStore().loadData([], false);
}
});
- }
- }
- ]
- }
- ]
+ },
+ },
+ ],
+ },
+ ],
},
{
region: 'center',
layout: { type: 'card' },
border: false,
margin: '0 5 0 0',
- items: []
+ items: [],
},
{
region: 'west',
margin: '0 0 0 5',
split: true,
width: 200,
- items: [ selview, rtree ],
+ items: [selview, rtree],
listeners: {
resize: function(panel, width, height) {
var viewWidth = me.getSize().width;
if (width > viewWidth - 100) {
panel.setWidth(viewWidth - 100);
}
- }
- }
+ },
+ },
},
{
xtype: 'pveStatusPanel',
stateId: 'pvesouth',
itemId: 'south',
region: 'south',
- margin:'0 5 5 5',
+ margin: '0 5 5 5',
title: gettext('Logs'),
collapsible: true,
header: false,
height: 200,
- split:true,
+ split: true,
listeners: {
resize: function(panel, width, height) {
var viewHeight = me.getSize().height;
if (height > (viewHeight - 150)) {
panel.setHeight(viewHeight - 150);
}
- }
- }
- }
- ]
+ },
+ },
+ },
+ ],
});
me.callParent();
me.updateUserInfo();
// on resize, center all modal windows
- Ext.on('resize', function(){
+ Ext.on('resize', function() {
var wins = Ext.ComponentQuery.query('window[modal]');
if (wins.length > 0) {
- wins.forEach(function(win){
+ wins.forEach(function(win) {
win.alignTo(me, 'c-c');
});
}
});
- }
+ },
});