1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-10-31 19:44:16 +00:00

fix typos and rearrange imports & add new lines EOF

This commit is contained in:
catborise 2020-06-04 15:22:55 +03:00
parent e21f423bcf
commit e46bb99b3b
17 changed files with 27 additions and 33 deletions

View file

@ -115,4 +115,3 @@
</div>
</div>
{% endblock %}

View file

@ -1,4 +1,3 @@
from django.conf import settings
from django.core.validators import ValidationError
from django.http import HttpResponseRedirect
from django.shortcuts import render
@ -22,7 +21,6 @@ def profile(request):
error_messages = []
# user = User.objects.get(id=request.user.id)
publickeys = UserSSHKey.objects.filter(user_id=request.user.id)
themes_list = os.listdir(settings.SCSS_DIR +"/wvc-theme")
if request.method == 'POST':
if 'username' in request.POST:
@ -104,7 +102,7 @@ def account(request, user_id):
return HttpResponseRedirect(request.get_full_path())
if 'add' in request.POST:
inst_id = request.POST.get('inst_id', '')
if AppSettings.objects.get(key="ALLOW_INSTANCE_MULTIPLE_OWNER").value == 'True':
check_inst = UserInstance.objects.filter(instance_id=int(inst_id), user_id=int(user_id))
else:

View file

@ -6,18 +6,18 @@
{% block content %}
{% 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 %}
<table class="table table-hover table-striped">
<table class="table table-hover">
{% for object in object_list %}
<tr>
<td>{{ object }}
<div class="btn-group float-right">
<a class="btn btn-success" href="{% url update_url object.id %}">{% icon 'edit' %} {%trans "Edit"%}</a>
{% if extra_urls %}
{% for url in extra_urls %}
<a class="btn btn-primary" href="{% url url.0 object.id %}">{{ url.1 }}</a>
{% endfor %}
{% for url in extra_urls %}
<a class="btn btn-primary" href="{% url url.0 object.id %}">{{ url.1 }}</a>
{% endfor %}
{% endif %}
<a class="btn btn-danger" href="{% url delete_url object.id %}">{% icon 'times' %} {%trans "Delete" %}</a>
</div>

View file

@ -4,7 +4,7 @@ from django.shortcuts import get_object_or_404, redirect, render
from django.utils.translation import ugettext_lazy as _
from accounts.models import UserAttributes
from appsettings.views import AppSettings
from appsettings.models import AppSettings
from logs.models import Logs
from . import forms

View file

@ -102,4 +102,4 @@ class Migration(migrations.Migration):
operations = [
migrations.RunPython(add_default_settings, del_default_settings),
]
]

View file

@ -1,7 +1,7 @@
{% load i18n %}
{% load bootstrap4 %}
{% load font_awesome %}
<div class="btn-group float-right">
<div class="btn-group float-right" role="group" aria-label="Add host button group">
<a href="{% url 'add_tcp_host' %}" class="btn btn-success">{% trans "TCP" %}</a>
<a href="{% url 'add_ssh_host' %}" class="btn btn-success">{% trans "SSH" %}</a>
<a href="{% url 'add_tls_host' %}" class="btn btn-success">{% trans "TLS" %}</a>

View file

@ -1,6 +1,7 @@
from django.urls import path, include
from . import views
from . import forms
from create.views import create_instance, create_instance_select_type
from instances.views import instances
from interfaces.views import interface, interfaces
@ -8,7 +9,6 @@ from networks.views import network, networks
from nwfilters.views import nwfilter, nwfilters
from secrets.views import secrets
from storages.views import get_volumes, storage, storages
from . import forms
urlpatterns = [
path('', views.computes, name='computes'),

View file

@ -205,11 +205,11 @@ def create_instance(request, compute_id, arch, machine):
error_messages.append(error_msg)
else:
clone_path = conn.clone_from_template(
data['name'],
templ_path,
data['storage'],
meta_prealloc,
default_disk_owner_uid,
data['name'],
templ_path,
data['storage'],
meta_prealloc,
default_disk_owner_uid,
default_disk_owner_gid)
volume = dict()
volume['path'] = clone_path

View file

@ -1,5 +1,5 @@
{% load i18n %}
<table class="table table-hover table-striped sortable-theme-bootstrap" data-sortable>
<table class="table table-hover sortable-theme-bootstrap" data-sortable>
<thead>
<tr>
<th scope="col">{% trans "Name" %}<br>{% trans "Description" %}</th>

View file

@ -22,4 +22,4 @@
</ul>
</div>
</div>
</nav>
</nav>

View file

@ -1,12 +1,10 @@
import json
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from admin.decorators import superuser_only
from appsettings.models import AppSettings
from instances.models import Instance
from logs.models import Logs

View file

@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
# Create your models here.

View file

@ -79,4 +79,4 @@ def secrets(request, compute_id):
except libvirtError as err:
error_messages.append(err)
return render(request, 'secrets.html', locals())
return render(request, 'secrets.html', locals())

View file

@ -7,7 +7,7 @@
/* Global Styles */
body {
padding-bottom: 40px;
padding-bottom: 50px;
}
.container {

View file

@ -1,15 +1,16 @@
import json
from django.shortcuts import render, get_object_or_404
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render, get_object_or_404
from django.utils.translation import ugettext_lazy as _
from django.urls import reverse
from libvirt import libvirtError
from admin.decorators import superuser_only
from computes.models import Compute
from appsettings.models import AppSettings
from storages.forms import AddStgPool, AddImage, CloneImage
from vrtManager.storage import wvmStorage, wvmStorages
from libvirt import libvirtError
from django.contrib import messages
from admin.decorators import superuser_only
@superuser_only

View file

@ -1,6 +1,6 @@
{% extends "base_auth.html" %}
{% load i18n %}
{% block title %}{% trans "404" %}{% endblock %}
{% block title %}{% trans "403" %}{% endblock %}
{% block content %}
<div class="row">
<div class="col-12 text-center">

View file

@ -25,6 +25,7 @@ INSTALLED_APPS = [
'fa',
'accounts',
'admin',
'appsettings',
'computes',
'console',
'create',
@ -35,7 +36,6 @@ INSTALLED_APPS = [
'nwfilters',
'storages',
'secrets',
'appsettings',
'logs',
]
@ -164,5 +164,6 @@ QEMU_KEYMAPS = ['ar', 'da', 'de', 'de-ch', 'en-gb', 'en-us', 'es', 'et', 'fi',
LIBVIRT_KEEPALIVE_INTERVAL = 5
LIBVIRT_KEEPALIVE_COUNT = 5
ALLOW_EMPTY_PASSWORD = False
NEW_USER_DEFAULT_INSTANCES = []
SHOW_PROFILE_EDIT_PASSWORD = True