mirror of
https://github.com/retspen/webvirtcloud
synced 2025-01-12 08:25:18 +00:00
for instances add guest agent indicator: installed, connected.
This commit is contained in:
parent
e87d7463fe
commit
38054d9882
2 changed files with 28 additions and 8 deletions
|
@ -13,15 +13,15 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
{% ifequal status 5 %}
|
{% if status == 5 %}
|
||||||
<span class="label label-danger">{% trans "Off" %}</span>
|
<span class="label label-danger">{% trans "Off" %}</span>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal status 1 %}
|
{% if status == 1 %}
|
||||||
<span class="label label-success">{% trans "Active" %}</span>
|
<span class="label label-success">{% trans "Active" %}</span>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal status 3 %}
|
{% if status == 3 %}
|
||||||
<span class="label label-warning">{% trans "Suspend" %}</span>
|
<span class="label label-warning">{% trans "Suspend" %}</span>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
|
|
|
|
||||||
{% if cur_vcpu %}
|
{% if cur_vcpu %}
|
||||||
{{ cur_vcpu }} {% trans "Vcpu" %}
|
{{ cur_vcpu }} {% trans "Vcpu" %}
|
||||||
|
@ -34,6 +34,22 @@
|
||||||
{% for disk in disks %}
|
{% for disk in disks %}
|
||||||
{{ disk.size|filesizeformat }} {% trans "Disk" %} |
|
{{ disk.size|filesizeformat }} {% trans "Disk" %} |
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
<button
|
||||||
|
{% if guest_agent == True %}
|
||||||
|
{% if guest_agent_ready == True %}
|
||||||
|
class="btn btn-xs btn-success"
|
||||||
|
title="Guest Agent Enabled & Connected"
|
||||||
|
{% else %}
|
||||||
|
class="btn btn-xs btn-default"
|
||||||
|
title="Guest Agent Enabled but not Connected"
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
class="btn btn-xs btn-danger"
|
||||||
|
title="Guest Agent Not Enabled & Not Connected"
|
||||||
|
{% endif %} disabled>
|
||||||
|
<span class="glyphicon glyphicon-flash"></span>
|
||||||
|
</button>
|
||||||
|
|
|
||||||
<a href="{% url 'instance' compute.id vname %}" type="button" class="btn btn-xs btn-default"><span class="glyphicon glyphicon-refresh"></span></a>
|
<a href="{% url 'instance' compute.id vname %}" type="button" class="btn btn-xs btn-default"><span class="glyphicon glyphicon-refresh"></span></a>
|
||||||
<em>on</em>
|
<em>on</em>
|
||||||
<a href="{% url 'overview' compute.id %}"><span class="label label-primary">{{ compute.name }}{% if compute.name != compute.hostname %} - {{ compute.hostname }}{% endif %} </span></a>
|
<a href="{% url 'overview' compute.id %}"><span class="label label-primary">{{ compute.name }}{% if compute.name != compute.hostname %} - {{ compute.hostname }}{% endif %} </span></a>
|
||||||
|
@ -1437,11 +1453,15 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="well">
|
<div class="well">
|
||||||
<p>{% trans "To Enable/Disable Qemu Guest Agent. Status:" %}
|
<p>{% trans "To Enable/Disable Qemu Guest Agent. Status:" %}
|
||||||
|
{% if status == 1 %}
|
||||||
{% if guest_agent_ready %}
|
{% if guest_agent_ready %}
|
||||||
<label class="label label-success">{% trans 'Connected' %}</label>
|
<label class="label label-success">{% trans 'Connected' %}</label>
|
||||||
{% else %}
|
{% else %}
|
||||||
<label class="label label-danger">{% trans 'Disconnected' %}</label>
|
<label class="label label-danger">{% trans 'Disconnected' %}</label>
|
||||||
{% endif %}</p>
|
{% endif %}</p>
|
||||||
|
{% else %}
|
||||||
|
<label class="label label-default">{% trans 'Unknown' %}</label>
|
||||||
|
{% endif %}
|
||||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="guest_agent" class="col-sm-3 control-label">{% trans "Qemu Guest Agent" %}</label>
|
<label for="guest_agent" class="col-sm-3 control-label">{% trans "Qemu Guest Agent" %}</label>
|
||||||
|
|
|
@ -1417,10 +1417,10 @@ class wvmInstance(wvmConnect):
|
||||||
Return agent channel object if it is defined.
|
Return agent channel object if it is defined.
|
||||||
"""
|
"""
|
||||||
for channel in doc.xpath('/domain/devices/channel'):
|
for channel in doc.xpath('/domain/devices/channel'):
|
||||||
type = channel.get("type")
|
ch_type = channel.get("type")
|
||||||
target = channel.find("target")
|
target = channel.find("target")
|
||||||
target_name = target.get("name")
|
target_name = target.get("name")
|
||||||
if type == "unix" and target_name == "org.qemu.guest_agent.0":
|
if ch_type == "unix" and target_name == "org.qemu.guest_agent.0":
|
||||||
return channel
|
return channel
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue