hanahmily commented on code in PR #397:
URL: 
https://github.com/apache/skywalking-banyandb/pull/397#discussion_r1513646894


##########
ui/src/components/Read/index.vue:
##########
@@ -347,27 +344,25 @@ function handleCodeData() {
     getTableData()
 }
 function autoRefreshTimeRange() {
-    if (isDatePicker.value) {

Review Comment:
   This variable is still useful, but the original version still has some 
flaws. Let me clarify the logic.
   
   ### "last 15 minutes" is selected. 
   1. If user click "🔍" , both the start and end dates have been updated to 
reflect the current time.
   2. If user click "↻", the dates remain unchanged.
   
   ### A fixed time range is selected 
   1. If user click "🔍" , the dates remain unchanged.
   2. If user click "↻", the dates remain unchanged.
   
   Based on the four cases mentioned above, it appears that 
"autoRefreshTimeRange" feature has limited functionality and works only in one 
scenario.
   



##########
ui/src/components/Read/index.vue:
##########
@@ -197,11 +195,10 @@ function initCode() {
     } else {
         let timeRange = {
             timeRange: {
-                begin: new Date(new Date() - 15),
+                begin: new Date(new Date() - 15 * 60 * 1000),

Review Comment:
   This is a good find.
   
   Since we have a constant variable named 'last15Minutes' defined at line 35, 
would it be possible to reuse it instead of generating it repeatedly? I 
understand that this constant is a "ref", but it would be better to use a 
numeric constant instead and refer to it in the two places it is used.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to