This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
from django.apps import AppConfig
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render
|
||||
from django.shortcuts import redirect
|
||||
import time
|
||||
import random
|
||||
|
||||
def hello(request):
|
||||
return HttpResponse('<h1>Hello dashboard h1>')
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{% block title %}{% endblock %}</title>
|
||||
{% load bootstrap5 %}
|
||||
{% bootstrap_css %}
|
||||
{% bootstrap_javascript %}
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 class="display-1">Welcome to my website!</h1>
|
||||
|
||||
<div class="container">
|
||||
<div class="list-group">
|
||||
{% if thislist %}
|
||||
<ul>
|
||||
{% for question in thislist %}
|
||||
<a href="#" class="list-group-item">{{ question }}</a>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>No polls are available.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>My Website</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to my website!</h1>
|
||||
{% if thislist %}
|
||||
<ul>
|
||||
{% for question in thislist %}
|
||||
<h1>{{ question }}</h1>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>No polls are available.</p>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,134 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>Scaled down</title>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Varela Round', sans-serif;
|
||||
}
|
||||
.modal-confirm {
|
||||
color: #636363;
|
||||
width: 325px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.modal-confirm .modal-content {
|
||||
padding: 20px;
|
||||
border-radius: 5px;
|
||||
border: none;
|
||||
}
|
||||
.modal-confirm .modal-header {
|
||||
border-bottom: none;
|
||||
position: relative;
|
||||
}
|
||||
.modal-confirm h4 {
|
||||
text-align: center;
|
||||
font-size: 26px;
|
||||
margin: 30px 0 -15px;
|
||||
}
|
||||
.modal-confirm .form-control, .modal-confirm .btn {
|
||||
min-height: 40px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.modal-confirm .close {
|
||||
position: absolute;
|
||||
top: -5px;
|
||||
right: -5px;
|
||||
}
|
||||
.modal-confirm .modal-footer {
|
||||
border: none;
|
||||
text-align: center;
|
||||
border-radius: 5px;
|
||||
font-size: 13px;
|
||||
}
|
||||
.modal-confirm .icon-box {
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
margin: 0 auto;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: -70px;
|
||||
width: 105px;
|
||||
height: 105px;
|
||||
border-radius: 50%;
|
||||
z-index: 9;
|
||||
/*background: #82ce34;*/
|
||||
background: #a80505;
|
||||
padding: 15px;
|
||||
text-align: center;
|
||||
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.modal-confirm .icon-box i {
|
||||
font-size: 58px;
|
||||
position: relative;
|
||||
top: 0px;
|
||||
}
|
||||
.modal-confirm .icon-box:hover,.modal-confirm .icon-box:focus {
|
||||
background: #6fb32b;
|
||||
/*background: #a80505;*/
|
||||
outline: none;
|
||||
}
|
||||
.modal-confirm.modal-dialog {
|
||||
margin-top: 80px;
|
||||
}
|
||||
.modal-confirm .btn {
|
||||
color: #fff;
|
||||
border-radius: 4px;
|
||||
/*background: #82ce34;*/
|
||||
background: #a80505;
|
||||
text-decoration: none;
|
||||
transition: all 0.4s;
|
||||
line-height: normal;
|
||||
border: none;
|
||||
}
|
||||
.modal-confirm .btn:hover, .modal-confirm .btn:focus {
|
||||
background: #800404;
|
||||
/*background: #a80505;*/
|
||||
outline: none;
|
||||
}
|
||||
.trigger-btn {
|
||||
display: inline-block;
|
||||
margin: 100px auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="text-center">
|
||||
<!-- Button HTML (to Trigger Modal) -->
|
||||
<!--<a href="#myModal" class="trigger-btn" data-toggle="modal">Click to Open Confirm Modal</a> -->
|
||||
|
||||
|
||||
<!-- Modal HTML -->
|
||||
<!--<div id="myModal" class="modal fade">-->
|
||||
<div class="modal-dialog modal-confirm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<div class="icon-box" onclick="window.location='/kubernetes_connection/scale_up/{{namespace}}/{{deployment}}';">
|
||||
<!--<i class="material-icons"></i>-->
|
||||
<i class="material-icons">×</i>
|
||||
</div>
|
||||
<h4 class="modal-title w-100">Too bad!</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p class="text-center">{{ deployment }} deployment from namespace {{ namespace }} is now scaled down.</p>
|
||||
<p class="text-center">Current URL {{ url }}.</p>
|
||||
<p class="text-center">base URL {{ baseurl }}.</p>
|
||||
</div>
|
||||
<div href={{ url }} class="modal-footer">
|
||||
<!--<button href={{ url }} class="btn btn-success btn-block" data-dismiss="modal">Redirect</button>-->
|
||||
<a href="https://google.fr" class="btn btn-success btn-block" data-dismiss="modal">Redirect</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,133 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>Scaled up</title>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Varela Round', sans-serif;
|
||||
}
|
||||
.modal-confirm {
|
||||
color: #636363;
|
||||
width: 325px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.modal-confirm .modal-content {
|
||||
padding: 20px;
|
||||
border-radius: 5px;
|
||||
border: none;
|
||||
}
|
||||
.modal-confirm .modal-header {
|
||||
border-bottom: none;
|
||||
position: relative;
|
||||
}
|
||||
.modal-confirm h4 {
|
||||
text-align: center;
|
||||
font-size: 26px;
|
||||
margin: 30px 0 -15px;
|
||||
}
|
||||
.modal-confirm .form-control, .modal-confirm .btn {
|
||||
min-height: 40px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.modal-confirm .close {
|
||||
position: absolute;
|
||||
top: -5px;
|
||||
right: -5px;
|
||||
}
|
||||
.modal-confirm .modal-footer {
|
||||
border: none;
|
||||
text-align: center;
|
||||
border-radius: 5px;
|
||||
font-size: 13px;
|
||||
}
|
||||
.modal-confirm .icon-box {
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
margin: 0 auto;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: -70px;
|
||||
width: 95px;
|
||||
height: 95px;
|
||||
border-radius: 50%;
|
||||
z-index: 9;
|
||||
background: #82ce34;
|
||||
padding: 15px;
|
||||
text-align: center;
|
||||
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.modal-confirm .icon-box i {
|
||||
font-size: 58px;
|
||||
position: relative;
|
||||
top: 3px;
|
||||
}
|
||||
.modal-confirm .icon-box:hover,.modal-confirm .icon-box:focus {
|
||||
/*background: #6fb32b;*/
|
||||
background: #a80505;
|
||||
outline: none;
|
||||
}
|
||||
.modal-confirm.modal-dialog {
|
||||
margin-top: 80px;
|
||||
}
|
||||
.modal-confirm .btn {
|
||||
color: #fff;
|
||||
border-radius: 4px;
|
||||
background: #82ce34;
|
||||
text-decoration: none;
|
||||
transition: all 0.4s;
|
||||
line-height: normal;
|
||||
border: none;
|
||||
}
|
||||
.modal-confirm .btn:hover, .modal-confirm .btn:focus {
|
||||
background: #6fb32b;
|
||||
/*background: #a80505;*/
|
||||
outline: none;
|
||||
}
|
||||
.trigger-btn {
|
||||
display: inline-block;
|
||||
margin: 100px auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="text-center">
|
||||
<!-- Button HTML (to Trigger Modal) -->
|
||||
<!--<a href="#myModal" class="trigger-btn" data-toggle="modal">Click to Open Confirm Modal</a> -->
|
||||
|
||||
|
||||
<!-- Modal HTML -->
|
||||
<!--<div id="myModal" class="modal fade">-->
|
||||
<div class="modal-dialog modal-confirm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<div class="icon-box" onclick="window.location='/kubernetes_connection/scale_down/{{namespace}}/{{deployment}}';">
|
||||
<!--<i class="material-icons"></i>-->
|
||||
<i class="material-icons"></i>
|
||||
</div>
|
||||
<h4 class="modal-title w-100">Awesome!</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p class="text-center">{{ deployment }} deployment from namespace {{ namespace }} is now scaled up.</p>
|
||||
<p class="text-center">Current URL {{ url }}.</p>
|
||||
<p class="text-center">base URL {{ baseurl }}.</p>
|
||||
</div>
|
||||
<div href={{ url }} class="modal-footer">
|
||||
<!--<button href={{ url }} class="btn btn-success btn-block" data-dismiss="modal">Redirect</button>-->
|
||||
|
||||
<a href="https://google.fr" class="btn btn-success btn-block" data-dismiss="modal">Redirect</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,21 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
|
||||
def home(request):
|
||||
thislist = ["apple", "banana", "cherry"]
|
||||
return render(request, 'home.html',{'thislist': thislist})
|
||||
|
||||
def about(request):
|
||||
thislist = ["apple", "banana", "cherry"]
|
||||
return render(request, 'about.html',{'thislist': thislist})
|
||||
|
||||
def success(request):
|
||||
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})
|
||||
Reference in New Issue
Block a user