vmid: vmid
});
+ var statusTxt = Ext.create('Ext.toolbar.TextItem', {
+ data: {
+ lock: undefined
+ },
+ tpl: [
+ '<tpl if="lock">',
+ '<i class="fa fa-lg fa-lock"></i> ({lock})',
+ '</tpl>'
+ ]
+ });
+
+
Ext.apply(me, {
title: Ext.String.format(gettext("Container {0} on node '{1}'"), vm.text, nodename),
hstateid: 'lxctab',
- tbar: [ startBtn, shutdownBtn, migrateBtn, consoleBtn, moreBtn ],
+ tbarSpacing: false,
+ tbar: [ statusTxt, '->', startBtn, shutdownBtn, migrateBtn, consoleBtn, moreBtn ],
defaults: { statusStore: me.statusStore },
items: [
{
me.mon(me.statusStore, 'load', function(s, records, success) {
var status;
+ var lock;
if (!success) {
status = 'unknown';
} else {
status = rec ? rec.data.value : 'unknown';
rec = s.data.get('template');
template = rec.data.value || false;
+ rec = s.data.get('lock');
+ lock = rec ? rec.data.value : undefined;
}
+
+ statusTxt.update({ lock: lock });
+
startBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 'running' || template);
shutdownBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running');
stopBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 'stopped');
showSearch: true, // add a ressource grid with a search button as first tab
viewFilter: undefined, // a filter to pass to that ressource grid
+ tbarSpacing: true, // if true, adds a spacer after the title in tbar
+
dockedItems: [{
// this is needed for the overflow handler
xtype: 'toolbar',
}
}
- tbar.unshift('->');
+ if (me.tbarSpacing) {
+ tbar.unshift('->');
+ }
tbar.unshift({
xtype: 'tbtext',
text: title,
vmid: vmid
});
+ var statusTxt = Ext.create('Ext.toolbar.TextItem', {
+ data: {
+ lock: undefined
+ },
+ tpl: [
+ '<tpl if="lock">',
+ '<i class="fa fa-lg fa-lock"></i> ({lock})',
+ '</tpl>'
+ ]
+ });
+
Ext.apply(me, {
title: Ext.String.format(gettext("Virtual Machine {0} on node '{1}'"), vm.text, nodename),
hstateid: 'kvmtab',
- tbar: [ resumeBtn, startBtn, shutdownBtn, migrateBtn, consoleBtn, moreBtn ],
+ tbarSpacing: false,
+ tbar: [ statusTxt, '->', resumeBtn, startBtn, shutdownBtn, migrateBtn, consoleBtn, moreBtn ],
defaults: { statusStore: me.statusStore },
items: [
{
var qmpstatus;
var spice = false;
var xtermjs = false;
+ var lock;
if (!success) {
status = qmpstatus = 'unknown';
qmpstatus = rec ? rec.data.value : 'unknown';
rec = s.data.get('template');
template = rec.data.value || false;
+ rec = s.data.get('lock');
+ lock = rec ? rec.data.value : undefined;
spice = s.data.get('spice') ? true : false;
xtermjs = s.data.get('serial') ? true : false;
consoleBtn.setEnableSpice(spice);
consoleBtn.setEnableXtermJS(xtermjs);
+ statusTxt.update({ lock: lock });
+
startBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 'running' || template);
shutdownBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running');
me.down('#removeBtn').setDisabled(!caps.vms['VM.Allocate'] || status !== 'stopped');