This commit is contained in:
2022-08-29 12:22:17 +02:00
parent e11645932d
commit 9b4b71d25f
6 changed files with 22 additions and 17 deletions

View File

@ -17,7 +17,7 @@
let hasData = false;
function tileProps(service) {
let props = {
const props = {
title: service.name.en,
subtitle: service.cluster,
date: service.lastBeat?.date ? new Date(service.lastBeat.date) : undefined,
@ -87,7 +87,9 @@
settings.subscribe(s => {
size = (s.cols || 4) * (s.rows || 3);
if (hasData) organiseGrid();
if (hasData) {
organiseGrid();
}
});
return () => clearInterval(clockInterval);

View File

@ -14,13 +14,13 @@
}) : '';
onMount(() => {
if (since) {
function updateDuration() {
formattedDuration = formatDuration(
new Date().getTime() - since.getTime()
);
}
function updateDuration() {
formattedDuration = formatDuration(
new Date().getTime() - since.getTime()
);
}
if (since) {
updateDuration();
const interval = setInterval(updateDuration, 100);
return () => clearInterval(interval);