3 Commits

Author SHA1 Message Date
704ecb4249 finally introduced CNTDWN-1 (allow/disallow overrun) 2023-08-07 16:59:38 +02:00
5398817a1e - fixed issue #8 2022-11-19 15:49:46 +01:00
1fc16fdc14 „README.MD“ ändern 2022-11-15 20:50:12 +01:00
11 changed files with 35 additions and 10 deletions

View File

@ -21,8 +21,6 @@ We've introduced a new packaging system. It is based on [electron-builder](https
chmod +x ./build.sh
./build.sh
```
> Binary Builds may be faulty or non-working. They are not officially supported.
*Small disclaimer: Please do not use openCountdown for military or life-depending applications. Please also refrain from using openCountdown for launching rockets.*

View File

@ -73,6 +73,7 @@ currentState = {
srvTime: 0,
enableColoredText: true,
debug: false,
enableOverrun: true,
sessionToken: Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15),
};
@ -269,6 +270,18 @@ app.get("/api/v1/set/layout/showTime", function (req, res) {
updatedData()
});
app.get("/api/v1/set/enableOverrun", function (req, res) {
const resy = helper.wrapBooleanConverter(req.query.enable, res)
if (resy != undefined) {
currentState.enableOverrun = resy;
if (req.query.persist === 'true') {
dataToBeWritten.enableOverrun = currentState.enableOverrun
}
res.json({ status: "ok" });
}
updatedData()
});
app.get("/api/v1/set/progressbar/show", function (req, res) {
currentState.showProgressbar = (req.query.show === 'true');
if (req.query.persist === 'true') {

View File

@ -46,7 +46,8 @@
"enableTextClrs": "Text Farben aktivieren:",
"textClrs": "Text Farben",
"addRow": "Neue Zeile",
"timeVar": "Aktiviere zeitabweichungs display:"
"timeVar": "Aktiviere zeitabweichungs display:",
"allowOverrun": "Überlauf erlauben: "
},
"untis":
{

View File

@ -49,7 +49,8 @@
"addRow": "Add Row",
"timeVar": "Enable time variance display:",
"language": "Select a language",
"apply": "Apply"
"apply": "Apply",
"allowOverrun": "Allow overrun:"
},
"untis":
{

View File

@ -46,7 +46,8 @@
"enableTextClrs": "██████ ████ ███████:",
"textClrs": "████ ██████",
"addRow": "███ ███",
"timeVar": "██████ ████ ███████ ███████:"
"timeVar": "██████ ████ ███████ ███████:",
"allowOverrun": "██████ ████████:"
},
"untis":
{

View File

@ -1 +0,0 @@
[{"timestamp":"2022-08-18 16:19:06.649","level":"info","module":"Logging","message":"2022-08-18 16:19:06.649 [info] [Logging] Logging initialized"},{"timestamp":"2022-08-18 16:19:06.651","level":"info","module":"Server","message":"2022-08-18 16:19:06.651 [info] [Server] Preparing server"},{"timestamp":"2022-08-18 16:19:06.652","level":"info","module":"Server","message":"2022-08-18 16:19:06.652 [info] [Server] Preparing static routes"},{"timestamp":"2022-08-18 16:19:06.654","level":"info","module":"Server","message":"2022-08-18 16:19:06.654 [info] [Server] Preparing middlewares"},{"timestamp":"2022-08-18 16:19:06.655","level":"info","module":"Config","message":"2022-08-18 16:19:06.655 [info] [Config] Loading config"},{"timestamp":"2022-08-18 16:19:06.658","level":"info","module":"Language","message":"2022-08-18 16:19:06.658 [info] [Language] Searching for languages"},{"timestamp":"2022-08-18 16:19:06.659","level":"info","module":"Language","message":"2022-08-18 16:19:06.659 [info] [Language] Found 3 languages"},{"timestamp":"2022-08-18 16:19:06.659","level":"info","module":"Language","message":"2022-08-18 16:19:06.659 [info] [Language] Reading language file"},{"timestamp":"2022-08-18 16:19:06.675","level":"info","module":"Websocket","message":"2022-08-18 16:19:06.675 [info] [Websocket] Preparing websocket"},{"timestamp":"2022-08-18 16:19:06.675","level":"info","module":"Server","message":"2022-08-18 16:19:06.675 [info] [Server] Preparing routes"},{"timestamp":"2022-08-18 16:19:06.678","level":"info","module":"Server","message":"2022-08-18 16:19:06.678 [info] [Server] Starting server"},{"timestamp":"2022-08-18 16:22:57.338","level":"info","module":"Shutdown","message":"2022-08-18 16:22:57.338 [info] [Shutdown] Caught interrupt signal and shutting down gracefully"}]

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "opencountdown",
"version": "1.0.4",
"version": "1.0.7",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "opencountdown",
"version": "1.0.4",
"version": "1.0.7",
"license": "LGPL-3.0",
"dependencies": {
"body-parser": "^1.20.1",

View File

@ -1,6 +1,6 @@
{
"name": "opencountdown",
"version": "1.0.6",
"version": "1.0.7",
"description": "An opensource countdown",
"main": "startHandler.js",
"scripts": {

View File

@ -131,6 +131,7 @@ $(function () {
$("#showMillis")[0].checked = jsonResult.showMilliSeconds;
$("#progBarShow")[0].checked = jsonResult.showProgressbar;
$("#textColors")[0].checked = jsonResult.enableColoredText;
$("#allowOverrun")[0].checked = jsonResult.enableOverrun;
console.log(document.getElementById("tableCopySource"))
let tableEntryDom = document.getElementById("tableCopySource").cloneNode(true)
@ -266,6 +267,7 @@ $(function () {
const showMillisB = $("#showMillis")[0].checked
const progBarShowB = $("#progBarShow")[0].checked
const textColorsB = $("#textColors")[0].checked
const allowOverrun = $("#allowOverrun")[0].checked
const colors = convertColorSegments("colors1")
const colors2 = convertColorSegments("colors2")
@ -276,6 +278,8 @@ $(function () {
allPathes.push("/api/v1/set/text/enableColoring?enable=" + textColorsB)
allPathes.push("/api/v1/set/progressbar/colors?isBase64=true&colors=" + btoa(JSON.stringify(colors)))
allPathes.push("/api/v1/set/text/colors?isBase64=true&colors=" + btoa(JSON.stringify(colors2)))
allPathes.push("/api/v1/set/enableOverrun?enable=" + allowOverrun)
for (pI in allPathes) {
@ -301,11 +305,13 @@ $(function () {
const showMillisB = $("#showMillis")[0].checked
const progBarShowB = $("#progBarShow")[0].checked
const textColorsB = $("#textColors")[0].checked
const allowOverrun = $("#allowOverrun")[0].checked
allPathes.push("/api/v1/set/layout/showTime?persist=true&show=" + showTimeB)
allPathes.push("/api/v1/set/layout/showMillis?persist=true&show=" + showMillisB)
allPathes.push("/api/v1/set/progressbar/show?persist=true&show=" + progBarShowB)
allPathes.push("/api/v1/set/text/enableColoring?persist=true&enable=" + textColorsB)
allPathes.push("/api/v1/set/enableOverrun?persist=true&enable=" + allowOverrun)
for (pI in allPathes) {
const path = allPathes[pI];

View File

@ -14,7 +14,7 @@ let screensaverText = document.getElementById("moveClock");
let screensaverClock = document.getElementById("screensaverClock");
// Prepare connection to backend
let socket = new ReconnectingWebSocket("ws://127.0.0.1:" + location.port);
let socket = new ReconnectingWebSocket("ws://" + location.hostname + ":" + location.port);
// State variables
let ackSessionTokenChange = false; // Wether the user has acknowledged the session token mismatch
@ -186,6 +186,9 @@ function handleUpdate() {
progressBar.style.width = percentage(diff, dataFrame.timeAmountInital) + "%";
} else {
progressBar.style.width = "0%";
if(!dataFrame.enableOverrun) {
timer.innerHTML = "00:00:00";
}
}
progressBar.style.backgroundColor = findProgessColor(dataFrame.colorSegments, diff)

View File

@ -262,6 +262,9 @@
<label for="progBarShow"><%= it.lang.labels.showProgress %></label>
<input type="checkbox" name="progBarShow" id="progBarShow"><br>
<label for="allowOverrun"><%= it.lang.labels.allowOverrun %></label>
<input type="checkbox" name="allowOverrun" id="allowOverrun"><br>
<details>
<summary><%= it.lang.labels.progbarColors %></summary>
<p>