2023-11-18 19:51:10 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
2023-11-19 14:08:47 +00:00
|
|
|
{% block title %}Stack {{stack_name}}{% endblock %}
|
2023-11-18 19:51:10 +00:00
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<main>
|
2023-11-21 00:36:42 +00:00
|
|
|
<header>
|
|
|
|
<h1>Stack details for <span class="stack-name">{{stack_name}}</span></h1>
|
|
|
|
<div class="actions">
|
2023-11-25 11:24:06 +00:00
|
|
|
<form action="./start" method="POST">
|
|
|
|
<button title="Start all containers" type="submit">
|
|
|
|
Start
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
<form action="./restart" method="POST">
|
|
|
|
<button title="Restart containers" type="submit">
|
|
|
|
Restart
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
<form action="./stop" method="POST">
|
|
|
|
<button title="Stop all containers" type="submit">
|
|
|
|
Stop
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
<form action="./down" method="POST">
|
|
|
|
<button title="Stop and remove all resources" type="submit">
|
|
|
|
Down
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
<form action="./delete" method="GET">
|
|
|
|
<button title="Stop and delete everything" type="submit">
|
|
|
|
Delete
|
|
|
|
</button>
|
|
|
|
</form>
|
2023-11-21 00:36:42 +00:00
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
<section class="container-list">
|
|
|
|
<h2>Containers</h2>
|
2023-11-22 09:59:51 +00:00
|
|
|
<table class="containers table">
|
2023-11-21 00:36:42 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>State</th>
|
|
|
|
<th>Image</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for container in containers %}
|
|
|
|
<tr>
|
|
|
|
<td><a href="/container/{{container.name}}/">{{container.name}}</a></td>
|
|
|
|
<td class="status {{container.state}}">{{container.state}}</td>
|
|
|
|
<td>{{container.image}}</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</section>
|
|
|
|
<section class="editor">
|
2023-11-25 11:24:06 +00:00
|
|
|
<h2>
|
|
|
|
Editor
|
|
|
|
<form action="./history"><button title="View past versions">History</button></form>
|
|
|
|
</h2>
|
2023-11-23 00:38:39 +00:00
|
|
|
<form method="POST" action="./edit" id="editor-form">
|
2023-11-24 23:45:54 +00:00
|
|
|
<div class="error"></div>
|
2023-11-23 00:38:39 +00:00
|
|
|
<textarea name="source" id="editor">{{file_contents}}</textarea>
|
|
|
|
<div class="row">
|
|
|
|
<input style="flex:1" name="commit_message" type="text"
|
|
|
|
placeholder="What did you change?" />
|
2023-11-23 23:17:03 +00:00
|
|
|
<div id="editor-extra"></div>
|
2023-11-23 00:38:39 +00:00
|
|
|
<button class="wide" type="submit">Deploy</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
2023-11-21 00:36:42 +00:00
|
|
|
</section>
|
2023-11-18 19:51:10 +00:00
|
|
|
</main>
|
2023-11-18 22:17:05 +00:00
|
|
|
|
2023-11-23 13:18:00 +00:00
|
|
|
<link rel="stylesheet" href="/static/css/editor.css" />
|
2023-11-25 00:38:56 +00:00
|
|
|
<link rel="stylesheet" href="/static/css/resource.css" />
|
2023-11-18 22:17:05 +00:00
|
|
|
<style scoped>
|
|
|
|
main {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
gap: 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.containers {
|
|
|
|
& .status {
|
|
|
|
text-align: center;
|
|
|
|
font-weight: bold;
|
|
|
|
color: white;
|
2023-11-21 00:36:42 +00:00
|
|
|
padding: 0 10px;
|
2023-11-18 22:17:05 +00:00
|
|
|
|
|
|
|
&.exited {
|
2023-11-25 00:38:56 +00:00
|
|
|
background-color: var(--danger-bright);
|
2023-11-18 22:17:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.running {
|
2023-11-25 00:38:56 +00:00
|
|
|
background-color: var(--success-bright);
|
2023-11-18 22:17:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.stack-name {
|
2023-11-25 00:38:56 +00:00
|
|
|
color: var(--text-accent);
|
2023-11-21 00:36:42 +00:00
|
|
|
}
|
2023-11-18 22:17:05 +00:00
|
|
|
</style>
|
|
|
|
|
2023-11-23 13:18:00 +00:00
|
|
|
<script type="module">
|
|
|
|
import Editor from "/static/js/ace.mjs";
|
2023-11-24 23:45:54 +00:00
|
|
|
import { add_check } from "/static/js/enhancements/check.mjs";
|
2023-11-23 13:18:00 +00:00
|
|
|
|
2023-11-23 23:17:03 +00:00
|
|
|
const editor = new Editor("editor");
|
|
|
|
|
2023-11-24 23:45:54 +00:00
|
|
|
/* Enforce check pre-submit */
|
|
|
|
const form = document.getElementById("editor-form");
|
|
|
|
add_check(form, editor);
|
2023-11-18 22:17:05 +00:00
|
|
|
</script>
|
|
|
|
|
2023-11-18 19:51:10 +00:00
|
|
|
{% endblock %}
|