Add Start/End work transitions, capture field, and PWA support

This commit is contained in:
2026-08-02 16:24:16 -04:00
parent b737200b21
commit d5f144c735
8 changed files with 309 additions and 16 deletions

View File

@ -4,6 +4,13 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Org Web Adapter</title>
<meta name="theme-color" content="#0f1720">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="manifest" href="/static/manifest.webmanifest">
<link rel="apple-touch-icon" href="/static/icon-192.png">
<link rel="icon" type="image/png" href="/static/icon-192.png">
<link rel="stylesheet" href="/static/style.css">
</head>
<body>
@ -316,12 +323,14 @@
if (!btn) return;
const file = btn.getAttribute("data-file");
const heading = btn.getAttribute("data-heading");
const state = btn.getAttribute("data-state") || "STRT";
const label = btn.textContent.trim();
btn.disabled = true;
btn.textContent = "Sending\u2026";
fetch("/webhook", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ file: file, heading: heading }),
body: JSON.stringify({ file: file, heading: heading, state: state }),
})
.then(function (resp) { return resp.json(); })
.then(function (data) {
@ -340,12 +349,19 @@
.finally(function () {
setTimeout(function () {
btn.disabled = false;
btn.textContent = "Start work";
btn.textContent = label;
btn.classList.remove("webhook-sent", "webhook-error");
}, 3000);
});
});
})();
</script>
<script>
if ("serviceWorker" in navigator) {
window.addEventListener("load", function () {
navigator.serviceWorker.register("/sw.js").catch(function () {});
});
}
</script>
</body>
</html>