diff --git a/.gitignore b/.gitignore index 8860fff..82f321e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,3 @@ webvirtcloud/settings.py .coverage htmlcov *.log -templates/webvirtcloud.code-workspace diff --git a/accounts/templates/account.html b/accounts/templates/account.html index 3dc7768..dfd51dd 100644 --- a/accounts/templates/account.html +++ b/accounts/templates/account.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load i18n %} -{% load bootstrap_icons %} +{% load icons %} {% load qr_code %} {% block title %}{% trans "User Profile" %} - {{ user }}{% endblock %} @@ -10,14 +10,14 @@ {% block page_heading_extra %} {% if otp_enabled %} - {% bs_icon 'qr-code' %} + {% icon 'qrcode' %} {% endif %} - {% bs_icon 'pencil' %} + {% icon 'pencil' %} - {% bs_icon 'plus-circle-fill' %} + {% icon 'plus' %} {% endblock page_heading_extra %} @@ -58,12 +58,12 @@ {{ inst.is_delete }} - {% bs_icon 'pencil' %} + {% icon 'pencil' %} - {% bs_icon 'trash' %} + {% icon 'trash' %} diff --git a/accounts/templates/accounts/change_password_form.html b/accounts/templates/accounts/change_password_form.html index 3df2d0e..d1f8f39 100644 --- a/accounts/templates/accounts/change_password_form.html +++ b/accounts/templates/accounts/change_password_form.html @@ -2,7 +2,7 @@ {% load django_bootstrap5 %} {% load i18n %} -{% load bootstrap_icons %} +{% load icons %} {% block title %}{%trans "Change Password" %}{% endblock title %} @@ -21,10 +21,10 @@ diff --git a/accounts/templates/accounts/email_otp_form.html b/accounts/templates/accounts/email_otp_form.html index 83ba2d9..2eb8ce7 100644 --- a/accounts/templates/accounts/email_otp_form.html +++ b/accounts/templates/accounts/email_otp_form.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% load django_bootstrap5 %} -{% load bootstrap_icons %} +{% load icons %} {% load i18n %} {% block title %}{{ title }}{% endblock %} @@ -22,9 +22,9 @@ diff --git a/accounts/templates/profile.html b/accounts/templates/profile.html index 6e1cd5b..107ea7f 100644 --- a/accounts/templates/profile.html +++ b/accounts/templates/profile.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load i18n %} {% load django_bootstrap5 %} -{% load bootstrap_icons %} +{% load icons %} {% load tags_fingerprint %} {% block title %}{% trans "Profile" %}: {{ request.user.first_name }} {{ request.user.last_name}}{% endblock %} @@ -30,12 +30,12 @@ {% bootstrap_form profile_form layout='horizontal' %} {% if perms.accounts.change_password %} - {% bs_icon 'lock' %} {% trans "Change Password" %} + {% icon 'lock' %} {% trans "Change Password" %} {% endif %}
@@ -53,7 +53,7 @@ {{ key.keyname }} ({% ssh_to_fingerprint key.keypublic %}) - {% bs_icon 'trash' %} + {% icon 'trash' %} @@ -73,7 +73,7 @@ {% bootstrap_form ssh_key_form layout='horizontal' %}
diff --git a/accounts/urls.py b/accounts/urls.py index 211b057..2fa8e26 100644 --- a/accounts/urls.py +++ b/accounts/urls.py @@ -4,7 +4,6 @@ from django.urls import path from django_otp.forms import OTPAuthenticationForm from . import views -from .views import CustomLoginView app_name = "accounts" @@ -51,5 +50,5 @@ if settings.OTP_ENABLED: ] else: urlpatterns += ( - path("login/", CustomLoginView.as_view(template_name="login.html"), name="login"), + path("login/", LoginView.as_view(template_name="login.html"), name="login"), ) diff --git a/accounts/views.py b/accounts/views.py index a7da98a..f973676 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -1,12 +1,11 @@ from admin.decorators import superuser_only from django.conf import settings from django.contrib import messages -from django.contrib.auth import get_user_model, update_session_auth_hash, login as auth_login +from django.contrib.auth import get_user_model, update_session_auth_hash from django.contrib.auth.decorators import permission_required from django.contrib.auth.forms import PasswordChangeForm from django.shortcuts import get_object_or_404, redirect, render from django.urls import reverse -from django.http import HttpResponseRedirect from django.utils.translation import gettext_lazy as _ from instances.models import Instance @@ -15,20 +14,7 @@ from accounts.models import * from . import forms from .utils import get_user_totp_device, send_email_with_otp -from django.contrib.auth.views import LoginView -from logs.views import addlogmsg -class CustomLoginView(LoginView): - def form_valid(self, form): - username = form.cleaned_data['username'] - addlogmsg(username, "-", "-", "Logged In") - auth_login(self.request, form.get_user()) - return HttpResponseRedirect(self.get_success_url()) - - def form_invalid(self, form): - username = form.cleaned_data['username'] - addlogmsg(username, "-", "-", "Failed Login Attempt") - return self.render_to_response(self.get_context_data(form=form)) def profile(request): publickeys = UserSSHKey.objects.filter(user_id=request.user.id) diff --git a/admin/templates/admin/group_list.html b/admin/templates/admin/group_list.html index 3b9c95c..cd2ee9d 100644 --- a/admin/templates/admin/group_list.html +++ b/admin/templates/admin/group_list.html @@ -1,13 +1,13 @@ {% extends "base.html" %} {% load i18n %} {% load static %} -{% load bootstrap_icons %} +{% load icons %} {% block title %}{% trans "Users" %}{% endblock %} {% block content %}
- {% bs_icon 'plus-circle-fill' %} + {% icon 'plus' %} {% include 'search_block.html' %}

