From 4d7db53f2832518859706c384cdad420fcaf7f9d Mon Sep 17 00:00:00 2001 From: forgottener Date: Mon, 2 Jun 2025 13:45:15 +0800 Subject: [PATCH] use DurationOptions[5].value to avoid using magic strings --- .../dashboard/related/async-profiling/components/NewTask.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/dashboard/related/async-profiling/components/NewTask.vue b/src/views/dashboard/related/async-profiling/components/NewTask.vue index cb3cbd37..3e9e2a42 100644 --- a/src/views/dashboard/related/async-profiling/components/NewTask.vue +++ b/src/views/dashboard/related/async-profiling/components/NewTask.vue @@ -31,7 +31,7 @@ limitations under the License. -->
{{ t("duration") }}
-
+
{{ t("customDuration") }} ({{ t("seconds") }})
async function createTask() { let finalDuration: number; - if (duration.value === "custom") { + if (duration.value === DurationOptions[5].value) { if (!customDurationSeconds.value || customDurationSeconds.value < 1 || customDurationSeconds.value > 900) { ElMessage.error("Please enter a valid duration between 1 and 900 seconds"); return;