From 4783fd448f2c557591187c224c1f2a2dcf674e2a Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 25 May 2018 10:36:33 +0200 Subject: [PATCH] check for VM.Montior privileges on qemu AgentIPView so that the user does not get the useless 'no information' or 'not running' message, but the real cause Signed-off-by: Dominik Csapak --- www/manager6/qemu/AgentIPView.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/www/manager6/qemu/AgentIPView.js b/www/manager6/qemu/AgentIPView.js index ecc091f1..179b2922 100644 --- a/www/manager6/qemu/AgentIPView.js +++ b/www/manager6/qemu/AgentIPView.js @@ -128,15 +128,23 @@ Ext.define('PVE.qemu.AgentIPView', { me.running = (store.getById('status').data.value === 'running'); /*jslint confusion: false*/ + var caps = Ext.state.Manager.get('GuiCap'); + + if (!caps.vms['VM.Monitor']) { + var errorText = gettext("Requires '{0}' Privileges"); + me.updateStatus(false, Ext.String.format(errorText, 'VM.Monitor')); + return; + } + if (me.agent && me.running && me.ipStore.isStopped) { me.ipStore.startUpdate(); } me.updateStatus(); }, - updateStatus: function(unsuccessful) { + updateStatus: function(unsuccessful, defaulttext) { var me = this; - var text = gettext('No network information'); + var text = defaulttext || gettext('No network information'); var more = false; if (unsuccessful) { text = gettext('Guest Agent not running'); -- 2.39.5