Login Start
This commit is contained in:
@@ -11,13 +11,13 @@
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>{{title}}</h1>
|
||||
<body data-bs-theme="dark">
|
||||
<div class="container-fluid">
|
||||
<div class="row row-cols-auto bg-dark">
|
||||
<h1>Containers</h1>
|
||||
<div class="row row-cols-auto g-2">
|
||||
{% for container in containers %}
|
||||
<div class="col-6 col-sm-4 col-md-4 col-lg-3 col-xxl-2 bg-light">
|
||||
<div class="square-item">
|
||||
<div class="col-6 col-sm-4 col-md-4 col-lg-3 col-xxl-2">
|
||||
<div class="border h-100 p-3">
|
||||
<div class="square-content" onclick="openModalForContainer('{{container.id}}')">
|
||||
<!-- Content for the square item -->
|
||||
<div class="d-flex justify-content-between">
|
||||
@@ -28,14 +28,16 @@
|
||||
<input class="form-check-input" type="checkbox" id="flexSwitchCheckReverse"
|
||||
onclick="toggleContainer('{{container.id}}', '{{container.status}}', this, event);" {% if
|
||||
container.status=="running" %} checked {% endif %}>
|
||||
<label class="form-check-label" for="flexSwitchCheckReverse">isRunning</label>
|
||||
<label class="form-check-label d-none d-md-block " for="flexSwitchCheckReverse">isRunning</label>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="text-nowrap">{{container.attrs['Config']['Labels']['com.docker.compose.project']}}</h4>
|
||||
<h4 class="text-truncate">{{container.attrs['Config']['Labels']['com.docker.compose.project']}}</h4>
|
||||
<h5 class="text-truncate">{{container.name}}</h5>
|
||||
{% if container.status=="running" %}
|
||||
{% for port in container.attrs['NetworkSettings']['Ports'] %}
|
||||
<a href="//127.0.0.1:{{ port.split(" /")[0] }}">{{ port.split("/")[0] }}</a>
|
||||
<a href="//127.0.0.1:{{ port.split(" /")[0] }}" target="_blank">{{ port.split("/")[0] }}</a>
|
||||
{%endfor%}
|
||||
{%endif%}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -45,10 +47,12 @@
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-dialog modal-fullscreen-sm-down">
|
||||
<div class="modal-content">
|
||||
<div class="spinner-border" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
<div class="modal-body">
|
||||
<div class="spinner-border" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -82,11 +86,13 @@
|
||||
xhttp.open(method, '/api/' + container_id + '/' + route, true);
|
||||
xhttp.send();
|
||||
|
||||
await new Promise(r => setTimeout(() => r(), 1000));
|
||||
await new Promise(r => setTimeout(() => r(), 1500));
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
function openModalForContainer(container_id) {
|
||||
document.getElementById('exampleModal').getElementsByClassName('modal-content')[0].innerHTML = "<div class=\"modal-body\"><div class=\"spinner-border\" role=\"status\"><span class=\"visually-hidden\">Loading...</span></div></div>"
|
||||
|
||||
const myModal = new bootstrap.Modal('#exampleModal')
|
||||
myModal.show()
|
||||
|
||||
|
Reference in New Issue
Block a user