{% trans "Groups" %}

@@ -17,7 +17,7 @@ {% if not groups %}
- {% bs_icon 'exclamation-triangle '%} {% trans "Warning" %}: {% trans "You don't have any groups" %} + {% icon 'exclamation-triangle '%} {% trans "Warning" %}: {% trans "You don't have any groups" %}
{% else %} @@ -38,10 +38,10 @@ diff --git a/admin/templates/admin/logs.html b/admin/templates/admin/logs.html index 74fc05b..a6c8f0d 100644 --- a/admin/templates/admin/logs.html +++ b/admin/templates/admin/logs.html @@ -1,7 +1,6 @@ {% extends "base.html" %} {% load i18n %} {% load django_bootstrap5 %} -{% load bootstrap_icons %} {% block title %}{% trans "Logs" %}{% endblock %} @@ -19,7 +18,7 @@ {% if not logs %}
- {% bs_icon 'exclamation-triangle'%} {% trans "Warning" %}: {% trans "You don't have any Logs" %} + {% trans "Warning" %}: {% trans "You don't have any Logs" %}
{% else %} diff --git a/admin/templates/admin/user_form.html b/admin/templates/admin/user_form.html index 47d6b2c..b26f7a9 100644 --- a/admin/templates/admin/user_form.html +++ b/admin/templates/admin/user_form.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% load django_bootstrap5 %} -{% load bootstrap_icons %} +{% load icons %} {% load i18n %} {% block title %}{{ title }}{% endblock %} @@ -16,10 +16,9 @@ {% bootstrap_form attributes_form layout='horizontal' %}
- - {% bs_icon 'x-square-fill' %} {% trans "Cancel" %} + {% icon 'times' %} {% trans "Cancel" %}
diff --git a/admin/templates/admin/user_list.html b/admin/templates/admin/user_list.html index 2e0518b..521fed4 100644 --- a/admin/templates/admin/user_list.html +++ b/admin/templates/admin/user_list.html @@ -2,7 +2,7 @@ {% load i18n %} {% load static %} {% load common_tags %} -{% load bootstrap_icons %} +{% load icons %} {% block title %}{{ title }}{% endblock %} @@ -10,7 +10,7 @@ {% block page_heading_extra %} - {% bs_icon 'plus-circle-fill' %} + {% icon 'plus' %} {% include 'search_block.html' %} {% endblock page_heading_extra %} @@ -20,7 +20,7 @@ {% if not users %}
- {% bs_icon 'exclamation-triangle '%} {% trans "Warning" %}: {% trans "You don't have any user" %} + {% icon 'exclamation-triangle '%} {% trans "Warning" %}: {% trans "You don't have any user" %}
{% else %} @@ -50,19 +50,19 @@ {% trans "Blocked" %} {% endif %} - {% if user.is_staff %}{% bs_icon 'check' %}{% endif %} - {% if user.is_superuser %}{% bs_icon 'check' %}{% endif %} - {% if can_clone %}{% bs_icon 'check' %}{% endif %} + {% if user.is_staff %}{% icon 'check' %}{% endif %} + {% if user.is_superuser %}{% icon 'check' %}{% endif %} + {% if can_clone %}{% icon 'check' %}{% endif %}
- {% bs_icon 'eye-fill' %} - {% bs_icon 'pencil-fill' %} + {% icon 'eye' %} + {% icon 'pencil' %} {% if user.is_active %} - {% bs_icon 'stop-fill' %} + {% icon 'stop' %} {% else %} - {% bs_icon 'play-fill' %} + {% icon 'play' %} {% endif %} - {% bs_icon 'x-circle-fill' %} + {% icon 'times' %}
diff --git a/computes/templates/computes/form.html b/computes/templates/computes/form.html index d867ab4..5b74ca5 100644 --- a/computes/templates/computes/form.html +++ b/computes/templates/computes/form.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% load django_bootstrap5 %} -{% load bootstrap_icons %} +{% load icons %} {% load i18n %} {% block title %}{% trans "Add Compute" %}{% endblock %} @@ -18,10 +18,9 @@ {% bootstrap_form form layout='horizontal' %}
- - {% bs_icon 'x-square-fill' %} {% trans "Cancel" %} + {% icon 'times' %} {% trans "Cancel" %}
diff --git a/computes/templates/computes/instances.html b/computes/templates/computes/instances.html index 8a41bc9..5cf561d 100644 --- a/computes/templates/computes/instances.html +++ b/computes/templates/computes/instances.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load i18n %} {% load static %} -{% load bootstrap_icons %} +{% load icons %} {% block title %}{% trans "Instances" %} - {{ compute.name }}{% endblock %} {% block style %} @@ -11,7 +11,7 @@ {% block page_heading_extra %} - {% bs_icon 'plus-circle-fill' %} + {% icon 'plus' %} {% if instances %} {% include 'search_block.html' %} @@ -24,25 +24,25 @@ @@ -52,7 +52,7 @@
{% if not instances %}
- {% bs_icon 'exclamation-triangle' %} {% trans "Warning" %}: + {% icon 'exclamation-triangle' %} {% trans "Warning" %}: {% trans "Hypervisor doesn't have any Instances" %}
@@ -64,7 +64,7 @@ {% trans 'User' %} {% trans 'Status' %} {% trans 'VCPU' %} - {% trans 'Memory' %} + {% trans 'Memory' %} {% trans 'Actions' %} @@ -87,18 +87,15 @@ - {% if instance.proxy.instance.info.0 == 1 %} - {% trans "Active" %} - {% endif %} - {% if instance.proxy.instance.info.0 == 5 %} - {% trans "Off" %} - {% endif %} - {% if instance.proxy.instance.info.0 == 3 %} - {% trans "Suspended" %} - {% endif %} + {% if instance.proxy.instance.info.0 == 1 %}{% trans "Active" %}{% endif %} + {% if instance.proxy.instance.info.0 == 5 %}{% trans "Off" %}{% endif %} + {% if instance.proxy.instance.info.0 == 3 %}{% trans "Suspended" %}{% endif %} {{ instance.proxy.instance.info.3 }} -

