1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-25 15:45:23 +00:00
This commit is contained in:
catborise 2021-06-15 13:34:29 +03:00
commit 990b69ac51
28 changed files with 58 additions and 28 deletions

View file

@ -1,6 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load static %}
{% load icons %} {% load icons %}
{% block title %}{% trans "Instances" %} - {{ compute.name }}{% endblock %} {% block title %}{% trans "Instances" %} - {{ compute.name }}{% endblock %}
{% block style %} {% block style %}

View file

@ -1,6 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load static %}
{% load icons %} {% load icons %}
{% block title %}{% trans "Overview" %} - {{ compute.name }}{% endblock %} {% block title %}{% trans "Overview" %} - {{ compute.name }}{% endblock %}

View file

@ -1,4 +1,4 @@
from secrets.views import secrets from virtsecrets.views import secrets
from django.urls import include, path from django.urls import include, path
# from instances.views import create_instance, create_instance_select_type # from instances.views import create_instance, create_instance_select_type

View file

@ -1,4 +1,4 @@
Django==2.2.22 Django==3.2.4
django-bootstrap4==3.0.1 django-bootstrap4==3.0.1
django-icons==4.0.0 django-icons==4.0.0
django-login-required-middleware==0.6.1 django-login-required-middleware==0.6.1

View file

@ -1,4 +1,4 @@
{% load staticfiles %} {% load static %}
{% load i18n %} {% load i18n %}
<html> <html>

View file

@ -24,7 +24,7 @@
--> -->
{% extends "console-base.html" %} {% extends "console-base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load static %}
{% block head %} {% block head %}
<title>WebVirtCloud - Spice Client - Full</title> <title>WebVirtCloud - Spice Client - Full</title>

View file

@ -24,7 +24,7 @@
--> -->
{% extends "console-base.html" %} {% extends "console-base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load static %}
{% block head %} {% block head %}
<title>WebVirtCloud - Spice - Lite</title> <title>WebVirtCloud - Spice - Lite</title>

View file

@ -1,6 +1,6 @@
{% extends "console-base.html" %} {% extends "console-base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load static %}
{% block head %} {% block head %}
<!-- <!--

View file

@ -1,6 +1,6 @@
{% extends "console-base.html" %} {% extends "console-base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load static %}
{% block head %} {% block head %}
<!-- <!--

View file

@ -1,7 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load icons %} {% load icons %}
{% load staticfiles %} {% load static %}
{% block title %}{% trans "Instances" %}{% endblock %} {% block title %}{% trans "Instances" %}{% endblock %}
{% block style %} {% block style %}
<link rel="stylesheet" href="{% static 'css/sortable-theme-bootstrap.css' %}" /> <link rel="stylesheet" href="{% static 'css/sortable-theme-bootstrap.css' %}" />

View file

@ -1,6 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load static %}
{% block title %}{% trans "Create new instance" %} - {% trans "Select Type" %}{% endblock %} {% block title %}{% trans "Create new instance" %} - {% trans "Select Type" %}{% endblock %}

View file

@ -1,6 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load static %}
{% load icons %} {% load icons %}
{% block title %}{% trans "Create new instance" %}{% endblock %} {% block title %}{% trans "Create new instance" %}{% endblock %}

View file

@ -1,5 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load staticfiles %} {% load static %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Instance" %} - {{ instance.name }}{% endblock %} {% block title %}{% trans "Instance" %} - {{ instance.name }}{% endblock %}

View file

@ -1,6 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load static %}
{% block title %}{% trans "Interfaces" %} - {{ compute.name }}{% endblock %} {% block title %}{% trans "Interfaces" %} - {{ compute.name }}{% endblock %}

View file

@ -1,6 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load static %}
{% block title %}{% trans "Network" %} - {{ pool }}{% endblock %} {% block title %}{% trans "Network" %} - {{ pool }}{% endblock %}

View file

@ -1,6 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load static %}
{% block title %}{% trans "NWFilter" %}: {{ name }}{% endblock %} {% block title %}{% trans "NWFilter" %}: {{ name }}{% endblock %}

View file

@ -1,6 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load static %}
{% block title %}{% trans "NWFilters" %} - {{ compute.name }}{% endblock %} {% block title %}{% trans "NWFilters" %} - {{ compute.name }}{% endblock %}

View file

