mirror of
https://github.com/retspen/webvirtcloud
synced 2026-04-05 21:15:25 +00:00
Merge 3fa3472477 into 5c2232f4e8
This commit is contained in:
commit
4603ea4117
5 changed files with 28 additions and 15 deletions
|
|
@ -89,7 +89,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
/nav>
|
</nav>
|
||||||
<div id='main_container' class="container">
|
<div id='main_container' class="container">
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,9 @@
|
||||||
|
|
||||||
host = document.getElementById("host").value;
|
host = document.getElementById("host").value;
|
||||||
port = document.getElementById("port").value;
|
port = document.getElementById("port").value;
|
||||||
|
if (window.location.protocol == 'https:') {
|
||||||
|
scheme = "wss://";
|
||||||
|
}
|
||||||
password = document.getElementById("password").value;
|
password = document.getElementById("password").value;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,7 @@
|
||||||
function connect()
|
function connect()
|
||||||
{
|
{
|
||||||
var host, port, password, scheme = "ws://", uri;
|
var host, port, password, scheme = "ws://", uri;
|
||||||
|
console.log('>> connect');
|
||||||
|
|
||||||
// By default, use the host and port of server that served this file
|
// By default, use the host and port of server that served this file
|
||||||
//host = spice_query_var('host', window.location.hostname);
|
//host = spice_query_var('host', window.location.hostname);
|
||||||
|
|
@ -170,6 +171,7 @@
|
||||||
disconnect();
|
disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('<< connect');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -138,10 +138,14 @@ def instances(request):
|
||||||
instance.compute.password,
|
instance.compute.password,
|
||||||
instance.compute.type)
|
instance.compute.type)
|
||||||
if 'poweron' in request.POST:
|
if 'poweron' in request.POST:
|
||||||
msg = _("Power On")
|
if instance.is_template:
|
||||||
addlogmsg(request.user.username, instance.name, msg)
|
msg = _("Templates cannot be started.")
|
||||||
conn.start(name)
|
error_messages.append(msg)
|
||||||
return HttpResponseRedirect(request.get_full_path())
|
else:
|
||||||
|
msg = _("Power On")
|
||||||
|
addlogmsg(request.user.username, instance.name, msg)
|
||||||
|
conn.start(name)
|
||||||
|
return HttpResponseRedirect(request.get_full_path())
|
||||||
|
|
||||||
if 'poweroff' in request.POST:
|
if 'poweroff' in request.POST:
|
||||||
msg = _("Power Off")
|
msg = _("Power Off")
|
||||||
|
|
@ -412,10 +416,14 @@ def instance(request, compute_id, vname):
|
||||||
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
if 'poweron' in request.POST:
|
if 'poweron' in request.POST:
|
||||||
conn.start()
|
if instance.is_template:
|
||||||
msg = _("Power On")
|
msg = _("Templates cannot be started.")
|
||||||
addlogmsg(request.user.username, instance.name, msg)
|
error_messages.append(msg)
|
||||||
return HttpResponseRedirect(request.get_full_path() + '#poweron')
|
else:
|
||||||
|
conn.start()
|
||||||
|
msg = _("Power On")
|
||||||
|
addlogmsg(request.user.username, instance.name, msg)
|
||||||
|
return HttpResponseRedirect(request.get_full_path() + '#poweron')
|
||||||
|
|
||||||
if 'powercycle' in request.POST:
|
if 'powercycle' in request.POST:
|
||||||
conn.force_shutdown()
|
conn.force_shutdown()
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ class wvmInterface(wvmConnect):
|
||||||
def get_ipv4_type(self):
|
def get_ipv4_type(self):
|
||||||
try:
|
try:
|
||||||
xml = self._XMLDesc(VIR_INTERFACE_XML_INACTIVE)
|
xml = self._XMLDesc(VIR_INTERFACE_XML_INACTIVE)
|
||||||
ipaddr = util.get_xml_path(xml, "/interface/protocol/ip/@address")
|
ipaddr = util.get_xml_path(xml, "/interface/protocol[@family='ipv4']/ip/@address")
|
||||||
if ipaddr:
|
if ipaddr:
|
||||||
return 'static'
|
return 'static'
|
||||||
else:
|
else:
|
||||||
|
|
@ -91,8 +91,8 @@ class wvmInterface(wvmConnect):
|
||||||
|
|
||||||
def get_ipv4(self):
|
def get_ipv4(self):
|
||||||
xml = self._XMLDesc()
|
xml = self._XMLDesc()
|
||||||
int_ipv4_ip = util.get_xml_path(xml, "/interface/protocol/ip/@address")
|
int_ipv4_ip = util.get_xml_path(xml, "/interface/protocol[@family='ipv4']/ip/@address")
|
||||||
int_ipv4_mask = util.get_xml_path(xml, "/interface/protocol/ip/@prefix")
|
int_ipv4_mask = util.get_xml_path(xml, "/interface/protocol[@family='ipv4']/ip/@prefix")
|
||||||
if not int_ipv4_ip or not int_ipv4_mask:
|
if not int_ipv4_ip or not int_ipv4_mask:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
|
|
@ -101,7 +101,7 @@ class wvmInterface(wvmConnect):
|
||||||
def get_ipv6_type(self):
|
def get_ipv6_type(self):
|
||||||
try:
|
try:
|
||||||
xml = self._XMLDesc(VIR_INTERFACE_XML_INACTIVE)
|
xml = self._XMLDesc(VIR_INTERFACE_XML_INACTIVE)
|
||||||
ipaddr = util.get_xml_path(xml, "/interface/protocol[2]/ip/@address")
|
ipaddr = util.get_xml_path(xml, "/interface/protocol[@family='ipv6']/ip/@address")
|
||||||
if ipaddr:
|
if ipaddr:
|
||||||
return 'static'
|
return 'static'
|
||||||
else:
|
else:
|
||||||
|
|
@ -111,8 +111,8 @@ class wvmInterface(wvmConnect):
|
||||||
|
|
||||||
def get_ipv6(self):
|
def get_ipv6(self):
|
||||||
xml = self._XMLDesc()
|
xml = self._XMLDesc()
|
||||||
int_ipv6_ip = util.get_xml_path(xml, "/interface/protocol[2]/ip/@address")
|
int_ipv6_ip = util.get_xml_path(xml, "/interface/protocol[@family='ipv6']/ip/@address")
|
||||||
int_ipv6_mask = util.get_xml_path(xml, "/interface/protocol[2]/ip/@prefix")
|
int_ipv6_mask = util.get_xml_path(xml, "/interface/protocol[@family='ipv6']/ip/@prefix")
|
||||||
if not int_ipv6_ip or not int_ipv6_mask:
|
if not int_ipv6_ip or not int_ipv6_mask:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue