2023-11-18 15:35:30 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
2023-11-18 22:17:05 +00:00
|
|
|
{% block title %}Overview{% endblock %}
|
2023-11-18 15:35:30 +00:00
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<main>
|
2023-11-21 00:36:42 +00:00
|
|
|
<section class="system-info">
|
|
|
|
<article>
|
2023-11-23 00:38:39 +00:00
|
|
|
<table class="full-width">
|
2023-11-21 00:36:42 +00:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<th>Hostname</th>
|
|
|
|
<td colspan="2">
|
|
|
|
{{ system.host_name }}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>OS info</th>
|
|
|
|
<td colspan="2">
|
|
|
|
{{ system.name }} {{ system.os_version }} (kernel {{
|
|
|
|
system.kernel_version }})
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Load Avg</th>
|
|
|
|
<td colspan="2">
|
|
|
|
{{ system.load_average.0 }},
|
|
|
|
{{ system.load_average.1 }},
|
|
|
|
{{ system.load_average.2 }}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Memory</th>
|
|
|
|
<td>
|
|
|
|
{{ system.used_memory|filesizeformat }}
|
|
|
|
/ {{ system.total_memory|filesizeformat }}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<progress id="memory" value="{{system.used_memory}}"
|
|
|
|
max="{{system.total_memory}}">
|
|
|
|
{{
|
|
|
|
"{:.2}"|format(system.used_memory/system.total_memory*100)
|
|
|
|
}}%
|
|
|
|
</progress>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
</article>
|
|
|
|
<article>
|
2023-11-23 00:38:39 +00:00
|
|
|
<table class="full-width">
|
2023-11-21 00:36:42 +00:00
|
|
|
<tbody>
|
|
|
|
|
|
|
|
{% for disk in system.disks %}
|
|
|
|
<tr>
|
|
|
|
<th title="{{disk.device_name}}">{{disk.mount_point}}</th>
|
|
|
|
<td>
|
|
|
|
{{ (disk.total_space-disk.available_space)|filesizeformat }}
|
|
|
|
/ {{ disk.total_space|filesizeformat }}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<progress id="disk-{{disk.device_name}}"
|
|
|
|
value="{{disk.total_space-disk.available_space}}"
|
|
|
|
max="{{disk.total_space}}">
|
|
|
|
</progress>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</article>
|
|
|
|
</section>
|
|
|
|
<section class="stack-list">
|
2023-11-23 00:38:39 +00:00
|
|
|
<h2>Stacks <form action="/stack/_/new"><button>+</button></form>
|
|
|
|
</h2>
|
2023-11-22 09:59:51 +00:00
|
|
|
<table class="table full-width">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th colspan="2">Name</th>
|
|
|
|
<th>Service status</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for stack in info.stacks %}
|
|
|
|
<tr>
|
|
|
|
<td class="status {% if stack.active %}active{% endif %}"></td>
|
|
|
|
<td>
|
|
|
|
<a href="/stack/{{stack.name}}/">
|
|
|
|
{{stack.name}}
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{% let (running, stopped) = stack.stats() %}
|
|
|
|
{% if running > 0 %}
|
|
|
|
<span class="count running"
|
|
|
|
title="{{running}} running">{{running}}</span>
|
|
|
|
{% endif %}
|
|
|
|
{% if stopped > 0 %}
|
|
|
|
<span class="count stopped"
|
|
|
|
title="{{stopped}} stopped">{{stopped}}</span>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2023-11-21 00:36:42 +00:00
|
|
|
</section>
|
|
|
|
<section class="container-list">
|
|
|
|
<h2>Containers</h2>
|
2023-11-22 09:59:51 +00:00
|
|
|
<table class="containers table full-width">
|
2023-11-21 00:36:42 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Stack</th>
|
|
|
|
<th>State</th>
|
|
|
|
<th>Image</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for container in info.containers %}
|
|
|
|
<tr>
|
|
|
|
<td><a href="/container/{{container.name}}/">{{container.name}}</a></td>
|
|
|
|
<td>{{container.stack().unwrap_or_default()}}</td>
|
|
|
|
<td class="status {{container.state}}">{{container.state}}</td>
|
|
|
|
<td>{{container.image}}</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</section>
|
2023-11-18 15:35:30 +00:00
|
|
|
</main>
|
2023-11-18 22:17:05 +00:00
|
|
|
|
|
|
|
<style scoped>
|
2023-11-23 00:38:39 +00:00
|
|
|
h2 {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
gap: 0.5ch;
|
|
|
|
|
|
|
|
& form {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
& button {
|
|
|
|
padding: 2px 6px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-21 00:36:42 +00:00
|
|
|
.containers {
|
|
|
|
& .status {
|
|
|
|
text-align: center;
|
|
|
|
font-weight: bold;
|
|
|
|
color: white;
|
|
|
|
padding: 0 10px;
|
|
|
|
|
|
|
|
&.exited {
|
2023-11-25 00:38:56 +00:00
|
|
|
background-color: var(--danger-bright);
|
2023-11-21 00:36:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.running {
|
2023-11-25 00:38:56 +00:00
|
|
|
background-color: var(--success-bright);
|
2023-11-21 00:36:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.container-list {
|
|
|
|
grid-area: con;
|
|
|
|
}
|
|
|
|
|
|
|
|
.stack-list {
|
|
|
|
grid-area: stk;
|
2023-11-22 09:59:51 +00:00
|
|
|
|
|
|
|
& td {
|
|
|
|
padding: 4px 8px;
|
|
|
|
|
|
|
|
&.status {
|
2023-11-23 00:38:39 +00:00
|
|
|
width: 6px;
|
2023-11-22 09:59:51 +00:00
|
|
|
padding: 0;
|
2023-11-25 00:38:56 +00:00
|
|
|
background-color: var(--danger-bright);
|
2023-11-22 09:59:51 +00:00
|
|
|
|
|
|
|
&.active {
|
|
|
|
background-color: #33B074;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-21 00:36:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.system-info {
|
|
|
|
grid-area: sys;
|
|
|
|
display: flex;
|
|
|
|
gap: 1rem;
|
2023-11-23 00:38:39 +00:00
|
|
|
flex-direction: column;
|
2023-11-21 00:36:42 +00:00
|
|
|
|
|
|
|
& th {
|
|
|
|
font-weight: bold;
|
|
|
|
padding-right: 2ch;
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-21 12:06:31 +00:00
|
|
|
.count {
|
|
|
|
&::before {
|
|
|
|
content: "◉";
|
|
|
|
margin-right: 0.5ch;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.running::before {
|
2023-11-25 00:38:56 +00:00
|
|
|
color: var(--success-bright);
|
2023-11-21 12:06:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.stopped::before {
|
2023-11-25 00:38:56 +00:00
|
|
|
color: var(--danger-bright);
|
2023-11-21 12:06:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-21 00:36:42 +00:00
|
|
|
@media (min-width: 1000px) {
|
2023-11-23 00:38:39 +00:00
|
|
|
.system-info {
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
|
2023-11-21 00:36:42 +00:00
|
|
|
main {
|
|
|
|
display: grid;
|
2023-11-22 09:59:51 +00:00
|
|
|
gap: 1rem;
|
2023-11-21 00:36:42 +00:00
|
|
|
grid-template-areas:
|
|
|
|
"sys sys"
|
|
|
|
"stk con";
|
|
|
|
|
|
|
|
grid-template-rows: 100px 1fr;
|
2023-11-22 09:59:51 +00:00
|
|
|
grid-template-columns: 1fr 2fr;
|
2023-11-21 00:36:42 +00:00
|
|
|
}
|
|
|
|
}
|
2023-11-18 22:17:05 +00:00
|
|
|
</style>
|
2023-11-18 15:35:30 +00:00
|
|
|
{% endblock %}
|