From 1f1b4e4fbdf8b7d24f90255ed9a5d949397c4dc6 Mon Sep 17 00:00:00 2001 From: Tristan Perrin Date: Mon, 7 Oct 2024 20:51:29 +0200 Subject: [PATCH] #63 feat : Add warning if device will not finish WU on time --- src/unit.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/unit.js b/src/unit.js index 961117a..f85f27d 100644 --- a/src/unit.js +++ b/src/unit.js @@ -231,6 +231,18 @@ class Unit { let eta = this.wu_progress < 1 ? this.unit.eta : 0 if (typeof eta == 'string') eta = this.util.parse_interval(eta) + console.log(this.util.time_interval(0 < eta ? eta : 0)); + + if (eta > this.deadline) { + return ( + `
+ + Won't finish on time + +
` + ) + } + return this.util.time_interval(0 < eta ? eta : 0) }