added versioning
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 6s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Successful in 11s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Successful in 9s

This commit is contained in:
wt committed 2026-03-14 07:15:04 +07:00
1 parent 844f839c51
commit 9ce171911d
5 files changed
+413 -52

No files matched your search

+62 -7
View File
@@ -23,8 +23,10 @@ document.addEventListener("DOMContentLoaded", function () {
// Initialize
checkMountStatus();
checkTemperature();
checkFileDates();
setInterval(checkMountStatus, 10000); // Check every 10 seconds
setInterval(checkTemperature, 5000); // Check temperature every 5 seconds
setInterval(checkFileDates, 10000); // Check file dates every 10 seconds
// Tab switching
tabBtns.forEach((btn) => {
@@ -114,6 +116,9 @@ document.addEventListener("DOMContentLoaded", function () {
progressBytes.textContent = "";
hideResult();
// Get current timestamp
const timestamp = new Date().toISOString();
try {
const xhr = new XMLHttpRequest();
@@ -135,6 +140,8 @@ document.addEventListener("DOMContentLoaded", function () {
`Successfully uploaded ${response.filename} (${formatBytes(response.size)})`,
"success",
);
// Refresh file dates after upload
checkFileDates();
} else {
let errorMsg = "Upload failed";
try {
@@ -151,7 +158,10 @@ document.addEventListener("DOMContentLoaded", function () {
showResult("Network error", "error");
});
xhr.open("POST", "/api/upload");
xhr.open(
"POST",
`/api/upload?timestamp=${encodeURIComponent(timestamp)}`,
);
xhr.send(formData);
} catch (error) {
progressStatus.textContent = "Failed";
@@ -227,19 +237,27 @@ document.addEventListener("DOMContentLoaded", function () {
showEditorStatus("Saving...", "");
// Get current timestamp from browser
const timestamp = new Date().toISOString();
try {
const response = await fetch("/api/extlinux", {
method: "POST",
headers: {
"Content-Type": "application/json",
const response = await fetch(
`/api/extlinux?timestamp=${encodeURIComponent(timestamp)}`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ content: content }),
},
body: JSON.stringify({ content: content }),
});
);
const data = await response.json();
if (data.status === "success") {
showEditorStatus("Successfully saved extlinux.conf", "success");
// Refresh file dates after save
checkFileDates();
} else {
showEditorStatus(data.error || "Failed to save", "error");
}
@@ -349,4 +367,41 @@ document.addEventListener("DOMContentLoaded", function () {
if (temp < 80) return "#ffa500"; // Orange - warm
return "#ff4757"; // Red - hot
}
// File dates functions
const fileDates = {
"Image.gz": document.getElementById("date-Image.gz"),
"sun50i-h618-orangepi-zero2w.dtb": document.getElementById(
"date-sun50i-h618-orangepi-zero2w.dtb",
),
"uboot.env": document.getElementById("date-uboot.env"),
"u-boot-sunxi-with-spl.bin": document.getElementById(
"date-u-boot-sunxi-with-spl.bin",
),
"extlinux.conf": document.getElementById("date-extlinux.conf"),
};
async function checkFileDates() {
for (const [filename, element] of Object.entries(fileDates)) {
if (!element) continue;
try {
const response = await fetch(
`/api/filedate?file=${encodeURIComponent(filename)}`,
);
const data = await response.json();
if (data.status === "success" && data.date) {
element.textContent = data.date;
element.style.color = "#00ff88";
} else {
element.textContent = "Not available";
element.style.color = "#888";
}
} catch (error) {
element.textContent = "Error";
element.style.color = "#ff4757";
}
}
}
});