alias: 'widget.PVE.qemu.Config',
onlineHelp: 'chapter_virtual_machines',
+ userCls: 'proxmox-tags-full',
initComponent: function() {
var me = this;
var migrateBtn = Ext.create('Ext.Button', {
text: gettext('Migrate'),
disabled: !caps.vms['VM.Migrate'],
- hidden: PVE.data.ResourceStore.getNodes().length < 2,
+ hidden: PVE.Utils.isStandaloneNode(),
handler: function() {
var win = Ext.create('PVE.window.Migrate', {
vmtype: 'qemu',
itemId: 'removeBtn',
disabled: !caps.vms['VM.Allocate'],
handler: function() {
- Ext.create('PVE.window.SafeDestroy', {
+ Ext.create('PVE.window.SafeDestroyGuest', {
url: base_url,
item: { type: 'VM', id: vmid },
+ taskName: 'qmdestroy',
}).show();
},
iconCls: 'fa fa-trash-o',
}, {
text: gettext('Stop'),
disabled: !caps.vms['VM.PowerMgmt'],
- dangerous: true,
tooltip: Ext.String.format(gettext('Stop {0} immediately'), 'VM'),
- confirmMsg: Proxmox.Utils.format_task_description('qmstop', vmid),
handler: function() {
- vm_command("stop", { timeout: 30 });
+ Ext.create('PVE.GuestStop', {
+ nodename: nodename,
+ vm: vm,
+ autoShow: true,
+ });
},
iconCls: 'fa fa-stop',
}, {
disabled: !caps.vms['VM.Console'],
hidden: template,
consoleType: 'kvm',
+ // disable spice/xterm for default action until status api call succeeded
enableSpice: false,
enableXtermjs: false,
consoleName: vm.name,
],
});
+ let tagsContainer = Ext.create('PVE.panel.TagEditContainer', {
+ tags: vm.tags,
+ canEdit: !!caps.vms['VM.Config.Options'],
+ listeners: {
+ change: function(tags) {
+ Proxmox.Utils.API2Request({
+ url: base_url + '/config',
+ method: 'PUT',
+ params: {
+ tags,
+ },
+ success: function() {
+ me.statusStore.load();
+ },
+ failure: function(response) {
+ Ext.Msg.alert('Error', response.htmlStatus);
+ me.statusStore.load();
+ },
+ });
+ },
+ },
+ });
+
+ let vm_text = `${vm.vmid} (${vm.name})`;
+
Ext.apply(me, {
- title: Ext.String.format(gettext("Virtual Machine {0} on node '{1}'"), vm.text, nodename),
+ title: Ext.String.format(gettext("Virtual Machine {0} on node '{1}'"), vm_text, nodename),
hstateid: 'kvmtab',
tbarSpacing: false,
- tbar: [statusTxt, '->', resumeBtn, startBtn, shutdownBtn, migrateBtn, consoleBtn, moreBtn],
+ tbar: [statusTxt, tagsContainer, '->', resumeBtn, startBtn, shutdownBtn, migrateBtn, consoleBtn, moreBtn],
defaults: { statusStore: me.statusStore },
items: [
{
title: gettext('Task History'),
itemId: 'tasks',
xtype: 'proxmoxNodeTasks',
- iconCls: 'fa fa-list',
+ iconCls: 'fa fa-list-alt',
nodename: nodename,
- vmidFilter: vmid,
+ preFilter: {
+ vmid,
+ },
},
);
});
}
- if (caps.vms['VM.Console']) {
+ if (caps.vms['VM.Audit']) {
me.items.push(
{
xtype: 'pveFirewallRules',
list_refs_url: base_url + '/firewall/refs',
itemId: 'firewall-ipset',
},
- {
+ );
+ }
+
+ if (caps.vms['VM.Console']) {
+ me.items.push(
+ {
title: gettext('Log'),
groups: ['firewall'],
iconCls: 'fa fa-list',
itemId: 'firewall-fwlog',
xtype: 'proxmoxLogView',
url: '/api2/extjs' + base_url + '/firewall/log',
+ log_select_timespan: true,
+ submitFormat: 'U',
},
);
}
var spice = false;
var xtermjs = false;
var lock;
+ var rec;
if (!success) {
status = qmpstatus = 'unknown';
} else {
- var rec = s.data.get('status');
+ rec = s.data.get('status');
status = rec ? rec.data.value : 'unknown';
rec = s.data.get('qmpstatus');
qmpstatus = rec ? rec.data.value : 'unknown';
xtermjs = !!s.data.get('serial');
}
+ rec = s.data.get('tags');
+ tagsContainer.loadTags(rec?.data?.value);
+
if (template) {
return;
}