Forráskód Böngészése

refactoring some code

Roberto Berto 4 éve
szülő
commit
1686e0e0cc
30 módosított fájl, 162 hozzáadás és 145 törlés
  1. 3 0
      vycontrol/accounts/templates/accounts/login.html
  2. 3 0
      vycontrol/accounts/templates/accounts/logout.html
  3. 3 0
      vycontrol/accounts/templates/accounts/lost.html
  4. 3 0
      vycontrol/accounts/templates/accounts/password_reset.html
  5. 3 0
      vycontrol/accounts/templates/accounts/password_reset_complete.html
  6. 3 0
      vycontrol/accounts/templates/accounts/password_reset_sent.html
  7. 3 0
      vycontrol/accounts/templates/accounts/password_reset_token.html
  8. 3 0
      vycontrol/accounts/templates/accounts/profile.html
  9. 3 0
      vycontrol/accounts/templates/accounts/start.html
  10. 0 1
      vycontrol/accounts/urls.py
  11. 16 28
      vycontrol/accounts/views.py
  12. 1 0
      vycontrol/dnsresolver/templates/dnsresolver/add.html
  13. 1 0
      vycontrol/dnsresolver/templates/dnsresolver/list.html
  14. 2 2
      vycontrol/dnsresolver/views.py
  15. 4 4
      vycontrol/firewall/views.py
  16. 2 2
      vycontrol/interface/views.py
  17. 2 2
      vycontrol/ntp/views.py
  18. 5 0
      vycontrol/s/main.css
  19. 3 3
      vycontrol/static/views.py
  20. 2 2
      vycontrol/vapi.py
  21. 1 1
      vycontrol/vapilib.py
  22. 5 3
      vycontrol/viewinfo.py
  23. 0 0
      vycontrol/vmsg.py
  24. 4 11
      vycontrol/vycontrol/settings/base.py
  25. 32 33
      vycontrol/vycontrol/templates/base.html
  26. 28 22
      vycontrol/vycontrol/templates/base_not_installed.html
  27. 27 19
      vycontrol/vycontrol/templates/base_not_logged.html
  28. 0 1
      vycontrol/vycontrol/templates/footer.html
  29. 0 1
      vycontrol/vycontrol/templates/header.html
  30. 0 10
      vycontrol/vycontrol/urls.py

+ 3 - 0
vycontrol/accounts/templates/accounts/login.html

@@ -2,6 +2,9 @@
 
 {% block header_title %}Login{% endblock %}
 {% block section_title %}Login{% endblock %}
+{% block username %}{{ username }}{% endblock %}
+{% block debugactive %}{{ debug }}{% endblock %}
+{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
 
 {% block debug %}
 {% endblock %}

+ 3 - 0
vycontrol/accounts/templates/accounts/logout.html

@@ -2,6 +2,9 @@
 
 {% block header_title %}Logged out{% endblock %}
 {% block section_title %}Logged out{% endblock %}
+{% block username %}{{ username }}{% endblock %}
+{% block debugactive %}{{ debug }}{% endblock %}
+{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
 
 {% block debug %}
 {% endblock %}

+ 3 - 0
vycontrol/accounts/templates/accounts/lost.html

@@ -2,6 +2,9 @@
 
 {% block header_title %}Login{% endblock %}
 {% block section_title %}Login{% endblock %}
+{% block username %}{{ username }}{% endblock %}
+{% block debugactive %}{{ debug }}{% endblock %}
+{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
 
 {% block debug %}
 {% endblock %}

+ 3 - 0
vycontrol/accounts/templates/accounts/password_reset.html

@@ -1,6 +1,9 @@
 {% extends "base_not_logged.html" %}
 {% block header_title %}Password Reset{% endblock %}
 {% block section_title %}Password Reset{% endblock %}
+{% block username %}{{ username }}{% endblock %}
+{% block debugactive %}{{ debug }}{% endblock %}
+{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
 
 {% block debug %}
 {% endblock %}

+ 3 - 0
vycontrol/accounts/templates/accounts/password_reset_complete.html

@@ -1,6 +1,9 @@
 {% extends "base_not_logged.html" %}
 {% block header_title %}Password Reset complete{% endblock %}
 {% block section_title %}Password Reset complete{% endblock %}
+{% block username %}{{ username }}{% endblock %}
+{% block debugactive %}{{ debug }}{% endblock %}
+{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
 
 {% block debug %}
 {% endblock %}

+ 3 - 0
vycontrol/accounts/templates/accounts/password_reset_sent.html

@@ -1,6 +1,9 @@
 {% extends "base_not_logged.html" %}
 {% block header_title %}Password Reset{% endblock %}
 {% block section_title %}Password Reset{% endblock %}
+{% block username %}{{ username }}{% endblock %}
+{% block debugactive %}{{ debug }}{% endblock %}
+{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
 
 {% block debug %}
 {% endblock %}

+ 3 - 0
vycontrol/accounts/templates/accounts/password_reset_token.html

@@ -1,6 +1,9 @@
 {% extends "base_not_logged.html" %}
 {% block header_title %}Change your password{% endblock %}
 {% block section_title %}Change your password{% endblock %}
+{% block username %}{{ username }}{% endblock %}
+{% block debugactive %}{{ debug }}{% endblock %}
+{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
 
 {% block debug %}
 {% endblock %}

+ 3 - 0
vycontrol/accounts/templates/accounts/profile.html

@@ -2,6 +2,9 @@
 
 {% block header_title %}Profile{% endblock %}
 {% block section_title %}Profile{% endblock %}
+{% block username %}{{ username }}{% endblock %}
+{% block debugactive %}{{ debug }}{% endblock %}
+{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
 
 {% block debug %}
 {{ user }}

+ 3 - 0
vycontrol/accounts/templates/accounts/start.html

@@ -2,6 +2,9 @@
 
 {% block header_title %}Installing{% endblock %}
 {% block section_title %}Installing{% endblock %}
+{% block username %}{{ username }}{% endblock %}
+{% block debugactive %}{{ debug }}{% endblock %}
+{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
 
 {% block debug %}
 {{ users_admin }}

+ 0 - 1
vycontrol/accounts/urls.py

@@ -21,7 +21,6 @@ app_name = 'accounts'
 
 urlpatterns = [
    path('', views.profile, name='accounts-profile'),
-   # path('', include('django.contrib.auth.urls', name='vauth-login')
 ]
 
 

+ 16 - 28
vycontrol/accounts/views.py

@@ -2,6 +2,7 @@ from django.shortcuts import render
 from django.http import HttpResponse
 from django.template import loader
 from django.shortcuts import redirect
+from django.shortcuts import render
 from django.contrib.auth import authenticate
 from django.views.generic.base import TemplateView
 from django.conf import settings
@@ -9,18 +10,16 @@ from django.urls import reverse
 
 
 from django.contrib.auth.models import User
+from config.models import Instance
 
 import vyos
-from perms import is_authenticated
 import perms
-import vycontrol_vyos_api as vapi
-from libs.vycontrol_validators import *
-import vycontrol_messages as vmsg
-
-from config.models import Instance
-
-import pprint
+import vapi
+import vmsg
+import viewinfo
 import validators
+from perms import is_authenticated
+from libs.vycontrol_validators import *
 
 
 
@@ -40,21 +39,17 @@ def index(request):
             user = User.objects.create_superuser(username=request.POST['username'], email='', password=request.POST['password'])
             user.save()
             return redirect('%s?next=%s' % (reverse('registration-login'), '/config/instance-add'))
-    template = loader.get_template('accounts/start.html')
     context = { 
-        'users_admin': users_admin.all()
+        'users_admin': users_admin.all(),
     }   
-    return HttpResponse(template.render(context, request))
+    return render(request, 'accounts/start.html', context)
 
 
 
 @is_authenticated    
 def profile(request):
-    all_instances = vyos.instance_getall_by_group(request)
-    is_superuser = perms.get_is_superuser(request.user)
-    hostname_default = vyos.get_hostname_prefered(request)
-    msg = vmsg.msg()
-
+    vinfo = viewinfo.prepare(request)
+    
     user = User.objects.get(
         username=request.user,
         is_active=True
@@ -73,17 +68,10 @@ def profile(request):
                 user.set_password(pass_new)
                 user.save()
 
-
-
-    template = loader.get_template('accounts/profile.html')
-    context = { 
-        'instances':            all_instances,
-        'hostname_default':     hostname_default,
-        'username':             request.user,      
-        'is_superuser':         is_superuser, 
-        'msg':                  msg.get_all(),
+    context = viewinfo.context(vinfo)    
+    localcontext = {
         'user':                 user,
+    }
+    context.update(localcontext)
 
-
-    }   
-    return HttpResponse(template.render(context, request))
+    return render(request, 'accounts/profile.html', context)

+ 1 - 0
vycontrol/dnsresolver/templates/dnsresolver/add.html

@@ -4,6 +4,7 @@
 {% block section_title %}dnsresolver{% endblock %}
 {% block username %}{{ username }}{% endblock %}
 {% block debugactive %}{{ debug }}{% endblock %}
+{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
 
 {% block debug %}
 {% endblock %}

+ 1 - 0
vycontrol/dnsresolver/templates/dnsresolver/list.html

@@ -4,6 +4,7 @@
 {% block section_title %}dnsresolver{% endblock %}
 {% block username %}{{ username }}{% endblock %}
 {% block debugactive %}{{ debug }}{% endblock %}
+{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
 
 
 {% block debug %}

+ 2 - 2
vycontrol/dnsresolver/views.py

@@ -6,8 +6,8 @@ from django.conf import settings
 from django.urls import reverse
 
 import vyos
-import vycontrol_vyos_api_lib as vapilib
-import vycontrol_vyos_api as vapi
+import vapilib
+import vapi
 
 from perms import is_authenticated
 from libs.vycontrol_filters import routeunpack

+ 4 - 4
vycontrol/firewall/views.py

@@ -8,9 +8,9 @@ from django.http import QueryDict
 
 
 import vyos
-import vycontrol_vyos_api_lib as vapilib
-import vycontrol_vyos_api as vapi
-import vycontrol_messages as vmsg
+import vapilib
+import vapi
+import vmsg
 
 from slugify import slugify
 from performance import timer
@@ -2146,4 +2146,4 @@ def firewall_zones_removerule(request, dstzone, srczone, firewall):
         'interfaces_all_names':         interfaces_all_names,
         'msg' :                         msg.get_all(),
     }   
-    return HttpResponse(template.render(context, request))
+    return HttpResponse(template.render(context, request))

+ 2 - 2
vycontrol/interface/views.py

@@ -10,9 +10,9 @@ from django.template.defaultfilters import register
 import vyos
 from perms import is_authenticated
 import perms
-import vycontrol_vyos_api as vapi
+import vapi
 from libs.vycontrol_validators import *
-import vycontrol_messages as vmsg
+import vmsg
 
 from config.models import Instance
 

+ 2 - 2
vycontrol/ntp/views.py

@@ -7,8 +7,8 @@ from django.urls import reverse
 from django.contrib.auth.decorators import login_required
 
 import vyos
-import vycontrol_vyos_api as vapi
-import vycontrol_messages as vmsg
+import vapi
+import vmsg
 import perms
 import validators
 from perms import is_authenticated

+ 5 - 0
vycontrol/s/main.css

@@ -11,6 +11,11 @@ body {
 .container {
     color: black;
 }
+
+ul.menuleft  {
+  padding-left: 16px;
+}
+
 .menu { 
     background-color: #eee;
     padding: 5px;

+ 3 - 3
vycontrol/static/views.py

@@ -6,9 +6,9 @@ from django.conf import settings
 from django.urls import reverse
 
 import vyos
-import vycontrol_messages as vmsg
-import vycontrol_vyos_api_lib as vapilib
-import vycontrol_vyos_api as vapi
+import vmsg
+import vapilib
+import vapi
 
 from perms import is_authenticated
 from libs.vycontrol_filters import routeunpack

+ 2 - 2
vycontrol/vycontrol_vyos_api.py → vycontrol/vapi.py

@@ -4,7 +4,7 @@ import pprint
 import sys
 import logging
 
-import vycontrol_vyos_api_lib as vapilib
+import vapilib
 import perms
 
 
@@ -716,4 +716,4 @@ def set_interface(hostname, interface_type, interface_name, vif=None):
             cmd =       ["interfaces", interface_type, interface_name, "vif", vif],
             description = "set_interface_dhcp",
         )
-    return v   
+    return v   

+ 1 - 1
vycontrol/vycontrol_vyos_api_lib.py → vycontrol/vapilib.py

@@ -11,7 +11,7 @@ from django.contrib.auth.models import Group
 from django.contrib.auth.models import User
 
 import perms
-from vycontrol_messages import log
+from vmsg import log
 
 class vyapi:
     error =     None

+ 5 - 3
vycontrol/viewinfo.py

@@ -1,6 +1,6 @@
 import vyos
 import perms
-import vycontrol_messages as vmsg
+import vmsg
 from django.conf import settings
 
 class prepareClass:
@@ -20,6 +20,7 @@ def prepare(request):
     p.request = request
     p.msg = vmsg.msg()
     p.debug = settings.DEBUG
+    p.vycontrol_credits = settings.VYCONTROL_CREDITS
 
     return p
 
@@ -31,6 +32,7 @@ def context(prepare):
         'username':                                 prepare.request.user,   
         'msg' :                                     prepare.msg.get_all(),
         'debugactive' :                             prepare.debug,
-                       
+        'vycontrol_credits' :                       prepare.vycontrol_credits,
+                               
     }
-    return contextPrepare
+    return contextPrepare

+ 0 - 0
vycontrol/vycontrol_messages.py → vycontrol/vmsg.py


+ 4 - 11
vycontrol/vycontrol/settings/base.py

@@ -41,17 +41,6 @@ INSTALLED_APPS = [
     'ntp.apps.NtpConfig',
     'dnsresolver.apps.DnsresolverConfig',
 
-    #'arp.apps.ArpConfig',
-    #'bgp.apps.BgpConfig',
-    #'dhcp.apps.DhcpConfig',
-    #'ipsec.apps.IpsecConfig',
-    #'nat.apps.NatConfig',
-    #'qos.apps.QosConfig',
-    #'openvpn.apps.OpenvpnConfig',
-    #'ospf.apps.OspfConfig',
-    #'ssh.apps.SshConfig',
-    #'wanlb.apps.WanlbConfig',
-
     'django.contrib.auth',
     'django.contrib.admin',
 ]
@@ -166,3 +155,7 @@ STATICFILES_DIRS = [
     BASE_DIR + '/s/'
 ]
 STATIC_URL = '/s/'
+
+
+# show footer link to VyControl
+VYCONTROL_CREDITS = True

+ 32 - 33
vycontrol/vycontrol/templates/base.html

@@ -2,26 +2,27 @@
 <!doctype html>
 <html lang="en">
   <head>
-    <!-- Required meta tags -->
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
-
-
-    <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> 
-
-    <!-- Bootstrap CSS -->
-    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
-    <link rel="stylesheet" href="{% static "main.css" %}?{% random_int 100000 500000 %} ">
-    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
-
-    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
-    <script src="{% static "vycontrol.js" %}?{% random_int 100000 500000 %} "></script>
-
-    <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
-
-    
-    <title>{% block header_title %}{% endblock %} - VyControl</title>
+  <title>{% block header_title %}{% endblock %} - VyControl</title>
+  <meta charset="utf-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+  <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
+  <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> 
+  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" 
+  integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" 
+  crossorigin="anonymous">
+  <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css"
+  integrity="sha256-+bdRwc0NKw+Rhi25h/7Z3aSHWLFeb0LKZ3lrRfSyFwI=" 
+  crossorigin="anonymous">    
+  <script
+  src="https://code.jquery.com/jquery-3.6.0.min.js"
+  integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
+  crossorigin="anonymous"></script>
+  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" 
+  integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" 
+  crossorigin="anonymous"></script>
+
+  <link rel="stylesheet" href="{% static "main.css" %}?{% random_int 100000 500000 %} ">
+  <script src="{% static "vycontrol.js" %}?{% random_int 100000 500000 %} "></script>  
   </head>
   <body >
 
@@ -49,8 +50,7 @@
               </select>
             
 
-              <span id="menu-username"><a href="{%  url 'accounts:accounts-profile' %}"><i class="material-icons" id="icon-username">person</i>
-              {% block username %}{% endblock %}</a></span> <span id="vycontrol-config-menu"> <a href="{% url 'accounts-logout' %}">Logout</a></span>
+              <span id="menu-username"><a href="{%  url 'accounts:accounts-profile' %}"><i class="material-icons" id="icon-username">person</i>{% block username %}{% endblock %}</a></span> <span id="vycontrol-config-menu"> <a href="{% url 'accounts-logout' %}">Logout</a></span>
 
 
           </p>
@@ -70,7 +70,7 @@
 
     <h2>Router</h2>
 
-    <ul>
+    <ul class="menuleft">
     <li><a href="{% url 'interface:interface-list' %}">Interfaces</a></li>
     <li><a href="{% url 'firewall:firewall-list' %}">Firewall</a></li>
     <li><a href="{% url 'static:static-list' %}">Static Routes</a></li>
@@ -81,14 +81,14 @@
  
     {% if is_superuser %}
     <h2>VyControl Administrator</h2>
-    <ul>
+    <ul class="menuleft">
     <li><a href="{% url 'config:instances' %}">Instances</a></li>
     <li><a href="{% url 'config:users-list' %}">Users</a></li>
     <li><a href="{% url 'config:groups-list' %}">Groups</a></li>
     </ul>
     {% else %}
     <h2>VyControl</h2>
-    <ul>
+    <ul class="menuleft">
     <li><a href="{% url 'config:instances' %}">Instances</a></li>
     </ul>
     {% endif %}
@@ -130,15 +130,14 @@
 </div>
 {% endif %}
 
+{% if creditsactive %}
 <hr>
 <div class="container" id="credits">
-  <a href="https://vycontrol.com/">VyControl VyOS FrontEnd</a>
-</div></hr>
-
-    <!-- Optional JavaScript -->
-    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
-    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
-    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
-  </body>
+  <a href="https://vycontrol.com/">VyControl</a>
+</div>
+{% endif %}
+
+<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
+</body>
 </html>
 

+ 28 - 22
vycontrol/vycontrol/templates/base_not_installed.html

@@ -2,20 +2,28 @@
 <!doctype html>
 <html lang="en">
   <head>
-    <!-- Required meta tags -->
+    <title>{% block header_title %}{% endblock %} - VyControl</title>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-
-    <!-- Bootstrap CSS -->
-    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
+    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
+    <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> 
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" 
+    integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" 
+    crossorigin="anonymous">
+    <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css"
+    integrity="sha256-+bdRwc0NKw+Rhi25h/7Z3aSHWLFeb0LKZ3lrRfSyFwI=" 
+    crossorigin="anonymous">    
+    <script
+    src="https://code.jquery.com/jquery-3.6.0.min.js"
+    integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
+    crossorigin="anonymous"></script>
+    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" 
+    integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" 
+    crossorigin="anonymous"></script>
+  
     <link rel="stylesheet" href="{% static "main.css" %}?{% random_int 100000 500000 %} ">
-
-    <title>{% block header_title %}{% endblock %} - VyControl</title>
-
-    <style>
-    
-    </style>
-  </head>
+    <script src="{% static "vycontrol.js" %}?{% random_int 100000 500000 %} "></script>  
+    </head>
   <body >
     
     
@@ -59,24 +67,22 @@
 </div>
 
 
+{% if debugactive == True %}
 <div class="container" id="debug">
   <h3>Debug</h3>
   <pre>
   {% block debug %}{% endblock %}
 </pre>
 </div>
+{% endif %}
 
+{% if creditsactive %}
 <hr>
 <div class="container" id="credits">
-  <a href="https://vycontrol.com/">VyControl VyOS FrontEnd</a>
-</div></hr>
-
-
-    <!-- Optional JavaScript -->
-    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
-    <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
-    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
-    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
-  </body>
-</html>
+  <a href="https://vycontrol.com/">VyControl</a>
+</div>
+{% endif %}
 
+<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
+</body>
+</html>

+ 27 - 19
vycontrol/vycontrol/templates/base_not_logged.html

@@ -2,20 +2,28 @@
 <!doctype html>
 <html lang="en">
   <head>
-    <!-- Required meta tags -->
+    <title>{% block header_title %}{% endblock %} - VyControl</title>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-
-    <!-- Bootstrap CSS -->
-    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
+    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
+    <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> 
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" 
+    integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" 
+    crossorigin="anonymous">
+    <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css"
+    integrity="sha256-+bdRwc0NKw+Rhi25h/7Z3aSHWLFeb0LKZ3lrRfSyFwI=" 
+    crossorigin="anonymous">    
+    <script
+    src="https://code.jquery.com/jquery-3.6.0.min.js"
+    integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
+    crossorigin="anonymous"></script>
+    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" 
+    integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" 
+    crossorigin="anonymous"></script>
+  
     <link rel="stylesheet" href="{% static "main.css" %}?{% random_int 100000 500000 %} ">
-
-    <title>{% block header_title %}{% endblock %} - VyControl</title>
-
-    <style>
-    
-    </style>
-  </head>
+    <script src="{% static "vycontrol.js" %}?{% random_int 100000 500000 %} "></script>  
+    </head>
   <body >
     
     
@@ -60,24 +68,24 @@
 </div>
 
 
+{% if debugactive == True %}
 <div class="container" id="debug">
   <h3>Debug</h3>
   <pre>
   {% block debug %}{% endblock %}
 </pre>
 </div>
+{% endif %}
 
+{% if creditsactive %}
 <hr>
 <div class="container" id="credits">
-  <a href="https://vycontrol.com/">VyControl VyOS FrontEnd</a>
-</div></hr>
+  <a href="https://vycontrol.com/">VyControl</a>
+</div>
+{% endif %}
 
 
-    <!-- Optional JavaScript -->
-    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
-    <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
-    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
-    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
-  </body>
+<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
+</body>
 </html>
 

+ 0 - 1
vycontrol/vycontrol/templates/footer.html

@@ -1 +0,0 @@
-foo

+ 0 - 1
vycontrol/vycontrol/templates/header.html

@@ -1 +0,0 @@
-header

+ 0 - 10
vycontrol/vycontrol/urls.py

@@ -49,14 +49,4 @@ urlpatterns = [
     path('firewall/', include('firewall.urls')),
     path('ntp/', include('ntp.urls')),
     path('dnsresolver/', include('dnsresolver.urls')),
-    #path('ipsec/', include('ipsec.urls')),
-    #path('nat/', include('nat.urls')),
-    #path('openvpn/', include('openvpn.urls')),
-    #path('ospf/', include('ospf.urls')),
-    #path('qos/', include('qos.urls')),
-    #path('ssh/', include('ssh.urls')),  
-    #path('arp/', include('arp.urls')),
-    #path('bgp/', include('bgp.urls')),
-    #path('dhcp/', include('dhcp.urls')),
-    #path('wanlb/', include('wanlb.urls')),
 ]