{% widthratio instance.proxy.instance.info.1 1024 1 %} MiB

+ {% widthratio instance.proxy.instance.info.1 1024 1 %} MiB {% include 'instance_actions.html' %} diff --git a/computes/templates/computes/list.html b/computes/templates/computes/list.html index 1a59d50..cc60e2e 100644 --- a/computes/templates/computes/list.html +++ b/computes/templates/computes/list.html @@ -2,7 +2,7 @@ {% load i18n %} {% load static %} {% load common_tags %} -{% load bootstrap_icons %} +{% load icons %} {% block title %}{% trans "Computes" %}{% endblock %} {% block content %}
@@ -16,7 +16,7 @@ {% if not computes %}
- {% bs_icon 'exclamation-triangle '%} {% trans "Warning" %}: {% trans "You don't have any computes" %} + {% icon 'exclamation-triangle '%} {% trans "Warning" %}: {% trans "You don't have any computes" %}
{% else %} @@ -45,12 +45,12 @@
{% if compute.status is True %} - {% bs_icon 'eye-fill' %} + {% icon 'eye' %} {% else %} - {% bs_icon 'eye' %} + {% icon 'eye' %} {% endif %} - {% bs_icon 'pencil-fill' %} - {% bs_icon 'x-circle-fill' %} + {% icon 'pencil' %} + {% icon 'times' %}
diff --git a/computes/templates/create_comp_block.html b/computes/templates/create_comp_block.html index 3d1b6b0..ee74bf1 100644 --- a/computes/templates/create_comp_block.html +++ b/computes/templates/create_comp_block.html @@ -1,11 +1,10 @@ {% load i18n %} {% load django_bootstrap5 %} -{% load bootstrap_icons %} - +{% load icons %}
{% trans "TCP" %} {% trans "SSH" %} {% trans "TLS" %} {% trans "Local" %} - {% bs_icon "plus-circle-fill" %} + {% icon "plus" %}
diff --git a/computes/templates/overview.html b/computes/templates/overview.html index 0837983..24c1939 100644 --- a/computes/templates/overview.html +++ b/computes/templates/overview.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load i18n %} {% load static %} -{% load bootstrap_icons %} +{% load icons %} {% block title %}{% trans "Overview" %} - {{ compute.name }}{% endblock %} @@ -12,25 +12,25 @@ @@ -96,7 +96,7 @@
- {% bs_icon 'arrow-right' %} + {% trans "CPU Utilization" %}
@@ -106,7 +106,7 @@
- {% bs_icon 'arrow-right'%} {% trans "RAM Utilization" %} + {% trans "RAM Utilization" %}
diff --git a/conf/requirements.txt b/conf/requirements.txt index 72985da..31fede1 100644 --- a/conf/requirements.txt +++ b/conf/requirements.txt @@ -1,22 +1,22 @@ Django==3.2.20 django_bootstrap5==23.3 -django-bootstrap-icons==0.8.3 django-login-required-middleware==0.9.0 django-otp==1.2.2 +django-icons==23.3 django-qr-code==3.1.1 -gunicorn==21.2.0 +gunicorn==20.1.0 libsass==0.22.0 -libvirt-python==9.6.0 +libvirt-python==9.5.0 lxml==4.9.3 qrcode==7.4.2 rwlock==0.0.7 websockify==0.10.0 -zipp==3.16.2 +zipp==3.13.0 ldap3==2.9.1 python-engineio==4.5.1 python-socketio==5.8.0 eventlet==0.33.3 djangorestframework==3.14.0 drf-nested-routers==0.93.4 -drf-yasg==1.21.7 +drf-yasg==1.21.6 markdown>=3.4.1 diff --git a/dev/requirements.txt b/dev/requirements.txt index 0ff16a8..bc65fd9 100644 --- a/dev/requirements.txt +++ b/dev/requirements.txt @@ -1,9 +1,8 @@ -r ../conf/requirements.txt -coverage==7.3.0 -django-debug-toolbar==4.2.0 -django-debug-toolbar-template-profiler -pycodestyle==2.11.0 -pyflakes==3.1.0 -pylint==2.17.5 -yapf==0.40.1 +coverage==7.2.7 +django-debug-toolbar==4.1.0 +pycodestyle==2.10.0 +pyflakes==3.0.1 +pylint==2.17.4 +yapf==0.33.0 black==23.7.0 diff --git a/dev/scss/wvc-themes/zephyr/_bootswatch.scss b/dev/scss/wvc-themes/zephyr/_bootswatch.scss index 084f7bc..497d461 100755 --- a/dev/scss/wvc-themes/zephyr/_bootswatch.scss +++ b/dev/scss/wvc-themes/zephyr/_bootswatch.scss @@ -1,14 +1 @@ -// Override importing Google APIs for inter font -$web-font-path: '' !default; - -/* inter-regular - latin */ -@font-face { - font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */ - font-family: 'Inter'; - font-style: normal; - font-weight: 400; - src: url('/static/fonts/inter-v12-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ - } - -@import "dev/scss/bootswatch/zephyr/bootswatch"; - +@import "dev/scss/bootswatch/zephyr/bootswatch"; \ No newline at end of file diff --git a/instances/models.py b/instances/models.py index 0a20031..978d118 100644 --- a/instances/models.py +++ b/instances/models.py @@ -252,7 +252,6 @@ class CreateInstance(models.Model): error_messages={"required": _("No Network pool has been choosen")}, ) nwfilter = models.CharField(max_length=256, blank=True) - net_model = models.CharField(max_length=256, blank=True) storage = models.CharField(max_length=256, blank=True) template = models.CharField(max_length=256, blank=True) images = models.CharField(max_length=256, blank=True) diff --git a/instances/templates/add_instance_network_block.html b/instances/templates/add_instance_network_block.html index c00b115..bfb374c 100644 --- a/instances/templates/add_instance_network_block.html +++ b/instances/templates/add_instance_network_block.html @@ -1,8 +1,7 @@ {% load i18n %} -{% load bootstrap_icons %} {% if request.user.is_superuser %} @@ -45,16 +44,6 @@
-
- -
- -
-