mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-25 15:45:23 +00:00
Added full function with compute
This commit is contained in:
parent
7ab1a8ad84
commit
573a09fd4d
15 changed files with 1052 additions and 74 deletions
164
computes/forms.py
Normal file
164
computes/forms.py
Normal file
|
@ -0,0 +1,164 @@
|
||||||
|
import re
|
||||||
|
from django import forms
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
from computes.models import Compute
|
||||||
|
|
||||||
|
|
||||||
|
class ComputeAddTcpForm(forms.Form):
|
||||||
|
name = forms.CharField(error_messages={'required': _('No hostname has been entered')},
|
||||||
|
max_length=20)
|
||||||
|
hostname = forms.CharField(error_messages={'required': _('No IP / Domain name has been entered')},
|
||||||
|
max_length=100)
|
||||||
|
login = forms.CharField(error_messages={'required': _('No login has been entered')},
|
||||||
|
max_length=100)
|
||||||
|
password = forms.CharField(error_messages={'required': _('No password has been entered')},
|
||||||
|
max_length=100)
|
||||||
|
|
||||||
|
def clean_name(self):
|
||||||
|
name = self.cleaned_data['name']
|
||||||
|
have_symbol = re.match('[^a-zA-Z0-9._-]+', name)
|
||||||
|
if have_symbol:
|
||||||
|
raise forms.ValidationError(_('The host name must not contain any special characters'))
|
||||||
|
elif len(name) > 20:
|
||||||
|
raise forms.ValidationError(_('The host name must not exceed 20 characters'))
|
||||||
|
try:
|
||||||
|
Compute.objects.get(name=name)
|
||||||
|
except Compute.DoesNotExist:
|
||||||
|
return name
|
||||||
|
raise forms.ValidationError(_('This host is already connected'))
|
||||||
|
|
||||||
|
def clean_hostname(self):
|
||||||
|
hostname = self.cleaned_data['hostname']
|
||||||
|
have_symbol = re.match('[^a-z0-9.-]+', hostname)
|
||||||
|
wrong_ip = re.match('^0.|^255.', hostname)
|
||||||
|
if have_symbol:
|
||||||
|
raise forms.ValidationError(_('Hostname must contain only numbers, or the domain name separated by "."'))
|
||||||
|
elif wrong_ip:
|
||||||
|
raise forms.ValidationError(_('Wrong IP address'))
|
||||||
|
try:
|
||||||
|
Compute.objects.get(hostname=hostname)
|
||||||
|
except Compute.DoesNotExist:
|
||||||
|
return hostname
|
||||||
|
raise forms.ValidationError(_('This host is already connected'))
|
||||||
|
|
||||||
|
|
||||||
|
class ComputeAddSshForm(forms.Form):
|
||||||
|
name = forms.CharField(error_messages={'required': _('No hostname has been entered')},
|
||||||
|
max_length=20)
|
||||||
|
hostname = forms.CharField(error_messages={'required': _('No IP / Domain name has been entered')},
|
||||||
|
max_length=100)
|
||||||
|
login = forms.CharField(error_messages={'required': _('No login has been entered')},
|
||||||
|
max_length=20)
|
||||||
|
|
||||||
|
def clean_name(self):
|
||||||
|
name = self.cleaned_data['name']
|
||||||
|
have_symbol = re.match('[^a-zA-Z0-9._-]+', name)
|
||||||
|
if have_symbol:
|
||||||
|
raise forms.ValidationError(_('The name of the host must not contain any special characters'))
|
||||||
|
elif len(name) > 20:
|
||||||
|
raise forms.ValidationError(_('The name of the host must not exceed 20 characters'))
|
||||||
|
try:
|
||||||
|
Compute.objects.get(name=name)
|
||||||
|
except Compute.DoesNotExist:
|
||||||
|
return name
|
||||||
|
raise forms.ValidationError(_('This host is already connected'))
|
||||||
|
|
||||||
|
def clean_hostname(self):
|
||||||
|
hostname = self.cleaned_data['hostname']
|
||||||
|
have_symbol = re.match('[^a-zA-Z0-9._-]+', hostname)
|
||||||
|
wrong_ip = re.match('^0.|^255.', hostname)
|
||||||
|
if have_symbol:
|
||||||
|
raise forms.ValidationError(_('Hostname must contain only numbers, or the domain name separated by "."'))
|
||||||
|
elif wrong_ip:
|
||||||
|
raise forms.ValidationError(_('Wrong IP address'))
|
||||||
|
try:
|
||||||
|
Compute.objects.get(hostname=hostname)
|
||||||
|
except Compute.DoesNotExist:
|
||||||
|
return hostname
|
||||||
|
raise forms.ValidationError(_('This host is already connected'))
|
||||||
|
|
||||||
|
|
||||||
|
class ComputeAddTlsForm(forms.Form):
|
||||||
|
name = forms.CharField(error_messages={'required': _('No hostname has been entered')},
|
||||||
|
max_length=20)
|
||||||
|
hostname = forms.CharField(error_messages={'required': _('No IP / Domain name has been entered')},
|
||||||
|
max_length=100)
|
||||||
|
login = forms.CharField(error_messages={'required': _('No login has been entered')},
|
||||||
|
max_length=100)
|
||||||
|
password = forms.CharField(error_messages={'required': _('No password has been entered')},
|
||||||
|
max_length=100)
|
||||||
|
|
||||||
|
def clean_name(self):
|
||||||
|
name = self.cleaned_data['name']
|
||||||
|
have_symbol = re.match('[^a-zA-Z0-9._-]+', name)
|
||||||
|
if have_symbol:
|
||||||
|
raise forms.ValidationError(_('The host name must not contain any special characters'))
|
||||||
|
elif len(name) > 20:
|
||||||
|
raise forms.ValidationError(_('The host name must not exceed 20 characters'))
|
||||||
|
try:
|
||||||
|
Compute.objects.get(name=name)
|
||||||
|
except Compute.DoesNotExist:
|
||||||
|
return name
|
||||||
|
raise forms.ValidationError(_('This host is already connected'))
|
||||||
|
|
||||||
|
def clean_hostname(self):
|
||||||
|
hostname = self.cleaned_data['hostname']
|
||||||
|
have_symbol = re.match('[^a-z0-9.-]+', hostname)
|
||||||
|
wrong_ip = re.match('^0.|^255.', hostname)
|
||||||
|
if have_symbol:
|
||||||
|
raise forms.ValidationError(_('Hostname must contain only numbers, or the domain name separated by "."'))
|
||||||
|
elif wrong_ip:
|
||||||
|
raise forms.ValidationError(_('Wrong IP address'))
|
||||||
|
try:
|
||||||
|
Compute.objects.get(hostname=hostname)
|
||||||
|
except Compute.DoesNotExist:
|
||||||
|
return hostname
|
||||||
|
raise forms.ValidationError(_('This host is already connected'))
|
||||||
|
|
||||||
|
|
||||||
|
class ComputeEditHostForm(forms.Form):
|
||||||
|
host_id = forms.CharField()
|
||||||
|
name = forms.CharField(error_messages={'required': _('No hostname has been entered')},
|
||||||
|
max_length=20)
|
||||||
|
hostname = forms.CharField(error_messages={'required': _('No IP / Domain name has been entered')},
|
||||||
|
max_length=100)
|
||||||
|
login = forms.CharField(error_messages={'required': _('No login has been entered')},
|
||||||
|
max_length=100)
|
||||||
|
password = forms.CharField(max_length=100)
|
||||||
|
|
||||||
|
def clean_name(self):
|
||||||
|
name = self.cleaned_data['name']
|
||||||
|
have_symbol = re.match('[^a-zA-Z0-9._-]+', name)
|
||||||
|
if have_symbol:
|
||||||
|
raise forms.ValidationError(_('The name of the host must not contain any special characters'))
|
||||||
|
elif len(name) > 20:
|
||||||
|
raise forms.ValidationError(_('The name of the host must not exceed 20 characters'))
|
||||||
|
return name
|
||||||
|
|
||||||
|
def clean_hostname(self):
|
||||||
|
hostname = self.cleaned_data['hostname']
|
||||||
|
have_symbol = re.match('[^a-zA-Z0-9._-]+', hostname)
|
||||||
|
wrong_ip = re.match('^0.|^255.', hostname)
|
||||||
|
if have_symbol:
|
||||||
|
raise forms.ValidationError(_('Hostname must contain only numbers, or the domain name separated by "."'))
|
||||||
|
elif wrong_ip:
|
||||||
|
raise forms.ValidationError(_('Wrong IP address'))
|
||||||
|
return hostname
|
||||||
|
|
||||||
|
|
||||||
|
class ComputeAddSocketForm(forms.Form):
|
||||||
|
name = forms.CharField(error_messages={'required': _('No hostname has been entered')},
|
||||||
|
max_length=20)
|
||||||
|
|
||||||
|
def clean_name(self):
|
||||||
|
name = self.cleaned_data['name']
|
||||||
|
have_symbol = re.match('[^a-zA-Z0-9._-]+', name)
|
||||||
|
if have_symbol:
|
||||||
|
raise forms.ValidationError(_('The host name must not contain any special characters'))
|
||||||
|
elif len(name) > 20:
|
||||||
|
raise forms.ValidationError(_('The host name must not exceed 20 characters'))
|
||||||
|
try:
|
||||||
|
Compute.objects.get(name=name)
|
||||||
|
except Compute.DoesNotExist:
|
||||||
|
return name
|
||||||
|
raise forms.ValidationError(_('This host is already connected'))
|
|
@ -2,8 +2,10 @@ from django.http import HttpResponseRedirect
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from computes.models import Compute
|
from computes.models import Compute
|
||||||
|
from instances.models import Instance
|
||||||
|
from computes.forms import ComputeAddTcpForm, ComputeAddSshForm, ComputeEditHostForm, ComputeAddTlsForm, ComputeAddSocketForm
|
||||||
from vrtManager.hostdetails import wvmHostDetails
|
from vrtManager.hostdetails import wvmHostDetails
|
||||||
from vrtManager.connection import connection_manager
|
from vrtManager.connection import CONN_SSH, CONN_TCP, CONN_TLS, CONN_SOCKET, connection_manager
|
||||||
from libvirt import libvirtError
|
from libvirt import libvirtError
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,6 +40,71 @@ def computes(request):
|
||||||
computes = Compute.objects.filter()
|
computes = Compute.objects.filter()
|
||||||
computes_info = get_hosts_status(computes)
|
computes_info = get_hosts_status(computes)
|
||||||
|
|
||||||
|
if request.method == 'POST':
|
||||||
|
if 'host_del' in request.POST:
|
||||||
|
compute_id = request.POST.get('host_id', '')
|
||||||
|
try:
|
||||||
|
del_inst_on_host = Instance.objects.filter(compute_id=compute_id)
|
||||||
|
del_inst_on_host.delete()
|
||||||
|
finally:
|
||||||
|
del_host = Compute.objects.get(id=compute_id)
|
||||||
|
del_host.delete()
|
||||||
|
return HttpResponseRedirect(request.get_full_path())
|
||||||
|
if 'host_tcp_add' in request.POST:
|
||||||
|
form = ComputeAddTcpForm(request.POST)
|
||||||
|
if form.is_valid():
|
||||||
|
data = form.cleaned_data
|
||||||
|
new_tcp_host = Compute(name=data['name'],
|
||||||
|
hostname=data['hostname'],
|
||||||
|
type=CONN_TCP,
|
||||||
|
login=data['login'],
|
||||||
|
password=data['password'])
|
||||||
|
new_tcp_host.save()
|
||||||
|
return HttpResponseRedirect(request.get_full_path())
|
||||||
|
if 'host_ssh_add' in request.POST:
|
||||||
|
form = ComputeAddSshForm(request.POST)
|
||||||
|
if form.is_valid():
|
||||||
|
data = form.cleaned_data
|
||||||
|
new_ssh_host = Compute(name=data['name'],
|
||||||
|
hostname=data['hostname'],
|
||||||
|
type=CONN_SSH,
|
||||||
|
login=data['login'])
|
||||||
|
new_ssh_host.save()
|
||||||
|
return HttpResponseRedirect(request.get_full_path())
|
||||||
|
if 'host_tls_add' in request.POST:
|
||||||
|
form = ComputeAddTlsForm(request.POST)
|
||||||
|
if form.is_valid():
|
||||||
|
data = form.cleaned_data
|
||||||
|
new_tls_host = Compute(name=data['name'],
|
||||||
|
hostname=data['hostname'],
|
||||||
|
type=CONN_TLS,
|
||||||
|
login=data['login'],
|
||||||
|
password=data['password'])
|
||||||
|
new_tls_host.save()
|
||||||
|
return HttpResponseRedirect(request.get_full_path())
|
||||||
|
if 'host_socket_add' in request.POST:
|
||||||
|
form = ComputeAddSocketForm(request.POST)
|
||||||
|
if form.is_valid():
|
||||||
|
data = form.cleaned_data
|
||||||
|
new_socket_host = Compute(name=data['name'],
|
||||||
|
hostname='localhost',
|
||||||
|
type=CONN_SOCKET,
|
||||||
|
login='',
|
||||||
|
password='')
|
||||||
|
new_socket_host.save()
|
||||||
|
return HttpResponseRedirect(request.get_full_path())
|
||||||
|
if 'host_edit' in request.POST:
|
||||||
|
form = ComputeEditHostForm(request.POST)
|
||||||
|
if form.is_valid():
|
||||||
|
data = form.cleaned_data
|
||||||
|
compute_edit = Compute.objects.get(id=data['host_id'])
|
||||||
|
compute_edit.name = data['name']
|
||||||
|
compute_edit.hostname = data['hostname']
|
||||||
|
compute_edit.login = data['login']
|
||||||
|
compute_edit.password = data['password']
|
||||||
|
compute_edit.save()
|
||||||
|
return HttpResponseRedirect(request.get_full_path())
|
||||||
|
|
||||||
return render(request, 'computes.html', locals())
|
return render(request, 'computes.html', locals())
|
||||||
|
|
||||||
def overview(request, compute_id):
|
def overview(request, compute_id):
|
||||||
|
|
|
@ -63,34 +63,25 @@
|
||||||
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="hidden" name="host_id" value="{{ compute.id }}">
|
<input type="hidden" name="host_id" value="{{ compute.id }}">
|
||||||
<input type="text" name="name" class="form-control"
|
<input type="text" name="name" class="form-control" value="{{ compute.name }}" maxlength="20" required pattern="[a-z0-9\.\-_]+">
|
||||||
value="{{ compute.name }}" maxlength="20" required
|
|
||||||
pattern="[a-z0-9\.\-_]+">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label">{% trans "FQDN / IP" %}</label>
|
<label class="col-sm-4 control-label">{% trans "FQDN / IP" %}</label>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="text" name="hostname" class="form-control"
|
<input type="text" name="hostname" class="form-control" value="{{ compute.hostname }}" required pattern="[a-z0-9\.\-_]+">
|
||||||
value="{{ compute.hostname }}" required
|
|
||||||
pattern="[a-z0-9\.\-_]+">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label">{% trans "Username" %}</label>
|
<label class="col-sm-4 control-label">{% trans "Username" %}</label>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="text" name="login" class="form-control"
|
<input type="text" name="login" class="form-control" value="{{ compute.login }}">
|
||||||
value="{{ compute.login }}">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label">{% trans "Password" %}</label>
|
<label class="col-sm-4 control-label">{% trans "Password" %}</label>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="password" name="password" class="form-control"
|
<input type="password" name="password" class="form-control" value="{{ compute.password }}">
|
||||||
value="{{ compute.password }}">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -111,32 +102,23 @@
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||||
<p class="modal-body">{% trans "Need create ssh <a href='https://github.com/retspen/webvirtmgr/wiki/Setup-SSH-Authorization'>authorization key</a>. If you have another SSH port on your server, you can add IP:PORT like '192.168.1.1:2222'." %}</p>
|
<p class="modal-body">{% trans "Need create ssh <a href='https://github.com/retspen/webvirtmgr/wiki/Setup-SSH-Authorization'>authorization key</a>. If you have another SSH port on your server, you can add IP:PORT like '192.168.1.1:2222'." %}</p>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="hidden" name="host_id" value="{{ host.id }}">
|
<input type="hidden" name="host_id" value="{{ compute.id }}">
|
||||||
<input type="text" name="name" class="form-control"
|
<input type="text" name="name" class="form-control" value="{{ compute.name }}" maxlength="20" required pattern="[a-z0-9\.\-_]+">
|
||||||
value="{{ host.name }}" maxlength="20" required
|
|
||||||
pattern="[a-z0-9\.\-_]+">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label">{% trans "FQDN / IP" %}</label>
|
<label class="col-sm-4 control-label">{% trans "FQDN / IP" %}</label>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="text" name="hostname" class="form-control"
|
<input type="text" name="hostname" class="form-control" value="{{ compute.hostname }}" required pattern="[a-z0-9\:\.\-_]+">
|
||||||
value="{{ host.hostname }}" required
|
|
||||||
pattern="[a-z0-9\:\.\-_]+">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label">{% trans "Username" %}</label>
|
<label class="col-sm-4 control-label">{% trans "Username" %}</label>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="text" name="login" class="form-control"
|
<input type="text" name="login" class="form-control" value="{{ compute.login }}">
|
||||||
value="{{ host.login }}">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -158,37 +140,51 @@
|
||||||
<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 class="col-sm-4 control-label">{% trans "Label" %}</label>
|
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="hidden" name="host_id" value="{{ host.id }}">
|
<input type="hidden" name="host_id" value="{{ compute.id }}">
|
||||||
<input type="text" name="name" class="form-control"
|
<input type="text" name="name" class="form-control" value="{{ compute.name }}" maxlength="20" required pattern="[a-z0-9\.\-_]+">
|
||||||
value="{{ host.name }}" maxlength="20" required
|
|
||||||
pattern="[a-z0-9\.\-_]+">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label">{% trans "FQDN / IP" %}</label>
|
<label class="col-sm-4 control-label">{% trans "FQDN / IP" %}</label>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="text" name="hostname" class="form-control"
|
<input type="text" name="hostname" class="form-control" value="{{ compute.hostname }}" required pattern="[a-z0-9\:\.\-_]+">
|
||||||
value="{{ host.hostname }}" required
|
|
||||||
pattern="[a-z0-9\:\.\-_]+">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label">{% trans "Username" %}</label>
|
<label class="col-sm-4 control-label">{% trans "Username" %}</label>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="text" name="login" class="form-control"
|
<input type="text" name="login" class="form-control" placeholder="{% trans "Name" %}">
|
||||||
placeholder="{% trans "Name" %}">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label">{% trans "Password" %}</label>
|
<label class="col-sm-4 control-label">{% trans "Password" %}</label>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="password" name="password" class="form-control"
|
<input type="password" name="password" class="form-control" value="{{ compute.password }}">
|
||||||
value="{{ host.password }}">
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="submit" class="pull-left btn btn-danger" name="host_del">
|
||||||
|
{% trans "Delete" %}
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
|
{% trans "Close" %}
|
||||||
|
</button>
|
||||||
|
<button type="submit" class="btn btn-primary" name="host_tls_add">
|
||||||
|
{% trans "Add" %}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
{% endifequal %}
|
||||||
|
{% ifequal compute.type 4 %}
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="hidden" name="host_id" value="{{ compute.id }}">
|
||||||
|
<input type="text" name="name" class="form-control" value="{{ compute.name }}" maxlength="20" required pattern="[a-z0-9\.\-_]+">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,159 @@
|
||||||
|
{% load i18n %}
|
||||||
{% if request.user.is_superuser %}
|
{% if request.user.is_superuser %}
|
||||||
<button type="button" class="btn btn-success pull-right">
|
<a href="#addHost" type="button" class="btn btn-success pull-right" data-toggle="modal">
|
||||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- Modal -->
|
||||||
|
<div class="modal fade" id="addHost" tabindex="-1" role="dialog" aria-labelledby="addHostLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h4 class="modal-title">{% trans "Add Connection" %}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="tabbable">
|
||||||
|
<ul class="nav nav-tabs">
|
||||||
|
<li class="active">
|
||||||
|
<a href="#1" data-toggle="tab">{% trans "TCP Connections" %}</a>
|
||||||
|
</li>
|
||||||
|
<li><a href="#2" data-toggle="tab">{% trans "SSH Connections" %}</a></li>
|
||||||
|
<li><a href="#3" data-toggle="tab">{% trans "TLS Connection" %}</a></li>
|
||||||
|
<li><a href="#4" data-toggle="tab">{% trans "Local Socket" %}</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane active" id="1">
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" name="name" class="form-control" placeholder="Label Name" maxlength="20" required pattern="[a-z0-9\.\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "FQDN / IP" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" name="hostname" class="form-control" placeholder="{% trans "FQDN or IP Address" %}" required pattern="[a-z0-9\.\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Username" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" name="login" class="form-control" placeholder="{% trans "Username" %}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Password" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="password" name="password" class="form-control" placeholder="{% trans "Password" %}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
|
{% trans "Close" %}
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" class="btn btn-primary" name="host_tcp_add">
|
||||||
|
{% trans "Add" %}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane" id="2">
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||||
|
<p class="modal-body">{% trans "You must create ssh <a href='https://github.com/retspen/webvirtmgr/wiki/Setup-SSH-Authorization'>authorization key</a>. If you have another SSH port on your server, you can add IP:PORT like '192.168.1.1:2222'." %}</p>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" name="name" class="form-control" placeholder="Label Name" maxlength="20" required pattern="[a-z0-9\.\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "FQDN / IP" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" name="hostname" class="form-control" placeholder="{% trans "FQDN or IP Address" %}" required pattern="[a-z0-9\:\.\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Username" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" name="login" class="form-control" placeholder="{% trans "Username" %}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
|
{% trans "Close" %}
|
||||||
|
</button>
|
||||||
|
<button type="submit" class="btn btn-primary" name="host_ssh_add">
|
||||||
|
{% trans "Add" %}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane" id="3">
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" name="name" class="form-control" placeholder="Label Name" maxlength="20" required pattern="[a-z0-9\.\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "FQDN / IP" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" name="hostname" class="form-control" placeholder="{% trans "FQDN or IP Address" %}" required pattern="[a-z0-9\.\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Username" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" name="login" class="form-control" placeholder="{% trans "Username" %}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Password" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="password" name="password" class="form-control" placeholder="{% trans "Password" %}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
|
{% trans "Close" %}
|
||||||
|
</button>
|
||||||
|
<button type="submit" class="btn btn-primary" name="host_tls_add">
|
||||||
|
{% trans "Add" %}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane" id="4">
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" name="name" class="form-control" placeholder="Label Name" maxlength="20" required pattern="[a-z0-9\.\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
|
{% trans "Close" %}
|
||||||
|
</button>
|
||||||
|
<button type="submit" class="btn btn-primary" name="host_socket_add">
|
||||||
|
{% trans "Add" %}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div> <!-- /.tab-content -->
|
||||||
|
</div> <!-- /.modal-content -->
|
||||||
|
</div> <!-- /.modal-dialog -->
|
||||||
|
</div><!-- /.modal -->
|
||||||
{% endif %}
|
{% endif %}
|
|
@ -1,5 +1,143 @@
|
||||||
|
{% load i18n %}
|
||||||
{% if request.user.is_superuser %}
|
{% if request.user.is_superuser %}
|
||||||
<button type="button" class="btn btn-success pull-right">
|
<a href="#AddInterface" type="button" class="btn btn-success pull-right" data-toggle="modal">
|
||||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- Modal Secret -->
|
||||||
|
<div class="modal fade" id="AddInterface" tabindex="-1" role="dialog" aria-labelledby="AddInterface" aria-hidden="true">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h4 class="modal-title">{% trans "Create New Interface" %}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" name="name" class="form-control" placeholder="br0" maxlength="10" required pattern="[a-z0-9\. ]+"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Start mode" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select name="start_mode" class="form-control">
|
||||||
|
<option value="none">{% trans "none" %}</option>
|
||||||
|
<option value="onboot">{% trans "onboot" %}</option>
|
||||||
|
<option value="hotplug">{% trans "hotplug" %}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Device" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select name="netdev" class="form-control">
|
||||||
|
{% for dev in netdevs %}
|
||||||
|
<option value="{{ dev }}">{{ dev }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Type" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select name="itype" class="form-control" id="itype">
|
||||||
|
<option value="bridge">{% trans "bridge" %}</option>
|
||||||
|
<option value="ethernet">{% trans "ethernet" %}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group bridge_name_form_group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "STP" %}</label>
|
||||||
|
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select name="stp" class="form-control">
|
||||||
|
<option value="on">{% trans "on" %}</option>
|
||||||
|
<option value="off">{% trans "off" %}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group bridge_name_form_group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Delay" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" name="delay" class="form-control" value="0" maxlength="3" required pattern="[0-9]+"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tabbable">
|
||||||
|
<ul class="nav nav-tabs">
|
||||||
|
<li class="active">
|
||||||
|
<a href="#1" data-toggle="tab">{% trans "IPv4" %}</a>
|
||||||
|
</li>
|
||||||
|
<li><a href="#2" data-toggle="tab">{% trans "IPv6" %}</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane active" id="1">
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "IPv4 Mode" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select name="ipv4_type" class="form-control" id="ipv4">
|
||||||
|
<option value="dhcp">{% trans "DHCP" %}</option>
|
||||||
|
<option value="static">{% trans "Static" %}</option>
|
||||||
|
<option value="none">{% trans "No configuration" %}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group static_ipv4_form_group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "IPv4 Address" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="ipv4_addr" maxlength="19" pattern="[0-9\.\/]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group static_ipv4_form_group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "IPv4 Gateway" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="ipv4_gw" maxlength="16" pattern="[0-9\.]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane" id="2">
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "IPv6 Mode" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select name="ipv6_type" class="form-control" id="ipv6">
|
||||||
|
<option value="none">{% trans "No configuration" %}</option>
|
||||||
|
<option value="dhcp">{% trans "DHCP" %}</option>
|
||||||
|
<option value="static">{% trans "Static" %}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group static_ipv6_form_group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "IPv6 Address" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="ipv6_addr" maxlength="100" pattern="[0-9a-f\:\/]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group static_ipv6_form_group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "IPv6 Gateway" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="ipv6_gw" maxlength="100" pattern="[0-9a-f\:]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
|
{% trans "Close" %}
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" class="btn btn-primary" name="create">
|
||||||
|
{% trans "Create" %}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div> <!-- /.modal-content -->
|
||||||
|
</div> <!-- /.modal-dialog -->
|
||||||
|
</div><!-- /.modal -->
|
||||||
{% endif %}
|
{% endif %}
|
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
{% include 'errors_block.html' %}
|
{% include 'errors_block.html' %}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,73 @@
|
||||||
|
{% load i18n %}
|
||||||
{% if request.user.is_superuser %}
|
{% if request.user.is_superuser %}
|
||||||
<button type="button" class="btn btn-success pull-right">
|
<a href="#AddNetPool" type="button" class="btn btn-success pull-right" data-toggle="modal">
|
||||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||||
</button>
|
</a>
|
||||||
|
|
||||||
|
<!-- Modal pool -->
|
||||||
|
<div class="modal fade" id="AddNetPool" tabindex="-1" role="dialog" aria-labelledby="AddNetPoolLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h4 class="modal-title">{% trans "Add New Network" %}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Name" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="name" placeholder="default" required pattern="[a-zA-Z0-9_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group bridge_name_form_group_dhcp">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Subnet pool" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="subnet" value="192.168.100.0/24" required pattern="[0-9\/\.]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group bridge_name_form_group_dhcp">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "DHCP" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="checkbox" name="dhcp" value="true" checked>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group bridge_name_form_group_dhcp">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Fixed Address" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="checkbox" name="fixed" value="true">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Type forwarding" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select id="forward_select" class="form-control" name="forward">
|
||||||
|
<option value="nat">{% trans "NAT" %}</option>
|
||||||
|
<option value="route">{% trans "ROUTE" %}</option>
|
||||||
|
<option value="none">{% trans "ISOLATE" %}</option>
|
||||||
|
<option value="bridge">{% trans "BRIDGE" %}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group bridge_name_form_group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Bridge Name" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="bridge_name" placeholder="br0" pattern="[a-z0-9\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group bridge_name_form_group">
|
||||||
|
<label class="col-sm-4 control-label">{% trans "Open vSwitch" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="checkbox" name="openvswitch" value="true">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||||
|
<button type="submit" class="btn btn-primary" name="create">{% trans "Create" %}</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div> <!-- /.modal-content -->
|
||||||
|
</div> <!-- /.modal-dialog -->
|
||||||
|
</div> <!-- /.modal -->
|
||||||
{% endif %}
|
{% endif %}
|
|
@ -1,5 +1,60 @@
|
||||||
|
{% load i18n %}
|
||||||
{% if request.user.is_superuser %}
|
{% if request.user.is_superuser %}
|
||||||
<button type="button" class="btn btn-success pull-right">
|
<a href="#AddSecret" type="button" class="btn btn-success pull-right" data-toggle="modal">
|
||||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||||
</button>
|
</a>
|
||||||
|
|
||||||
|
<!-- Modal Secret -->
|
||||||
|
<div class="modal fade" id="AddSecret" tabindex="-1" role="dialog" aria-labelledby="AddSecret" aria-hidden="true">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h4 class="modal-title">{% trans "Create New Secret" %}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Ephemeral" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select name="ephemeral" class="form-control">
|
||||||
|
<option value="no">{% trans "no" %}</option>
|
||||||
|
<option value="yes">{% trans "yes" %}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Private" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select name="private" class="form-control">
|
||||||
|
<option value="no">{% trans "no" %}</option>
|
||||||
|
<option value="yes">{% trans "yes" %}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Usage" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select name="usage_type" class="form-control">
|
||||||
|
<option value="ceph">{% trans "ceph" %}</option>
|
||||||
|
<option value="volume">{% trans "volume" %}</option>
|
||||||
|
<option value="iscsi">{% trans "iscsi" %}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Data" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" name="data" class="form-control" value="" required pattern="[a-z0-9\. ]+"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||||
|
<button type="submit" class="btn btn-primary" name="create">{% trans "Create" %}</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div> <!-- /.modal-content -->
|
||||||
|
</div> <!-- /.modal-dialog -->
|
||||||
|
</div><!-- /.modal -->
|
||||||
{% endif %}
|
{% endif %}
|
|
@ -1,5 +1,238 @@
|
||||||
|
{% load i18n %}
|
||||||
{% if request.user.is_superuser %}
|
{% if request.user.is_superuser %}
|
||||||
<button type="button" class="btn btn-success pull-right">
|
<a href="#AddStgPool" type="button" class="btn btn-success pull-right" data-toggle="modal">
|
||||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- Modal Storage pool -->
|
||||||
|
<div class="modal fade" id="AddStgPool" tabindex="-1" role="dialog" aria-labelledby="AddStgPoolLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h4 class="modal-title">{% trans "Create Storage Pool" %}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="tabbable">
|
||||||
|
<ul class="nav nav-tabs">
|
||||||
|
<li class="active">
|
||||||
|
<a href="#1" data-toggle="tab">{% trans "DIR" %}</a>
|
||||||
|
</li>
|
||||||
|
<li><a href="#2" data-toggle="tab">{% trans "LVM" %}</a></li>
|
||||||
|
<li><a href="#3" data-toggle="tab">{% trans "CEPH" %}</a></li>
|
||||||
|
<li><a href="#4" data-toggle="tab">{% trans "NETFS" %}</a></li>
|
||||||
|
<li><a href="#5" data-toggle="tab">{% trans "ISO" %}</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane active" id="1">
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Type" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="stg_type" value="dir" disabled>
|
||||||
|
<input type="hidden" name="stg_type" value="dir">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="name" placeholder="default" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Path" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" name="target" class="form-control" value="/var/lib/libvirt/images" required pattern="[a-zA-Z0-9\/\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||||
|
<button type="submit" class="btn btn-primary" name="create">{% trans "Create" %}</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane" id="2">
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Type" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="stg_type" value="logical" disabled>
|
||||||
|
<input type="hidden" name="stg_type" value="logical">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="name" placeholder="default" maxlength="20" required pattern="[a-zA-Z0-9\.\-\_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Device" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="source" value="/dev/sdb" required pattern="[a-z0-9\/]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||||
|
<button type="submit" class="btn btn-primary" name="create">{% trans "Create" %}</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane" id="3">
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Type" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="stg_type" value="rbd" disabled>
|
||||||
|
<input type="hidden" name="stg_type" value="rbd">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="name" placeholder="rbdpool" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Ceph User" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="ceph_user" placeholder="libvirt" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Ceph Pool" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="ceph_pool" placeholder="libvirt-pool" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Ceph Host" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="ceph_host" placeholder="mon0.ceph.host" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Secrets" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select name="secret" class="form-control">
|
||||||
|
{% if secrets %}
|
||||||
|
{% for secret in secrets %}
|
||||||
|
<option value="{{ secret }}">{{ secret }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
|
<option value="None">{% trans "None" %}</option>
|
||||||
|
{% endif %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
|
{% trans "Close" %}
|
||||||
</button>
|
</button>
|
||||||
|
{% if secrets %}
|
||||||
|
<button type="submit" class="btn btn-primary" name="create">
|
||||||
|
{% trans "Create" %}
|
||||||
|
</button>
|
||||||
|
{% else %}
|
||||||
|
<button class="btn btn-primary disabled" name="create">
|
||||||
|
{% trans "Create" %}
|
||||||
|
</button>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane" id="4">
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Type" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="stg_type" value="netfs" disabled>
|
||||||
|
<input type="hidden" name="stg_type" value="netfs">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="name" placeholder="netfspool" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Hostname" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="netfs_host" placeholder="nfs.example.com" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Remote Path" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="source" placeholder="/srv/storage/" maxlength="40" required pattern="[a-zA-Z0-9\/\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Format" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select name="source_format" class="form-control" id="source_format">
|
||||||
|
<option value="auto">{% trans "auto" %}</option>
|
||||||
|
<option value="nfs">{% trans "nfs" %}</option>
|
||||||
|
<option value="glusterfs">{% trans "glusterfs" %}</option>
|
||||||
|
<option value="cifs">{% trans "cifs" %}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Local Path" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="target" placeholder="/srv/storage/" maxlength="40" required pattern="[a-zA-Z0-9\/\-_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
|
{% trans "Close" %}
|
||||||
|
</button>
|
||||||
|
<button type="submit" class="btn btn-primary" name="create">
|
||||||
|
{% trans "Create" %}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane" id="5">
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="name" value="iso" disabled>
|
||||||
|
<input type="hidden" name="name" value="iso">
|
||||||
|
<input type="hidden" name="stg_type" value="dir">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Path" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" name="target" value="/var/www/webvirtmgr/images" required pattern="[a-zA-Z0-9\/\-\_]+">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
|
{% trans "Close" %}
|
||||||
|
</button>
|
||||||
|
<button type="submit" class="btn btn-primary" name="create">
|
||||||
|
{% trans "Create" %}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> <!-- /.modal-content -->
|
||||||
|
</div> <!-- /.modal-dialog -->
|
||||||
|
</div> <!-- /.modal -->
|
||||||
{% endif %}
|
{% endif %}
|
|
@ -90,8 +90,7 @@
|
||||||
title="{% trans "Destroy" %}" onclick="return confirm('Are you sure?')">
|
title="{% trans "Destroy" %}" onclick="return confirm('Are you sure?')">
|
||||||
<span class="glyphicon glyphicon-stop"></span>
|
<span class="glyphicon glyphicon-stop"></span>
|
||||||
</button>
|
</button>
|
||||||
<a href="#" class="btn btn-sm btn-default"
|
<a href="#" class="btn btn-sm btn-default" onclick='open_console("{{ host.0 }}-{{ info.uuid }}")' title="{% trans "Console" %}">
|
||||||
onclick='open_console("{{ host.0 }}-{{ info.uuid }}")' title="{% trans "Console" %}">
|
|
||||||
<span class="glyphicon glyphicon-eye-open"></span>
|
<span class="glyphicon glyphicon-eye-open"></span>
|
||||||
</a>
|
</a>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
|
|
67
templates/interface.html
Normal file
67
templates/interface.html
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% block title %}{% trans "Interface" %} - {{ iface }}{% endblock %}
|
||||||
|
{% block content %}
|
||||||
|
<!-- Page Heading -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<h1 class="page-header">{% trans "Interface:" %} {{ iface }}</h1>
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li class="active">
|
||||||
|
<i class="fa fa-dashboard"></i> <a href="{% url 'overview' compute.id %}">{% trans "Overview" %}</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-hdd-o"></i> <a href="{% url 'storages' compute.id %}">{% trans "Storages" %}</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-sitemap"></i> <a href="{% url 'networks' compute.id %}">{% trans "Networks" %}</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-wifi"></i> <a href="{% url 'interfaces' compute.id %}">{% trans "Interfaces" %}</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-key"></i> <a href="{% url 'secrets' compute.id %}">{% trans "Secrets" %}</a>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /.row -->
|
||||||
|
|
||||||
|
{% include 'errors_block.html' %}
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-6 col-sm-4">
|
||||||
|
<p>{% trans "Interface:" %}</p>
|
||||||
|
<p>{% trans "IPv4:" %} ({% ifequal ipv4 None %}None{% else %}{{ ipv4_type }}{% endifequal %})</p>
|
||||||
|
<p>{% trans "IPv6:" %} ({% ifequal ipv6 None %}None{% else %}{{ ipv6_type }}{% endifequal %})</p>
|
||||||
|
<p>{% trans "MAC Adress:" %}</p>
|
||||||
|
<p>{% trans "Interface Type:" %}</p>
|
||||||
|
{% ifequal itype 'bridge' %}
|
||||||
|
<p>{% trans "Bridge device" %}</p>
|
||||||
|
{% endifequal %}
|
||||||
|
<p>{% trans "Boot Mode:" %}</p>
|
||||||
|
<p>{% trans "State:" %}</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-6 col-sm-6">
|
||||||
|
<p><strong>{{ iface }}</strong></p>
|
||||||
|
<p>{{ ipv4 }}</p>
|
||||||
|
<p>{{ ipv6 }}</p>
|
||||||
|
<p>{{ mac }}</p>
|
||||||
|
<p>{{ itype }}</p>
|
||||||
|
{% ifequal itype 'bridge' %}
|
||||||
|
<p>{{ bridge }}</p>
|
||||||
|
{% endifequal %}
|
||||||
|
<p>{{ start_mode }}</p>
|
||||||
|
<p>
|
||||||
|
<form action="" method="post" role="form">{% csrf_token %}
|
||||||
|
{% ifequal state 0 %}
|
||||||
|
<input type="submit" class="btn btn-xs btn-default" name="start" value="{% trans "Start" %}">
|
||||||
|
<input type="submit" class="btn btn-xs btn-default" name="delete" value="{% trans "Delete" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||||
|
{% else %}
|
||||||
|
<input type="submit" class="btn btn-xs btn-default" name="stop" value="{% trans "Stop" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||||
|
{% endifequal %}
|
||||||
|
</form>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
|
@ -64,3 +64,30 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
{% block script %}
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('#itype').change(function (eventObject) {
|
||||||
|
if ($(this).val() == 'bridge') {
|
||||||
|
$('.bridge_name_form_group').show();
|
||||||
|
} else {
|
||||||
|
$('.bridge_name_form_group').hide();
|
||||||
|
}
|
||||||
|
}).change();
|
||||||
|
$('#ipv4').change(function (eventObject) {
|
||||||
|
if ($(this).val() == 'static') {
|
||||||
|
$('.static_ipv4_form_group').show();
|
||||||
|
} else {
|
||||||
|
$('.static_ipv4_form_group').hide();
|
||||||
|
}
|
||||||
|
}).change();
|
||||||
|
$('#ipv6').change(function (eventObject) {
|
||||||
|
if ($(this).val() == 'static') {
|
||||||
|
$('.static_ipv6_form_group').show();
|
||||||
|
} else {
|
||||||
|
$('.static_ipv6_form_group').hide();
|
||||||
|
}
|
||||||
|
}).change();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
|
@ -1,6 +1,6 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block title %}{% trans "Networks" %} - {{ compute.name }}{% endblock %}
|
{% block title %}{% trans "Network" %} - {{ pool }}{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<!-- Page Heading -->
|
<!-- Page Heading -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
@ -63,3 +63,18 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
{% block script %}
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('#forward_select').change(function (eventObject) {
|
||||||
|
if ($(this).val() == 'bridge') {
|
||||||
|
$('.bridge_name_form_group').show();
|
||||||
|
$('.bridge_name_form_group_dhcp').hide();
|
||||||
|
} else {
|
||||||
|
$('.bridge_name_form_group').hide();
|
||||||
|
$('.bridge_name_form_group_dhcp').show();
|
||||||
|
}
|
||||||
|
}).change();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
|
@ -6,7 +6,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
{% include 'create_secret_block.html' %}
|
{% include 'create_secret_block.html' %}
|
||||||
<h1 class="page-header">{{ compute.name }}</h1>
|
<h1 class="page-header">{% trans "Secrets" %}</h1>
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li class="active">
|
<li class="active">
|
||||||
<i class="fa fa-dashboard"></i> <a href="{% url 'overview' compute.id %}">{% trans "Overview" %}</a>
|
<i class="fa fa-dashboard"></i> <a href="{% url 'overview' compute.id %}">{% trans "Overview" %}</a>
|
||||||
|
@ -39,7 +39,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<table class="table table-responsive">
|
<div class="col-lg-12">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="active">
|
<tr class="active">
|
||||||
<th>{% trans "UUID" %}</th>
|
<th>{% trans "UUID" %}</th>
|
||||||
|
@ -66,43 +68,35 @@
|
||||||
<td>
|
<td>
|
||||||
<form action="" method="post" role="form">{% csrf_token %}
|
<form action="" method="post" role="form">{% csrf_token %}
|
||||||
<input type="hidden" name="uuid" value="{{ secret.uuid }}"/>
|
<input type="hidden" name="uuid" value="{{ secret.uuid }}"/>
|
||||||
<a data-toggle="modal" href="#editSecret{{ secret.uuid }}"
|
<a data-toggle="modal" href="#editSecret{{ secret.uuid }}" class="btn btn-sm btn-default" title="{% trans "Edit" %}">
|
||||||
class="btn btn-sm btn-primary" title="{% trans "Edit" %}">
|
|
||||||
<span class="glyphicon glyphicon-pencil"></span>
|
<span class="glyphicon glyphicon-pencil"></span>
|
||||||
</a>
|
</a>
|
||||||
<button type="submit" class="btn btn-sm btn-danger" name="delete"
|
<button type="submit" class="btn btn-sm btn-default" name="delete" title="{% trans "Delete" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||||
title="{% trans "Delete" %}"
|
|
||||||
onclick="return confirm('{% trans "Are you sure?" %}')">
|
|
||||||
<span class="glyphicon glyphicon-trash"></span>
|
<span class="glyphicon glyphicon-trash"></span>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
<div class="modal fade" id="editSecret{{ secret.uuid }}" tabindex="-1" role="dialog"
|
<div class="modal fade" id="editSecret{{ secret.uuid }}" tabindex="-1" role="dialog"
|
||||||
aria-labelledby="editSecret" aria-hidden="true">
|
aria-labelledby="editSecret" aria-hidden="true">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
aria-hidden="true">×</button>
|
|
||||||
<h4 class="modal-title">{% trans "Set secret value" %}</h4>
|
<h4 class="modal-title">{% trans "Set secret value" %}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<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 class="col-sm-3 control-label">{% trans "Value" %}</label>
|
<label class="col-sm-3 control-label">{% trans "Value" %}</label>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="hidden" name="uuid" value="{{ secret.uuid }}">
|
<input type="hidden" name="uuid" value="{{ secret.uuid }}">
|
||||||
<input type="text" name="value" class="form-control"
|
<input type="text" name="value" class="form-control" value="{{ secret.value }}" maxlength="45" required pattern="[a-zA-Z0-9]$+">
|
||||||
value="{{ secret.value }}" maxlength="45" required
|
|
||||||
pattern="[a-zA-Z0-9]$+">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default"
|
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||||
data-dismiss="modal">{% trans "Close" %}</button>
|
<button type="submit" class="btn btn-primary" name="set_value">{% trans "Set" %}</button>
|
||||||
<button type="submit" class="btn btn-primary"
|
|
||||||
name="set_value">{% trans "Set" %}</button>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div> <!-- /.modal-content -->
|
</div> <!-- /.modal-content -->
|
||||||
|
@ -114,6 +108,8 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in a new issue