add stack template
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
from flask import Flask, render_template
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@app.route("/")
|
||||||
|
def stack():
|
||||||
|
stack_name = "lab"
|
||||||
|
containers = ["website", "test-container", "composer"]
|
||||||
|
image = ["image1", "image2", "image3"]
|
||||||
|
status = [True, False, True]
|
||||||
|
return render_template("stack.html", stack="lab", containers=[(containers[i], status[i], image[i]) for i in range(len(containers))])
|
||||||
|
|
||||||
|
if __name__=="__main__":
|
||||||
|
app.run()
|
||||||
77
composer-lens/templates/stack.html
Normal file
77
composer-lens/templates/stack.html
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Composer - {{ stack }}</title>
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Lexend:wght@100..900&display=swap" rel="stylesheet">
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css">
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
|
||||||
|
<style>
|
||||||
|
body{
|
||||||
|
font-family: "JetBrains Mono", monospace;
|
||||||
|
font-weight: 100;
|
||||||
|
}
|
||||||
|
h1{
|
||||||
|
font-family: "JetBrains Mono", monospace;
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
h2{
|
||||||
|
font-family: "Lexend", sans-serif;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
h3{
|
||||||
|
font-family: "Lexend", sans-serif;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
b{
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="text-light bg-dark">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<h1><i class="bi bi-music-note-beamed"></i> Composer</h1>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-4">
|
||||||
|
<div class="border border-2 rounded-4 p-2 m-2">
|
||||||
|
<h2 class="d-inline-block">{{ stack }}</h2>
|
||||||
|
<div class="btn-group float-end">
|
||||||
|
<button type="button" class="btn btn-outline-light"><i class="bi bi-play-circle"></i></button>
|
||||||
|
<button type="button" class="btn btn-outline-light"><i class="bi bi-pause-circle"></i></button>
|
||||||
|
<button type="button" class="btn btn-outline-light"><i class="bi bi-arrow-clockwise"></i></button>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<div>
|
||||||
|
<b>status</b>: __ running, __ stopped<br>
|
||||||
|
<b>remote</b>: {{ remote }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-8">
|
||||||
|
{% for container, status, image in containers %}
|
||||||
|
<div class="border border-2 rounded-4 p-2 m-2">
|
||||||
|
<h3 class="d-inline-block">{{ container }}</h3>
|
||||||
|
<div class="btn-group float-end">
|
||||||
|
<button type="button" class="btn btn-outline-light"><i class="bi bi-play-circle"></i></button>
|
||||||
|
<button type="button" class="btn btn-outline-light"><i class="bi bi-pause-circle"></i></button>
|
||||||
|
<button type="button" class="btn btn-outline-light"><i class="bi bi-arrow-clockwise"></i></button>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<div>
|
||||||
|
{% if status %}
|
||||||
|
<b>status</b>: <span class="text-success">running</span><br>
|
||||||
|
{% else %}
|
||||||
|
<b>status</b>: <span class="text-danger">off</span><br>
|
||||||
|
{% endif %}
|
||||||
|
<b>image</b>: {{ image }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user