From 93434ad36e569305056f137e8a78d643b3ec8413 Mon Sep 17 00:00:00 2001 From: engigu Date: Sat, 20 Jan 2024 16:42:56 +0800 Subject: [PATCH] feat: add log view auto refresh --- web/src/util/commonUtils.js | 12 +++++ web/src/views/tabsTools/sendLogs/sendLogs.vue | 50 ++++++++++++++++++- .../views/tabsTools/sendTasks/sendTasks.vue | 1 - 3 files changed, 60 insertions(+), 3 deletions(-) diff --git a/web/src/util/commonUtils.js b/web/src/util/commonUtils.js index 2f8c9d3..44b0330 100644 --- a/web/src/util/commonUtils.js +++ b/web/src/util/commonUtils.js @@ -20,6 +20,18 @@ class CommonUtils { static formatWayName = (type) => { return CONSTANT.WAYS_DATA_MAP[type].label; } + + static getCurrentTimeStr = () => { + const currentDate = new Date(); + const year = currentDate.getFullYear(); + const month = String(currentDate.getMonth() + 1).padStart(2, '0'); + const day = String(currentDate.getDate()).padStart(2, '0'); + const hours = String(currentDate.getHours()).padStart(2, '0'); + const minutes = String(currentDate.getMinutes()).padStart(2, '0'); + const seconds = String(currentDate.getSeconds()).padStart(2, '0'); + const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; + return formattedDate; + } } diff --git a/web/src/views/tabsTools/sendLogs/sendLogs.vue b/web/src/views/tabsTools/sendLogs/sendLogs.vue index 106f93d..fa720a6 100644 --- a/web/src/views/tabsTools/sendLogs/sendLogs.vue +++ b/web/src/views/tabsTools/sendLogs/sendLogs.vue @@ -1,9 +1,18 @@