chore: initial import

This commit is contained in:
dasemu committed 2026-11-16 21:45:51 +01:00
commit c53a5ec684
135 files changed
+11270

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

+92
View File
@@ -0,0 +1,92 @@
$(document).ready(function() {
var pollInterval; // Variable to hold the interval ID
// Disable all buttons initially
$(".button").prop("disabled", true);
$(".label").css("pointer-events", "none");
// Start polling instance status
startPolling();
// Button click event handler
$(".button").click(function() {
var instance = $(this).data("instance");
var action = $(this).data("action");
$(".button").prop("disabled", true);
clearInterval(pollInterval); // Pause polling
executeInstanceAction(instance, action);
if (instance === "") {
executeServiceAction(action);
} else {
executeInstanceAction(instance, action);
}
});
// Function to start polling instance status
function startPolling() {
pollInterval = setInterval(function() {
$(".row").each(function() {
var instanceName = $(this).find(".label").text().trim();
var url = "/instances/" + instanceName;
// Make GET request to get instance status
$.get(url, function(data) {
var running = data.trim() === "true";
updateButtons(instanceName, running);
});
});
}, 5000);
}
// Function to update buttons based on instance status
function updateButtons(instance, running) {
// Re-enable the service restart button
$(".button-service-restart").prop("disabled", false);
// Update the instance rows
$(".row").each(function() {
var instanceName = $(this).find(".label").text().trim();
if (instanceName === instance) {
$(this).find(".button-instance-start").prop("disabled", running);
$(this).find(".button-instance-stop").prop("disabled", !running);
if (running) {
$(this).find(".label").css("pointer-events", "auto");
} else {
$(this).find(".label").css("pointer-events", "none");
}
}
});
}
// Function to execute service action
function executeServiceAction(action) {
var url = "/" + action;
$.get(url, function(data) {
showMessage(data);
});
}
// Function to execute instance action
function executeInstanceAction(instance, action) {
var url = "/instances/" + instance + "/" + action;
$.get(url, function(data) {
showMessage(data);
});
}
// Function to show message
function showMessage(message) {
$("#message").text(message);
$("#message").fadeIn('slow');
sleep(5000).then(() => {
$("#message").fadeOut('slow', function() {
startPolling(); // Restart polling
});
});
}
// Function to sleep
function sleep(time) {
return new Promise((resolve) => setTimeout(resolve, time));
}
});
+184
View File
@@ -0,0 +1,184 @@
body {
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 16px;
font-weight: 400;
line-height: 24px;
color: #212529;
text-align: start;
-webkit-text-size-adjust: 100%;
}
h1 {
font-size: 40px;
font-weight: 500;
}
table {
border-collapse: collapse;
}
th {
text-align: inherit;
text-align: -webkit-match-parent;
}
a {
text-decoration: none;
font-weight: bold;
}
a:link {
color: #eb9639;
}
a:active {
color: #eb9639;
}
a:visited {
color: #eb9639;
}
a:hover {
color: #eb9639;
}
.duo-logo {
display: flex;
align-items: center;
text-decoration: none;
}
.duo-logo img {
margin-right: 15px;
width: 48px;
height: 48px;
}
.label {
display: flex;
align-items: center;
text-decoration: none;
}
.label img {
margin-right: 5px;
}
.sunshine-link a {
pointer-events: none;
}
.container {
max-width: 1320px;
width: 100%;
padding-right: 12px;
padding-left: 12px;
margin-right: auto;
margin-left: auto;
box-sizing: border-box;
}
.card {
position: relative;
display: flex;
flex-direction: column;
min-width: 0;
color: rgb(33, 37, 41);
word-wrap: break-word;
background-color: #fff;
background-clip: border-box;
border: 1px solid #dee2e6;
border-radius: .375rem;
}
.cell {
padding: .500rem .75rem;
}
.row {
border-top-color: rgb(222, 226, 230);
border-top-style: solid;
border-top-width: 1px;
border-bottom-width: 0px;
border-left-width: 0px;
border-right-width: 0px;
}
.button {
display: inline-block;
padding: .375rem .75rem;
margin: .1rem .1rem;
font-size: 1rem;
font-weight: 400;
line-height: 24px;
color: #fff;
text-align: center;
text-decoration: none;
vertical-align: middle;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
border: 1px solid #0d6efd;
border-radius: .375rem;
background-color: #0d6efd;
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.button:disabled {
background-color: #6c757d;
border-color: #6c757d;
}
.button:disabled:hover {
background-color: #6c757d;
border-color: #6c757d;
}
.button-blue {
border: 1px solid #0d6efd;
background-color: #0d6efd;
}
.button-blue:hover {
border: 1px solid #0a58ca;
background-color: #0b5ed7;
}
.button-red {
border: 1px solid #dc3545;
background-color: #dc3545;
}
.button-red:hover {
border: 1px solid #b02a37;
background-color: #bb2d3b;
}
.message-box {
display: none;
position: fixed;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
background-color: rgba(0, 0, 0, 0.8);
color: #fff;
padding: 10px 20px;
border-radius: 5px;
white-space: nowrap;
}
.my {
margin-top: 1.5rem !important;
margin-bottom: 1.5rem !important;
}
.mx {
margin-right: .25rem !important;
margin-left: .25rem !important;
}
.p {
padding: 1.5rem !important;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B