mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 23:25:24 +00:00
commit
056a300b38
11 changed files with 23 additions and 28 deletions
|
@ -2,7 +2,7 @@ language: python
|
||||||
python:
|
python:
|
||||||
- "2.7"
|
- "2.7"
|
||||||
env:
|
env:
|
||||||
- DJANGO=1.8
|
- DJANGO=1.11.14
|
||||||
install:
|
install:
|
||||||
- pip install -r dev/requirements.txt --use-mirrors
|
- pip install -r dev/requirements.txt --use-mirrors
|
||||||
script:
|
script:
|
||||||
|
|
|
@ -6,7 +6,7 @@ RUN echo 'APT::Get::Clean=always;' >> /etc/apt/apt.conf.d/99AutomaticClean
|
||||||
RUN apt-get update -qqy
|
RUN apt-get update -qqy
|
||||||
RUN DEBIAN_FRONTEND=noninteractive apt-get -qyy install \
|
RUN DEBIAN_FRONTEND=noninteractive apt-get -qyy install \
|
||||||
-o APT::Install-Suggests=false \
|
-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
|
ADD . /srv/webvirtcloud
|
||||||
RUN chown -R www-data:www-data /srv/webvirtcloud
|
RUN chown -R www-data:www-data /srv/webvirtcloud
|
||||||
|
|
|
@ -32,7 +32,7 @@ print(''.join([random.SystemRandom().choice(haystack) for _ in range(50)]))
|
||||||
### Install WebVirtCloud panel (Ubuntu)
|
### Install WebVirtCloud panel (Ubuntu)
|
||||||
|
|
||||||
```bash
|
```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
|
git clone https://github.com/retspen/webvirtcloud
|
||||||
cd webvirtcloud
|
cd webvirtcloud
|
||||||
cp webvirtcloud/settings.py.template webvirtcloud/settings.py
|
cp webvirtcloud/settings.py.template webvirtcloud/settings.py
|
||||||
|
@ -67,7 +67,7 @@ wget -O - https://clck.ru/9V9fH | sudo sh
|
||||||
### Install WebVirtCloud panel (CentOS)
|
### Install WebVirtCloud panel (CentOS)
|
||||||
|
|
||||||
```bash
|
```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
|
#### Creating directories and cloning repo
|
||||||
|
@ -230,8 +230,10 @@ datasource:
|
||||||
|
|
||||||
### How To Update
|
### How To Update
|
||||||
```bash
|
```bash
|
||||||
|
sudo virtualenv venv
|
||||||
|
sudo source venv/bin/activate
|
||||||
git pull
|
git pull
|
||||||
pip install Django==1.11.14
|
pip install -U -r conf/requirements.txt
|
||||||
python manage.py migrate
|
python manage.py migrate
|
||||||
sudo service supervisor restart
|
sudo service supervisor restart
|
||||||
```
|
```
|
||||||
|
|
2
Vagrantfile
vendored
2
Vagrantfile
vendored
|
@ -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 sed -i 's/auth_tcp = \"sasl\"/auth_tcp = \"none\"/g' /etc/libvirt/libvirtd.conf
|
||||||
sudo service libvirt-bin restart
|
sudo service libvirt-bin restart
|
||||||
sudo adduser vagrant libvirtd
|
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
|
virtualenv /vagrant/venv
|
||||||
source /vagrant/venv/bin/activate
|
source /vagrant/venv/bin/activate
|
||||||
pip install -r /vagrant/dev/requirements.txt
|
pip install -r /vagrant/dev/requirements.txt
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
from django.contrib import auth
|
|
||||||
from django.contrib.auth import views as auth_views
|
from django.contrib.auth import views as auth_views
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
Django==1.11.14
|
Django==1.11.14
|
||||||
websockify==0.8.0
|
websockify==0.8.0
|
||||||
gunicorn==19.9.0
|
gunicorn==19.9.0
|
||||||
libvirt-python==4.4.0
|
|
||||||
libxml2-python3==2.9.5
|
|
||||||
lxml==4.2.3
|
lxml==4.2.3
|
||||||
|
libvirt-python==4.4.0
|
|
@ -1,4 +1,4 @@
|
||||||
-r ../conf/requirements.txt
|
-r ../conf/requirements.txt
|
||||||
pep8==1.6.2
|
pep8==1.7.1
|
||||||
pyflakes==0.8.1
|
pyflakes==2.0.0
|
||||||
pylint==1.4.3
|
pylint==1.9.2
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="alert alert-warning alert-dismissable">
|
<div class="alert alert-warning alert-dismissable">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -41,16 +41,15 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th>Name<br>Description</th>
|
<th>Name<br>Description</th>
|
||||||
<th>Host<br>User</th>
|
<th>User</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>VCPU</th>
|
<th>VCPU</th>
|
||||||
<th>Memory<br>({% trans "MB" %})</th>
|
<th>Memory</th>
|
||||||
<th data-sortable="false" style="width:205px;">Actions & Usage</th>
|
<th data-sortable="false" style="width:205px;">Actions & Mem Usage</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody class="searchable">
|
<tbody class="searchable">
|
||||||
{% for host, inst in all_host_vms.items %}
|
{% for host, inst in all_host_vms.items %}
|
||||||
<!-- copied /-->
|
|
||||||
<tr class="success" style="font-size:16px">
|
<tr class="success" style="font-size:16px">
|
||||||
<td>{{ forloop.counter }}</td>
|
<td>{{ forloop.counter }}</td>
|
||||||
<td><a href="{% url 'overview' host.0 %}">{{ host.1 }}</a></td>
|
<td><a href="{% url 'overview' host.0 %}">{{ host.1 }}</a></td>
|
||||||
|
@ -64,14 +63,16 @@
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align:center;">{{ host.3 }}</td>
|
<td style="text-align:center;">{{ host.3 }}</td>
|
||||||
<td style="text-align:right;">{{ host.4|filesizeformat }}</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>
|
</tr>
|
||||||
<!-- copied /-->
|
|
||||||
{% for vm, info in inst.items %}
|
{% for vm, info in inst.items %}
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>{{ forloop.counter }}   <a href="{% url 'instance' host.0 vm %}">{{ vm }}</a><br><small><em>{{ info.title }}</em></small></td>
|
<td>{{ forloop.counter }}   <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 %}
|
<td>{% ifequal info.status 1 %}
|
||||||
<span class="text-success">{% trans "Active" %}</span>
|
<span class="text-success">{% trans "Active" %}</span>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
|
@ -157,7 +158,7 @@
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="alert alert-warning alert-dismissable">
|
<div class="alert alert-warning alert-dismissable">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
@ -366,7 +366,6 @@ def instance(request, compute_id, vname):
|
||||||
default_cache = settings.INSTANCE_VOLUME_DEFAULT_CACHE
|
default_cache = settings.INSTANCE_VOLUME_DEFAULT_CACHE
|
||||||
default_format = settings.INSTANCE_VOLUME_DEFAULT_FORMAT
|
default_format = settings.INSTANCE_VOLUME_DEFAULT_FORMAT
|
||||||
formats = conn.get_image_formats()
|
formats = conn.get_image_formats()
|
||||||
default_bus = settings.INSTANCE_VOLUME_DEFAULT_BUS
|
|
||||||
busses = conn.get_busses()
|
busses = conn.get_busses()
|
||||||
default_bus = settings.INSTANCE_VOLUME_DEFAULT_BUS
|
default_bus = settings.INSTANCE_VOLUME_DEFAULT_BUS
|
||||||
show_access_root_password = settings.SHOW_ACCESS_ROOT_PASSWORD
|
show_access_root_password = settings.SHOW_ACCESS_ROOT_PASSWORD
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -170,7 +170,7 @@ class wvmNetwork(wvmConnect):
|
||||||
result = []
|
result = []
|
||||||
for net in doc.xpath('/network/ip/dhcp/host'):
|
for net in doc.xpath('/network/ip/dhcp/host'):
|
||||||
host = net.xpath('@ip')[0]
|
host = net.xpath('@ip')[0]
|
||||||
mac = net.xpathEval('@mac')[0]
|
mac = net.xpath('@mac')[0]
|
||||||
result.append({'host': host, 'mac': mac})
|
result.append({'host': host, 'mac': mac})
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue