diff --git a/django_code/dashboard/templates/shutdown.html b/django_code/dashboard/templates/shutdown.html new file mode 100644 index 0000000..919eb07 --- /dev/null +++ b/django_code/dashboard/templates/shutdown.html @@ -0,0 +1,134 @@ + + + + + +Scaled down + + + + + + + + + + +
+ + + + + + + +
+ + + diff --git a/django_code/dashboard/templates/success.html b/django_code/dashboard/templates/start.html similarity index 83% rename from django_code/dashboard/templates/success.html rename to django_code/dashboard/templates/start.html index 7f76e06..80d1320 100644 --- a/django_code/dashboard/templates/success.html +++ b/django_code/dashboard/templates/start.html @@ -3,7 +3,7 @@ -Bootstrap Simple Success Confirmation Popup +Scaled up @@ -70,7 +70,7 @@ body { position: relative; top: 3px; } -.modal-confirm .icon-box:hover { +.modal-confirm .icon-box:hover,.modal-confirm .icon-box:focus { /*background: #6fb32b;*/ background: #a80505; outline: none; @@ -109,23 +109,25 @@ body { - \ No newline at end of file + diff --git a/django_code/dashboard/views.py b/django_code/dashboard/views.py index 9c1a081..5aee127 100644 --- a/django_code/dashboard/views.py +++ b/django_code/dashboard/views.py @@ -1,5 +1,6 @@ from django.shortcuts import render + def home(request): thislist = ["apple", "banana", "cherry"] return render(request, 'home.html',{'thislist': thislist}) @@ -9,4 +10,12 @@ def about(request): return render(request, 'about.html',{'thislist': thislist}) def success(request): - return render(request, 'success.html',{'deployment': 'django','url':'https://google.com'}) \ No newline at end of file + return render(request, 'start.html',{'deployment': 'django','url':'https://google.com'}) + +def scale_up(request,namespace_name,deploy_name): + baseurl = "{0}://{1}{2}".format(request.scheme, request.get_host(), request.path) + return render(request, 'start.html', {'namespace':namespace_name,'deployment': deploy_name, 'url': 'https://namespace.com','baseurl': baseurl}) + +def scale_down(request,namespace_name,deploy_name): + baseurl = "{0}://{1}{2}".format(request.scheme, request.get_host(), request.path) + return render(request, 'shutdown.html', {'namespace':namespace_name,'deployment': deploy_name, 'url': 'https://namespace.com','baseurl': baseurl}) diff --git a/django_code/django_code/urls.py b/django_code/django_code/urls.py index 858ab9e..86a8407 100644 --- a/django_code/django_code/urls.py +++ b/django_code/django_code/urls.py @@ -43,7 +43,10 @@ urlpatterns = [ path('dashboard/hello/', dashboardapp.hello), path('dashboard/view/about', dashboardview.about), path('dashboard/view/home', dashboardview.home), -path('dashboard/view/success', dashboardview.success), + path('dashboard/view/success', dashboardview.success), + path('dashboard/scale_up//', dashboardview.scale_up), + path('dashboard/scale_down//', dashboardview.scale_down), + ################## kubernetes_connection#####