1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-23 22:55:23 +00:00

Merge pull request #163 from catborise/master

some minor corrections
This commit is contained in:
Anatoliy Guskov 2018-07-20 12:35:46 +03:00 committed by GitHub
commit 056a300b38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 23 additions and 28 deletions

View file

@ -2,7 +2,7 @@ language: python
python:
- "2.7"
env:
- DJANGO=1.8
- DJANGO=1.11.14
install:
- pip install -r dev/requirements.txt --use-mirrors
script:

View file

@ -6,7 +6,7 @@ RUN echo 'APT::Get::Clean=always;' >> /etc/apt/apt.conf.d/99AutomaticClean
RUN apt-get update -qqy
RUN DEBIAN_FRONTEND=noninteractive apt-get -qyy install \
-o APT::Install-Suggests=false \
git python-virtualenv python-dev libxml2-dev libvirt-dev zlib1g-dev nginx libsasl2-modules
git python-virtualenv python-dev python-lxml libvirt-dev zlib1g-dev nginx libsasl2-modules
ADD . /srv/webvirtcloud
RUN chown -R www-data:www-data /srv/webvirtcloud

View file

@ -32,7 +32,7 @@ print(''.join([random.SystemRandom().choice(haystack) for _ in range(50)]))
### Install WebVirtCloud panel (Ubuntu)
```bash
sudo apt-get -y install git python-virtualenv python-dev python-lxml libvirt-dev zlib1g-dev nginx supervisor libsasl2-modules gcc pkg-config
sudo apt-get -y install git python-virtualenv python-dev python-lxml libvirt-dev zlib1g-dev nginx supervisor libsasl2-modules gcc pkg-config python-guestfs
git clone https://github.com/retspen/webvirtcloud
cd webvirtcloud
cp webvirtcloud/settings.py.template webvirtcloud/settings.py
@ -67,7 +67,7 @@ wget -O - https://clck.ru/9V9fH | sudo sh
### Install WebVirtCloud panel (CentOS)
```bash
sudo yum -y install python-virtualenv python-devel libvirt-devel glibc gcc nginx supervisor libxml2 libxml2-devel git
sudo yum -y install python-virtualenv python-devel libvirt-devel glibc gcc nginx supervisor python-lxml git python-libguestfs
```
#### Creating directories and cloning repo
@ -230,8 +230,10 @@ datasource:
### How To Update
```bash
sudo virtualenv venv
sudo source venv/bin/activate
git pull
pip install Django==1.11.14
pip install -U -r conf/requirements.txt
python manage.py migrate
sudo service supervisor restart
```

2
Vagrantfile vendored
View file

@ -10,7 +10,7 @@ Vagrant.configure(2) do |config|
sudo sed -i 's/auth_tcp = \"sasl\"/auth_tcp = \"none\"/g' /etc/libvirt/libvirtd.conf
sudo service libvirt-bin restart
sudo adduser vagrant libvirtd
sudo apt-get -y install python-virtualenv python-dev libxml2-dev libvirt-dev zlib1g-dev
sudo apt-get -y install python-virtualenv python-dev python-lxml libvirt-dev zlib1g-dev
virtualenv /vagrant/venv
source /vagrant/venv/bin/activate
pip install -r /vagrant/dev/requirements.txt

View file

@ -1,5 +1,4 @@
from django.conf.urls import url
from django.contrib import auth
from django.contrib.auth import views as auth_views
from . import views

View file

@ -1,6 +1,5 @@
Django==1.11.14
websockify==0.8.0
gunicorn==19.9.0
libvirt-python==4.4.0
libxml2-python3==2.9.5
lxml==4.2.3
libvirt-python==4.4.0

View file

@ -1,4 +1,4 @@
-r ../conf/requirements.txt
pep8==1.6.2
pyflakes==0.8.1
pylint==1.4.3
pep8==1.7.1
pyflakes==2.0.0
pylint==1.9.2

View file

@ -32,7 +32,7 @@
<div class="col-lg-12">
<div class="alert alert-warning alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "You don't have any Instace" %}
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "You don't have any Instance" %}
</div>
</div>
{% else %}
@ -41,16 +41,15 @@
<tr>
<th>#</th>
<th>Name<br>Description</th>
<th>Host<br>User</th>
<th>User</th>
<th>Status</th>
<th>VCPU</th>
<th>Memory<br>({% trans "MB" %})</th>
<th data-sortable="false" style="width:205px;">Actions & Usage</th>
<th>Memory</th>
<th data-sortable="false" style="width:205px;">Actions & Mem Usage</th>
</tr>
</thead>
<tbody class="searchable">
{% for host, inst in all_host_vms.items %}
<!-- copied /-->
<tr class="success" style="font-size:16px">
<td>{{ forloop.counter }}</td>
<td><a href="{% url 'overview' host.0 %}">{{ host.1 }}</a></td>
@ -64,14 +63,16 @@
</td>
<td style="text-align:center;">{{ host.3 }}</td>
<td style="text-align:right;">{{ host.4|filesizeformat }}</td>
<td style="text-align:left;">Mem Usage: {{ host.5 }}%</td>
<td style="text-align:left;">
<div class="progress-bar-success" role="progressbar" style="width: {{ host.5 }}%" aria-valuenow="{{ host.5 }}" aria-valuemin="0" aria-valuemax="100">{{ host.5 }}%</div>
</td>
</tr>
<!-- copied /-->
{% for vm, info in inst.items %}
<tr>
<td></td>
<td>{{ forloop.counter }} &emsp; <a href="{% url 'instance' host.0 vm %}">{{ vm }}</a><br><small><em>{{ info.title }}</em></small></td>
<td><a href="{% url 'overview' host.0 %}">{{ host.1 }}</a><br><small><em>{% if info.userinstances.count > 0 %}{{ info.userinstances.first_user.user.username }}{% if info.userinstances.count > 1 %} (+{{ info.userinstances.count|add:"-1" }}){% endif %}{% endif %}</em></small></td>
<td><small><em>{% if info.userinstances.count > 0 %}{{ info.userinstances.first_user.user.username }}{% if info.userinstances.count > 1 %} (+{{ info.userinstances.count|add:"-1" }}){% endif %}{% endif %}</em></small></td>
<td>{% ifequal info.status 1 %}
<span class="text-success">{% trans "Active" %}</span>
{% endifequal %}
@ -157,7 +158,7 @@
<div class="col-lg-12">
<div class="alert alert-warning alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "You don't have any Instace" %}
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "You don't have any Instance" %}
</div>
</div>
{% else %}

View file

@ -366,7 +366,6 @@ def instance(request, compute_id, vname):
default_cache = settings.INSTANCE_VOLUME_DEFAULT_CACHE
default_format = settings.INSTANCE_VOLUME_DEFAULT_FORMAT
formats = conn.get_image_formats()
default_bus = settings.INSTANCE_VOLUME_DEFAULT_BUS
busses = conn.get_busses()
default_bus = settings.INSTANCE_VOLUME_DEFAULT_BUS
show_access_root_password = settings.SHOW_ACCESS_ROOT_PASSWORD

File diff suppressed because one or more lines are too long

View file

@ -170,7 +170,7 @@ class wvmNetwork(wvmConnect):
result = []
for net in doc.xpath('/network/ip/dhcp/host'):
host = net.xpath('@ip')[0]
mac = net.xpathEval('@mac')[0]
mac = net.xpath('@mac')[0]
result.append({'host': host, 'mac': mac})
return result