mirror of
https://github.com/retspen/webvirtcloud
synced 2026-03-22 10:34:49 +00:00
Added admin application
- Manage users - Manage groups - Manage logs
This commit is contained in:
parent
a5bf337052
commit
515b027ab8
6 changed files with 9 additions and 15 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if create_url %}
|
{% if create_url %}
|
||||||
<a class="btn btn-success float-right" href="{% url create_url %}">{% icon 'plus' %} {%trans "Create New" %}</a>
|
<a class="btn btn-success float-right" href="{% url create_url %}">{% icon 'plus' %} {%trans "Create New" %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<table class="table table-hover table-striped">
|
<table class="table table-hover table-striped">
|
||||||
{% for object in object_list %}
|
{% for object in object_list %}
|
||||||
|
|
@ -15,9 +15,9 @@
|
||||||
<div class="btn-group float-right">
|
<div class="btn-group float-right">
|
||||||
<a class="btn btn-success" href="{% url update_url object.id %}">{% icon 'edit' %} {%trans "Edit"%}</a>
|
<a class="btn btn-success" href="{% url update_url object.id %}">{% icon 'edit' %} {%trans "Edit"%}</a>
|
||||||
{% if extra_urls %}
|
{% if extra_urls %}
|
||||||
{% for url in extra_urls %}
|
{% for url in extra_urls %}
|
||||||
<a class="btn btn-primary" href="{% url url.0 object.id %}">{{ url.1 }}</a>
|
<a class="btn btn-primary" href="{% url url.0 object.id %}">{{ url.1 }}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a class="btn btn-danger" href="{% url delete_url object.id %}">{% icon 'times' %} {%trans "Delete" %}</a>
|
<a class="btn btn-danger" href="{% url delete_url object.id %}">{% icon 'times' %} {%trans "Delete" %}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ def group_create(request):
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
form.save()
|
form.save()
|
||||||
return redirect('admin:group_list')
|
return redirect('admin:group_list')
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
'admin/common/form.html',
|
'admin/common/form.html',
|
||||||
|
|
@ -116,8 +115,7 @@ def user_update(request, pk):
|
||||||
user = get_object_or_404(User, pk=pk)
|
user = get_object_or_404(User, pk=pk)
|
||||||
attributes = UserAttributes.objects.get(user=user)
|
attributes = UserAttributes.objects.get(user=user)
|
||||||
user_form = forms.UserForm(request.POST or None, instance=user)
|
user_form = forms.UserForm(request.POST or None, instance=user)
|
||||||
attributes_form = forms.UserAttributesForm(
|
attributes_form = forms.UserAttributesForm(request.POST or None, instance=attributes)
|
||||||
request.POST or None, instance=attributes)
|
|
||||||
if user_form.is_valid() and attributes_form.is_valid():
|
if user_form.is_valid() and attributes_form.is_valid():
|
||||||
user_form.save()
|
user_form.save()
|
||||||
attributes_form.save()
|
attributes_form.save()
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ from vrtManager.connection import (CONN_SOCKET, CONN_SSH, CONN_TCP, CONN_TLS, co
|
||||||
from vrtManager.hostdetails import wvmHostDetails
|
from vrtManager.hostdetails import wvmHostDetails
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@superuser_only
|
@superuser_only
|
||||||
def computes(request):
|
def computes(request):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,7 @@ def secrets(request, compute_id):
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
conn = wvmSecrets(compute.hostname, compute.login,
|
conn = wvmSecrets(compute.hostname, compute.login, compute.password, compute.type)
|
||||||
compute.password, compute.type)
|
|
||||||
secrets = conn.get_secrets()
|
secrets = conn.get_secrets()
|
||||||
|
|
||||||
for uuid in secrets:
|
for uuid in secrets:
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Django settings for webvirtcloud project.
|
Django settings for Webvirtcloud project.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -160,10 +160,8 @@ QEMU_KEYMAPS = ['ar', 'da', 'de', 'de-ch', 'en-gb', 'en-us', 'es', 'et', 'fi',
|
||||||
'ja', 'lt', 'lv', 'mk', 'nl', 'nl-be', 'no', 'pl', 'pt',
|
'ja', 'lt', 'lv', 'mk', 'nl', 'nl-be', 'no', 'pl', 'pt',
|
||||||
'pt-br', 'ru', 'sl', 'sv', 'th', 'tr']
|
'pt-br', 'ru', 'sl', 'sv', 'th', 'tr']
|
||||||
|
|
||||||
# keepalive interval and count for libvirt connections
|
# Keepalive interval and count for libvirt connections
|
||||||
LIBVIRT_KEEPALIVE_INTERVAL = 5
|
LIBVIRT_KEEPALIVE_INTERVAL = 5
|
||||||
LIBVIRT_KEEPALIVE_COUNT = 5
|
LIBVIRT_KEEPALIVE_COUNT = 5
|
||||||
|
|
||||||
ALLOW_EMPTY_PASSWORD = True
|
ALLOW_EMPTY_PASSWORD = True
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue