Add Project Files

This commit is contained in:
2022-06-20 13:41:51 +03:00
parent a5aecd6dda
commit 09e209b988
24 changed files with 388 additions and 51 deletions

10
templates/add_host.html Normal file
View File

@@ -0,0 +1,10 @@
{% extends 'base.html' %}
{% block content %}
<div>
<form action="" method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Submit">
</form>
</div>
{% endblock %}

14
templates/base.html Normal file
View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>HighTower</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<body>
<div class="container my-2">
{% block content %}{% endblock %}
</div>
</body>
</html>

25
templates/host_info.html Normal file
View File

@@ -0,0 +1,25 @@
{% extends 'base.html' %}
{% block content %}
<h1 class="mb-2">{{ host.host_name }}:{{ host.port }}</h1>
<div class="row">
<div class="col-lg-8">
<table class="table table-responsive table-borderless">
<tr>
<td>Статус</td>
<td>
{% if host.status == True %}
<strong style="color:darkgreen">ON</strong>
{% else %}
<strong style="color:red">OFF</strong>
{% endif %}
</td>
</tr>
<tr>
<td>Обновлен</td>
<td>{{ host.updated|date:"d.m.Y." }}</td>
</tr>
</table>
</div>
<div class="col-lg-4"></div>
</div>
{% endblock %}

25
templates/index.html Normal file
View File

@@ -0,0 +1,25 @@
{% extends 'base.html' %}
{% block content %}
<table class="table">
<tr>
<th>Хост</th>
<th>Порт</th>
<th>Статус</th>
<th>Изменен</th>
</tr>
{% for obj in object_list %}
<tr>
<td><a href="{% url 'host-info' pk=obj.pk %}">{{ obj.host_name }}</a></td>
<td>{{ obj.port }}</td>
<td>
{% if obj.status == True %}
<strong style="color:darkgreen">ON</strong>
{% else %}
<strong style="color:red">OFF</strong>
{% endif %}
</td>
<td>{{ obj.updated|date:"d.m.Y." }}</td>
</tr>
{% endfor %}
</table>
{% endblock %}