@ -1,6 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load static %}
{% block title %}{{ compute }} - {% trans "Storage" %}: {{ pool }}{% endblock %} {% block title %}{{ compute }} - {% trans "Storage" %}: {{ pool }}{% endblock %}
{% block style %} {% block style %}
<link rel="stylesheet" href="{% static "css/sortable-theme-bootstrap.css" %}"/> <link rel="stylesheet" href="{% static "css/sortable-theme-bootstrap.css" %}"/>

View file

@ -1,6 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load static %}
{% block title %}{% trans "Secrets" %} - {{ compute.name }}{% endblock %} {% block title %}{% trans "Secrets" %} - {{ compute.name }}{% endblock %}
{% block style %} {% block style %}

View file

@ -1,4 +1,4 @@
from secrets.forms import AddSecret from virtsecrets.forms import AddSecret
from admin.decorators import superuser_only from admin.decorators import superuser_only
from computes.models import Compute from computes.models import Compute
@ -13,7 +13,7 @@ from libvirt import (
VIR_SECRET_USAGE_TYPE_VOLUME, VIR_SECRET_USAGE_TYPE_VOLUME,
libvirtError, libvirtError,
) )
from vrtManager.secrets import wvmSecrets from vrtManager.virtsecrets import wvmSecrets
@superuser_only @superuser_only

View file

@ -3,10 +3,10 @@ Django settings for webvirtcloud project.
""" """
import os from pathlib import Path
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "" SECRET_KEY = ""
@ -63,7 +63,7 @@ TEMPLATES = [
{ {
"BACKEND": "django.template.backends.django.DjangoTemplates", "BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [ "DIRS": [
os.path.join(BASE_DIR, "templates"), Path.joinpath(BASE_DIR, "templates"),
], ],
"APP_DIRS": True, "APP_DIRS": True,
"OPTIONS": { "OPTIONS": {
@ -83,6 +83,7 @@ TEMPLATES = [
WSGI_APPLICATION = "webvirtcloud.wsgi.application" WSGI_APPLICATION = "webvirtcloud.wsgi.application"
# Settings for django-icons # Settings for django-icons
DJANGO_ICONS = { DJANGO_ICONS = {
@ -96,19 +97,20 @@ DJANGO_ICONS = {
}, },
} }
# Database # Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases # https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = { DATABASES = {
"default": { "default": {
"ENGINE": "django.db.backends.sqlite3", "ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "db.sqlite3"), "NAME": Path.joinpath(BASE_DIR, "db.sqlite3"),
} }
} }
AUTHENTICATION_BACKENDS = [ AUTHENTICATION_BACKENDS = [
"django.contrib.auth.backends.ModelBackend", "django.contrib.auth.backends.ModelBackend",
"webvirtcloud.ldapbackend.LdapAuthenticationBackend", #"webvirtcloud.ldapbackend.LdapAuthenticationBackend",
] ]
LOGIN_URL = "/accounts/login/" LOGIN_URL = "/accounts/login/"
@ -128,13 +130,35 @@ USE_TZ = True
STATIC_URL = "/static/" STATIC_URL = "/static/"
STATICFILES_DIRS = [ STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"), Path.joinpath(BASE_DIR, "static"),
] ]
# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
LOCALE_PATHS = [ LOCALE_PATHS = [
"locale/", "locale/",
] ]
# Settings for django-icons
DJANGO_ICONS = {
'DEFAULTS': {
'renderer': 'fontawesome4',
},
'RENDERERS': {
'fontawesome4': 'FontAwesome4Renderer',
'bootstrap3': 'Bootstrap3Renderer',
},
}
LOGGING = { LOGGING = {
"version": 1, "version": 1,
"disable_existing_loggers": False, "disable_existing_loggers": False,
@ -150,6 +174,7 @@ LOGGING = {
}, },
} }
# #
# WebVirtCloud settings # WebVirtCloud settings
# #
@ -223,10 +248,15 @@ ALLOW_EMPTY_PASSWORD = False
NEW_USER_DEFAULT_INSTANCES = [] NEW_USER_DEFAULT_INSTANCES = []
SHOW_PROFILE_EDIT_PASSWORD = True SHOW_PROFILE_EDIT_PASSWORD = True
# OTP Config
OTP_ENABLED = False OTP_ENABLED = False
LOGIN_REQUIRED_IGNORE_VIEW_NAMES = ["accounts:login", "accounts:email_otp"] LOGIN_REQUIRED_IGNORE_VIEW_NAMES = ["accounts:login", "accounts:email_otp"]
# LDAP Config
#
LDAP_ENABLED = False LDAP_ENABLED = False
LDAP_URL = '' LDAP_URL = ''
LDAP_PORT = 389 LDAP_PORT = 389