mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-25 07:35:22 +00:00
commit
a66ebba12b
11 changed files with 35 additions and 27 deletions
10
.travis.yml
10
.travis.yml
|
@ -2,14 +2,14 @@ language: python
|
||||||
python:
|
python:
|
||||||
- "2.7"
|
- "2.7"
|
||||||
env:
|
env:
|
||||||
- DJANGO=1.11.21
|
- DJANGO=1.11.23
|
||||||
install:
|
install:
|
||||||
- pip install -r dev/requirements.txt
|
- pip install -r dev/requirements.txt
|
||||||
script:
|
script:
|
||||||
- pep8 --exclude=IPy.py --ignore=E501 vrtManager accounts computes \
|
- pep8 --exclude=IPy.py --ignore=E501 vrtManager accounts computes \
|
||||||
console create instances interfaces \
|
console create datasource instances interfaces \
|
||||||
networks secrets storages
|
logs networks nwfilters secrets storages
|
||||||
- pyflakes vrtManager accounts computes console create instances interfaces \
|
- pyflakes vrtManager accounts computes console create datasource instances interfaces \
|
||||||
networks secrets storages
|
nwfilters networks secrets storages logs
|
||||||
- python manage.py migrate
|
- python manage.py migrate
|
||||||
- python manage.py test --settings=webvirtcloud.settings-dev
|
- python manage.py test --settings=webvirtcloud.settings-dev
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Django==1.11.23
|
Django==1.11.25
|
||||||
websockify==0.8.0
|
websockify==0.9.0
|
||||||
gunicorn==19.9.0
|
gunicorn==19.9.0
|
||||||
lxml==4.2.5
|
lxml==4.2.5
|
||||||
libvirt-python==5.3.0
|
libvirt-python==5.3.0
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
<button id="select_storage" class="btn btn-default dropdown-toggle form-control" type="button" data-toggle="dropdown">{% trans 'Select Pool...' %}
|
<button id="select_storage" class="btn btn-default dropdown-toggle form-control" type="button" data-toggle="dropdown">{% trans 'Select Pool...' %}
|
||||||
<span class="caret"></span></button>
|
<span class="caret"></span></button>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
{% for storage in storages %}
|
{% for storage in storages_host %}
|
||||||
<li><a href="#" onclick="get_volumes({{ compute_id }}, '{{ storage }}')">{{ storage }}</a></li>
|
<li><a href="#" onclick="get_volumes({{ compute_id }}, '{{ storage }}')">{{ storage }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -120,7 +120,7 @@
|
||||||
<label class="col-sm-3 control-label">{% trans "Bus" %}</label>
|
<label class="col-sm-3 control-label">{% trans "Bus" %}</label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<select name="bus" class="form-control image-format">
|
<select name="bus" class="form-control image-format">
|
||||||
{% for bus in busses %}
|
{% for bus in bus_host %}
|
||||||
<option value="{{ bus }}" {% if bus == default_bus %}selected{% endif %}>{% trans bus %}</option>
|
<option value="{{ bus }}" {% if bus == default_bus %}selected{% endif %}>{% trans bus %}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -576,10 +576,14 @@ def instance(request, compute_id, vname):
|
||||||
path = request.POST.get('path', '')
|
path = request.POST.get('path', '')
|
||||||
name = request.POST.get('name', '')
|
name = request.POST.get('name', '')
|
||||||
|
|
||||||
conn.detach_disk(dev)
|
|
||||||
conn_delete.del_volume(name)
|
|
||||||
|
|
||||||
msg = _('Delete disk: ' + dev)
|
msg = _('Delete disk: ' + dev)
|
||||||
|
conn.detach_disk(dev)
|
||||||
|
try:
|
||||||
|
conn_delete.del_volume(name)
|
||||||
|
except libvirtError as err:
|
||||||
|
msg = _('The disk: ' + dev + ' is detached but not deleted. ' + err.message)
|
||||||
|
messages.warning(request, msg)
|
||||||
|
|
||||||
addlogmsg(request.user.username, instance.name, msg)
|
addlogmsg(request.user.username, instance.name, msg)
|
||||||
return HttpResponseRedirect(request.get_full_path() + '#disks')
|
return HttpResponseRedirect(request.get_full_path() + '#disks')
|
||||||
|
|
||||||
|
|
|
@ -44,11 +44,12 @@
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-6 col-sm-6">
|
<div class="col-xs-6 col-sm-6">
|
||||||
<p>{% trans "Pool name" %}:</p>
|
<p>{% trans "Pool Name" %}:</p>
|
||||||
<p>{% trans "Pool type" %}:</p>
|
<p>{% trans "Pool Type" %}:</p>
|
||||||
<p>{% trans "Pool path" %}:</p>
|
<p>{% trans "Pool Path" %}:</p>
|
||||||
<p>{% trans "Pool status" %}:</p>
|
<p>{% trans "Pool Status" %}:</p>
|
||||||
<p>{% trans "Size" %}: ({{ size|filesizeformat }} / {{ used|filesizeformat }})</p>
|
<p>{% trans "Size" %}:</p>
|
||||||
|
<p>{% trans "Usage" %}({{ percent }}%):</p>
|
||||||
<p>{% trans "State" %}:</p>
|
<p>{% trans "State" %}:</p>
|
||||||
<p>{% trans "Autostart" %}:</p>
|
<p>{% trans "Autostart" %}:</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -57,7 +58,8 @@
|
||||||
<p>{% if not type %}{% trans "None" %}{% else %}{{ type }}{% endif %}</p>
|
<p>{% if not type %}{% trans "None" %}{% else %}{{ type }}{% endif %}</p>
|
||||||
<p>{% if not path %}{% trans "None" %}{% else %}{{ path }}{% endif %}</p>
|
<p>{% if not path %}{% trans "None" %}{% else %}{{ path }}{% endif %}</p>
|
||||||
<p>{% if not status %}{% trans "None" %}{% else %}{{ status }}{% endif %}</p>
|
<p>{% if not status %}{% trans "None" %}{% else %}{{ status }}{% endif %}</p>
|
||||||
<p>{% trans "Usage" %}: {{ percent }}%</p>
|
<p>{{ size|filesizeformat }}</p>
|
||||||
|
<p>{{ used|filesizeformat }}</p>
|
||||||
<p>
|
<p>
|
||||||
<form action="" method="post" role="form">{% csrf_token %}
|
<form action="" method="post" role="form">{% csrf_token %}
|
||||||
{% ifequal state 0 %}
|
{% ifequal state 0 %}
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12" style="text-align: center;">
|
<div class="col-xs-12" style="text-align: center;">
|
||||||
<h1>Oops!</h1>
|
<h1>{% trans 'Oops!'%}</h1>
|
||||||
|
|
||||||
<p class="lead">{% trans "404 Not Found" %}</p>
|
<p class="lead">{% trans "404 Not Found" %}</p>
|
||||||
|
|
||||||
<p>{% trans "The requested page was not found on this server." %}</p>
|
<p>{% trans "The requested page was not found on this server." %}</p>
|
||||||
<a class="btn btn-medium btn-success" href="javascript:history.back()">← Back</a>
|
<a class="btn btn-medium btn-success" href="javascript:history.back()">← {% trans 'Back'%}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12" style="text-align: center;">
|
<div class="col-xs-12" style="text-align: center;">
|
||||||
<h1>Oops!</h1>
|
<h1>{% trans 'Oops!' %}</h1>
|
||||||
|
|
||||||
<p class="lead">{% trans "500 Internal Server Error" %}</p>
|
<p class="lead">{% trans "500 Internal Server Error" %}</p>
|
||||||
|
|
||||||
<p>{% trans "The server encountered an internal error or misconfiguration and was unable to complete you request." %}</p>
|
<p>{% trans "The server encountered an internal error or misconfiguration and was unable to complete you request." %}</p>
|
||||||
<a class="btn btn-medium btn-success" href="javascript:history.back()">← Back</a>
|
<a class="btn btn-medium btn-success" href="javascript:history.back()">← {% trans 'Back'%}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="description" content="WebVirtMgr panel for manage virtual machine">
|
<meta name="description" content="WebVirtCloud panel for manage virtual machine">
|
||||||
<meta name="author" content="anatoliy.guskov@gmail.com">
|
<meta name="author" content="anatoliy.guskov@gmail.com">
|
||||||
|
|
||||||
<title>{% block title %}{% endblock %}</title>
|
<title>{% block title %}{% endblock %}</title>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
{% load i18n %}
|
||||||
{% if error_messages %}
|
{% if error_messages %}
|
||||||
{% for error in error_messages %}
|
{% for error in error_messages %}
|
||||||
<!-- Error Messages -->
|
<!-- Error Messages -->
|
||||||
|
@ -5,7 +6,7 @@
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="alert alert-danger alert-dismissible" role="danger">
|
<div class="alert alert-danger alert-dismissible" role="danger">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<strong>Error:</strong> {{ error }}
|
<strong>{% trans 'Error' %}:</strong> {{ error }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
{% load i18n %}
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
{% for message in messages %}
|
{% for message in messages %}
|
||||||
<!-- Success Messages -->
|
<!-- Success Messages -->
|
||||||
|
@ -5,7 +6,7 @@
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="alert alert-success alert-dismissible" role="susses">
|
<div class="alert alert-success alert-dismissible" role="susses">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<strong>Success:</strong> {{ message }}
|
<strong>{% trans 'Success' %}:</strong> {{ message }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -528,8 +528,8 @@ class wvmInstance(wvmConnect):
|
||||||
mem_usage = {}
|
mem_usage = {}
|
||||||
if self.get_status() == 1:
|
if self.get_status() == 1:
|
||||||
mem_stats = self.instance.memoryStats()
|
mem_stats = self.instance.memoryStats()
|
||||||
rss = mem_stats['rss'] if mem_stats['rss'] else 0
|
rss = mem_stats['rss'] if 'rss' in mem_stats else 0
|
||||||
total = mem_stats['actual'] if mem_stats['actual'] else 0
|
total = mem_stats['actual'] if 'actual' in mem_stats else 0
|
||||||
available = total - rss
|
available = total - rss
|
||||||
if available < 0: available = 0
|
if available < 0: available = 0
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue