Lots of changes

-    Feedback van dataSensor array
-    dataSliders min/max and unit
-    Camera before Unity
-    Restart knop buiten service mode
-    Operator phonenumber button
-    Gracefull shutdown
-    Out of service control
This commit is contained in:
2025-10-23 17:45:35 +02:00
parent f07ba57168
commit cd33670361
36 changed files with 1444 additions and 277 deletions

View File

@@ -26,24 +26,34 @@ export type StatusType = 'green' | 'yellow' | 'red' | 'gray';
export const setProgressState = (
progressElement: HTMLDivElement,
percentage: number
value: number,
min: number,
max: number,
unit: string
) => {
const value: HTMLDivElement = progressElement.querySelector(
const percentage = (value - min) / (max - min);
const progressValue: HTMLDivElement = progressElement.querySelector(
'.ntsh_progress-value'
);
value.style.width = `${percentage * 100}%`;
progressValue.style.width = `${percentage * 100}%`;
const label: HTMLDivElement = progressElement.querySelector(
'.ntsh_progress-label'
);
label.innerText = `${Math.round(percentage * 100)}%`;
label.innerText = `${value}${unit}`;
};
export const createProgress = (value: number) => {
export const createProgress = (
value: number,
min: number,
max: number,
unit: string
) => {
const progress = ce('div', 'ntsh_progress');
progress.appendChild(ce('div', 'ntsh_progress-value'));
progress.appendChild(ce('div', 'ntsh_progress-label'));
setProgressState(progress, value);
setProgressState(progress, value, min, max, unit);
return progress;
};
export function capitalizeFirstLetter(string: string) {