From 5cb3deb519e938c59d431618e48780a8a8162c51 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Mon, 10 Apr 2023 00:28:23 -0700 Subject: [PATCH] admin: allow test results to show Signed-off-by: Varun Patil --- src/Admin.vue | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Admin.vue b/src/Admin.vue index 8be78883..d6404e7f 100644 --- a/src/Admin.vue +++ b/src/Admin.vue @@ -322,12 +322,7 @@ const settings = { /** Invert setting before saving */ const invertedBooleans = ["enableTranscoding"]; -type BinaryStatus = - | "ok" - | "not_found" - | "not_executable" - | "test_fail" - | "test_ok"; +type BinaryStatus = "ok" | "not_found" | "not_executable" | "test_ok" | string; type IStatus = { exiftool: BinaryStatus; @@ -432,10 +427,20 @@ export default defineComponent({ return this.t("memories", "{name} binary is not executable", { name, }); - } else if (status === "test_fail") { - return this.t("memories", "{name} binary exists but failed test", { - name, - }); + } else if (status.startsWith("test_fail")) { + return this.t( + "memories", + "{name} binary failed test: {info}", + { + name, + info: status.substring(10), + }, + 0, + { + escape: false, + sanitize: false, + } + ); } else if (status === "test_ok") { return this.t("memories", "{name} binary exists and is usable", { name, @@ -454,7 +459,7 @@ export default defineComponent({ } else if ( status === "not_found" || status === "not_executable" || - status === "test_fail" + status.startsWith("test_fail") ) { return critical ? "error" : "warning"; } else {