fix nginx conf + improve ui
This commit is contained in:
+17
-22
@@ -1,26 +1,21 @@
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{% block title %}Mumui{% endblock %}</title>
|
||||
{% block headscript %}{% endblock %}
|
||||
<link href="{% static 'deployment/css/bootstrap.min.css' %}" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{% block title %}mumui{% endblock %}</title>
|
||||
{% block headscript %}{% endblock %}
|
||||
</head>
|
||||
|
||||
<body {% block bodyattr %}{% endblock %}>
|
||||
<main>
|
||||
{% if user.is_authenticated or "login" in request.path %}
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
{% if user.is_authenticated %}
|
||||
<p><a href="{% url 'logout' %}">log out</a></p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p>You are not logged in</p>
|
||||
<a href="{% url 'login' %}">log In</a>
|
||||
{% endif %}
|
||||
</main>
|
||||
{% block script %}{% endblock %}
|
||||
</body>
|
||||
|
||||
<body {% block bodyattr %}{% endblock %}>
|
||||
{% include 'header.html' %}
|
||||
<div class="container-md">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
<script src="{% static 'deployment/js/bootstrap.bundle.min.js' %}" /></script>
|
||||
{% block script %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,76 +2,70 @@
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% block title %} deployment's board {% endblock %}
|
||||
{% block title %} Deployments board {% endblock %}
|
||||
|
||||
{% block headscript %}
|
||||
<script src="{% static 'django_eventstream/json2.js' %}"></script>
|
||||
<script src="{% static 'django_eventstream/eventsource.min.js' %}"></script>
|
||||
<script src="{% static 'django_eventstream/reconnecting-eventsource.js' %}"></script>
|
||||
<script src="{% static 'django_eventstream/json2.js' %}"></script>
|
||||
<script src="{% static 'django_eventstream/eventsource.min.js' %}"></script>
|
||||
<script src="{% static 'django_eventstream/reconnecting-eventsource.js' %}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block bodyattr %}
|
||||
onload="start('{{ url|safe }}');"
|
||||
onload="start('{{ url|safe }}');"
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ user.username }}'s board
|
||||
{% if page_obj %}
|
||||
<table>
|
||||
<tr>
|
||||
<th>name</th>
|
||||
<th>type</th>
|
||||
<th>status</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
{% for deployment in page_obj %}
|
||||
<tr id="{{ deployment.id }}">
|
||||
<th name="name">{{ deployment.name }}</th>
|
||||
<th name="type">{{ deployment.type }}</th>
|
||||
<th name="status">{{ deployment.status }}</th>
|
||||
<th>
|
||||
<a href="{% url 'deployment-details' deployment.id %}">
|
||||
<button>details</button>
|
||||
</a>
|
||||
</th>
|
||||
{% if deployment.status == "FAILED" or deployment.status == "READY" %}
|
||||
<th name="deploy">
|
||||
<form action="{% url 'deployment-launch' deployment.id %}?page={{ page_obj.number }}" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="submit" value="deploy">
|
||||
</form>
|
||||
</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<div class="pagination">
|
||||
<span class="step-links">
|
||||
{% if page_obj.has_previous %}
|
||||
<a href="?page=1">« first</a>
|
||||
<a href="?page={{ page_obj.previous_page_number }}">previous</a>
|
||||
{% endif %}
|
||||
|
||||
<span class="current">
|
||||
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
|
||||
</span>
|
||||
|
||||
{% if page_obj.has_next %}
|
||||
<a href="?page={{ page_obj.next_page_number }}">next</a>
|
||||
<a href="?page={{ page_obj.paginator.num_pages }}">last »</a>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
{% else %}
|
||||
<p>no deployments available</p>
|
||||
{% endif %}
|
||||
<a href="/deployment/create">
|
||||
<button>create</button>
|
||||
</a>
|
||||
{% if user.is_authenticated %}
|
||||
<table class="table table-striped table-hover">
|
||||
<tr>
|
||||
<th scope="col-3">Name</th>
|
||||
<th scope="col-3">Type</th>
|
||||
<th scope="col-3">Status</th>
|
||||
<th class="col-1"></th>
|
||||
<th class="col-2"></th>
|
||||
</tr>
|
||||
{% for deployment in page_obj %}
|
||||
<tr id="{{ deployment.id }}">
|
||||
<th name="name">{{ deployment.name }}</th>
|
||||
<th name="type">{{ deployment.type }}</th>
|
||||
<th name="status">{{ deployment.status }}</th>
|
||||
<th>
|
||||
<a href="{% url 'deployment-details' deployment.id %}">
|
||||
<button class="btn btn-primary">Details</button>
|
||||
</a>
|
||||
</th>
|
||||
{% if deployment.status == "FAILED" or deployment.status == "READY" %}
|
||||
<th name="deploy">
|
||||
<form action="{% url 'deployment-launch' deployment.id %}?page={{ page_obj.number }}" method="post">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-success" type="submit">Deploy</button>
|
||||
</form>
|
||||
</th>
|
||||
{% elif deployment.status == "RUNNING" %}
|
||||
<th name="deploy">
|
||||
<button class="btn btn-primary" type="button" disabled>
|
||||
<span class="spinner-border spinner-border-sm" aria-hidden="true"></span>
|
||||
<span role="status">Deploy</span>
|
||||
</button>
|
||||
</th>
|
||||
{% else %}
|
||||
<th></th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% include 'pagination.html' %}
|
||||
<a class="btn btn-success" href="{% url 'deployment-create' %}" role="button">Create</a>
|
||||
{% else %}
|
||||
<div class="row justify-content-md-center">
|
||||
<div class="col-lg-8 col-md-8 col-sm-6">
|
||||
<h4 style="text-align: center;">Please log in !</h4>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
<script src="{% static 'deployment/js/event_source.js' %}" />
|
||||
</script>
|
||||
<script src="{% static 'deployment/js/event_source.js' %}" />
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,12 +1,20 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %} new deployment {% endblock %}
|
||||
{% block title %} New deployment {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ user.username }}'s new deployment
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<input type="submit" value="create">
|
||||
</form>
|
||||
{% if user.is_authenticated %}
|
||||
{{ user.username }}'s new deployment
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<input type="submit" value="create">
|
||||
</form>
|
||||
{% else %}
|
||||
<div class="row justify-content-md-center">
|
||||
<div class="col-lg-8 col-md-8 col-sm-6">
|
||||
<h4 style="text-align: center;">Please log in !</h4>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -1,24 +1,32 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %} deployment details: {{ deployment.name }} {% endblock %}
|
||||
{% block title %} Deployment details: {{ deployment.name }} {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<table>
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th>name</th>
|
||||
<th>type</th>
|
||||
<th>status</th>
|
||||
</tr>
|
||||
<tr id="{{ deployment.id }}">
|
||||
<th name="id">{{ deployment.id }}</th>
|
||||
<th name="name">{{ deployment.name }}</th>
|
||||
<th name="type">{{ deployment.type }}</th>
|
||||
<th name="status">{{ deployment.status }}</th>
|
||||
</tr>
|
||||
</table>
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="submit" value="delete">
|
||||
</form>
|
||||
{% if user.is_authenticated %}
|
||||
<table>
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th>name</th>
|
||||
<th>type</th>
|
||||
<th>status</th>
|
||||
</tr>
|
||||
<tr id="{{ deployment.id }}">
|
||||
<th name="id">{{ deployment.id }}</th>
|
||||
<th name="name">{{ deployment.name }}</th>
|
||||
<th name="type">{{ deployment.type }}</th>
|
||||
<th name="status">{{ deployment.status }}</th>
|
||||
</tr>
|
||||
</table>
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="submit" value="delete">
|
||||
</form>
|
||||
{% else %}
|
||||
<div class="row justify-content-md-center">
|
||||
<div class="col-lg-8 col-md-8 col-sm-6">
|
||||
<h4 style="text-align: center;">Please log in !</h4>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,23 @@
|
||||
<div class="container-fluid">
|
||||
<header
|
||||
class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between py-3 mb-4 border-bottom">
|
||||
<div class="col-md-3 mb-2 mb-md-0">
|
||||
<a href="/" class="d-inline-flex link-body-emphasis text-decoration-none">
|
||||
Mumui
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
|
||||
<li><a href="{% url 'deployment' %}" class="nav-link px-2">Deployments</a></li>
|
||||
<li><a href="#" class="nav-link px-2">About</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="col-md-3 text-end">
|
||||
{% if user.is_authenticated %}
|
||||
<a href="{% url 'logout' %}"><button type="button" class="btn btn-outline-danger me-2">Logout</button></a>
|
||||
{% else %}
|
||||
<a href="{% url 'login' %}"><button type="button" class="btn btn-outline-primary me-2">Login</button></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
+22
-5
@@ -1,10 +1,27 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}home{% endblock %}
|
||||
{% block title %}Home{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
Hi {{ user.username }}!
|
||||
<ul>
|
||||
<li><a href="{% url 'deployment' %}">deployments</a></li>
|
||||
</ul>
|
||||
{% if user.is_authenticated %}
|
||||
<div class="row justify-content-md-center">
|
||||
<div class="col-lg-4 col-md-8 col-sm-8">
|
||||
<h2 style="text-align: center;">Hi {{ user.username }} ! How are you ?</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-md-center">
|
||||
<div class="col-lg-6 col-md-8 col-sm-8">
|
||||
<div style="text-align: center;">Forget, i don't care... Please go on
|
||||
<a href="/deployment/">Deployments</a>
|
||||
and enjoy the life !
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="row justify-content-md-center">
|
||||
<div class="col-lg-6 col-md-8 col-sm-8">
|
||||
<h4 style="text-align: center;">Please log in !</h4>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
<nav aria-label="pagination">
|
||||
<ul class="pagination justify-content-center">
|
||||
{% if page_obj.has_previous %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page={{ page_obj.previous_page_number }}">Previous</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="page-item disabled">
|
||||
<a class="page-link">Previous</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% for page in range_pages %}
|
||||
{% if page == page_obj.number %}
|
||||
<li class="page-item active">
|
||||
<a class="page-link" href="?page={{ page }}">{{ page }}</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page={{ page }}">{{ page }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if page_obj.has_next %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page={{ page_obj.next_page_number }}">Next</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="page-item disabled">
|
||||
<a class="page-link">Next</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
@@ -1,17 +1,27 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %} login {% endblock %}
|
||||
{% block title %} Login {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if not user.is_authenticated %}
|
||||
<h2>log in</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.username.label_tag }} {{ form.username }}
|
||||
{{ form.password.label_tag }} {{ form.password }}
|
||||
<button type="submit">log in</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<div>you're already log in !</div>
|
||||
{% endif %}
|
||||
<div class="row justify-content-md-center">
|
||||
<div class="col-lg-4 col-md-4 col-sm-6">
|
||||
{% if not user.is_authenticated %}
|
||||
<h2>Log in</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<div class="mb-3">
|
||||
<label for="id_username" class="form-label">Username</label>
|
||||
<input type="username" class="form-control" id="id_username" name="username" required="">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="id_password" class="form-label">Password</label>
|
||||
<input type="password" id="id_password" name="password" class="form-control" required="">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success">Log in</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<h4 style="text-align: center;">You're already log in !</h4>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user