Grotti 3.3.0: Projekte mit Ordner, Datei-Löschen/Verschieben, Material-Archiv, UI-Polish.

This commit is contained in:
Dominic Gundel committed 2026-10-18 20:10:32 +02:00
1 parent 4ddffbbeb1
commit 67a89d1794
45 files changed
+2856 -320

No files matched your search

+19 -3
View File
@@ -23,7 +23,7 @@
</div>
<p id="run-note"></p>
<div class="card table-wrap">
<table>
<table class="proto-table">
<thead><tr><th>Drucker</th><th>Datei</th><th>Zustand</th><th>Dauer</th><th>Ist</th><th>Kosten</th><th>Urteil</th><th>Spule</th><th></th></tr></thead>
<tbody id="run-rows"></tbody>
</table>
@@ -65,6 +65,16 @@ function filteredRuns() {
});
}
function shortRunName(filename) {
let name = (filename || "").split("/").pop() || "";
if (!name) return "";
name = name.replace(/^\d{8}-\d{6}-/, "");
name = name.replace(/^\d{4}-\d{4}-/, "");
name = name.replace(/\.gcode$/i, "");
name = name.replace(/_\d+(?:\.\d+)?_(?:\d+h)?(?:\d+m)?(?:\d+s)?$/i, "");
return name || (filename || "").split("/").pop() || "";
}
function render() {
fillPrinterFilter();
const body = document.getElementById("run-rows");
@@ -83,12 +93,15 @@ function render() {
tr.className = "pick";
tr.innerHTML = "<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>";
tr.children[0].textContent = run.printer_name;
tr.children[0].className = "proto-printer";
const fileCell = tr.children[1];
fileCell.className = "proto-file";
const fullName = (run.filename || "").split("/").pop() || ("#" + run.id);
const link = document.createElement("a");
link.href = "/protokoll/" + run.id;
link.className = "cell-file";
link.title = (run.filename || "").split("/").pop() || ("#" + run.id);
link.textContent = (run.filename || "").split("/").pop() || ("#" + run.id);
link.title = fullName;
link.textContent = shortRunName(run.filename) || fullName;
fileCell.appendChild(link);
if (run.chargen_nr) {
const code = document.createElement("div");
@@ -167,7 +180,10 @@ function render() {
} else {
const spool = spools.find((item) => item.id === run.spool_id);
tr.children[7].textContent = spool ? spool.name : "abgezogen";
tr.children[7].title = spool ? spool.name : "";
tr.children[7].className = "proto-spool";
}
if (!tr.children[7].className) tr.children[7].className = "proto-spool";
if (run.file_id) {
const again = document.createElement("button");
again.type = "button";