-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat][UI] Set up UI setting component in profile page #11226
Conversation
…imer to setInterval in refreshLogs function
Hi @songjianet @EricGao888 . New commits were added to address these features/improvements:
3) Auto refresh the log when the log result is loading, the user can configure the time interval (10s, 20s, 1 min, etc) on the UI setting page. |
…imer to setInterval in refreshLogs function
c23805b
to
49c93ab
Compare
This function has not been perfected, and the 310 has been closed, so I changed this to 320. |
…phinscheduler into Lynn/11079-setting-page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* limitations under the License. | ||
*/ | ||
|
||
type logTimer = number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be no need to define the logTimer type here.
variables.skipLineNum = 0 | ||
variables.logLoadingRef = true | ||
getLogs(row, logTimer) | ||
}, logTimer * 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to clear the timer before turning it on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on this comment?
I tried clearing the timer by clearTimeout(timeoutID)
but it might not be what we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the getLogs
function is called multiple times, multiple timers will be running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great point! Addressed in 7782c5d
variables.skipLineNum = 0 | ||
variables.logLoadingRef = true | ||
getLogs(row, logTimer) | ||
}, logTimer * 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
nodeVariables.limit += 1000 | ||
nodeVariables.skipLineNum += 1000 | ||
getLogs(logTimer) | ||
}, logTimer * 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in fcfe28f.
const handleUpdateValue = (logTimer: logTimer) => { | ||
const logTimerStore = useLogTimerStore() | ||
logTimerStore.setLogTimer(logTimer) | ||
cookies.set('logTimer', String(logTimer), { path: '/' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why set the logTimer into the cookies? Does the backend side need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi. We might not need this. I will remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might not need this. Removed in 145bfd4.
…phinscheduler into Lynn/11079-setting-page Merge new dev
dolphinscheduler-ui/.env.development
Outdated
@@ -15,4 +15,4 @@ | |||
|
|||
NODE_ENV=development | |||
|
|||
VITE_APP_DEV_WEB_URL='http://127.0.0.1:12345' | |||
VITE_APP_DEV_WEB_URL='http://8.142.34.29:12345' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to set to the default ip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 7782c5d.
Codecov Report
@@ Coverage Diff @@
## dev #11226 +/- ##
============================================
- Coverage 40.30% 39.71% -0.60%
+ Complexity 4854 4192 -662
============================================
Files 943 1016 +73
Lines 37055 38049 +994
Branches 4073 4363 +290
============================================
+ Hits 14935 15110 +175
- Misses 20612 21193 +581
- Partials 1508 1746 +238
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Let's deal with it like this for the time being, we won't be able to release 3.2.0 in the short term, and we will be optimizing it at that time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Set up UI setting component in profile page * Add UI setting page to the route, remove UI setting section from the profile * Add log auto refresh timer store * Add logTimer to pinia store and cookies * Read logTimer from pinia store, and delay getLogs by passing the logTimer to setInterval in refreshLogs function * Add log timer to getLogs * Fine tune view log, add auto refresh based on time interval set in UI setting * Add useI18n to ui setting * Set up UI setting component in profile page * Add UI setting page to the route, remove UI setting section from the profile * Add log auto refresh timer store * Add logTimer to pinia store and cookies * Read logTimer from pinia store, and delay getLogs by passing the logTimer to setInterval in refreshLogs function * Add log timer to getLogs * Fine tune view log, add auto refresh based on time interval set in UI setting * Add useI18n to ui setting * [Feat][UI] Add UI setting page in the project. * [Feat][UI] Add UI setting page in the project. * Remove logTimer in cookies * Clear timer id, set VITE_APP_DEV_WEB_URL back to default * Clear time id in dag * [Feat][UI] Add license header. * [Feat][UI] Remove console. * [Fix][UI] Fix log timer types. Co-authored-by: songjianet <[email protected]>
* Set up UI setting component in profile page * Add UI setting page to the route, remove UI setting section from the profile * Add log auto refresh timer store * Add logTimer to pinia store and cookies * Read logTimer from pinia store, and delay getLogs by passing the logTimer to setInterval in refreshLogs function * Add log timer to getLogs * Fine tune view log, add auto refresh based on time interval set in UI setting * Add useI18n to ui setting * Set up UI setting component in profile page * Add UI setting page to the route, remove UI setting section from the profile * Add log auto refresh timer store * Add logTimer to pinia store and cookies * Read logTimer from pinia store, and delay getLogs by passing the logTimer to setInterval in refreshLogs function * Add log timer to getLogs * Fine tune view log, add auto refresh based on time interval set in UI setting * Add useI18n to ui setting * [Feat][UI] Add UI setting page in the project. * [Feat][UI] Add UI setting page in the project. * Remove logTimer in cookies * Clear timer id, set VITE_APP_DEV_WEB_URL back to default * Clear time id in dag * [Feat][UI] Add license header. * [Feat][UI] Remove console. * [Fix][UI] Fix log timer types. Co-authored-by: songjianet <[email protected]>
Purpose of the pull request
To set up a UI setting component under the profile page as a start point. Pending adding option selector to each setting, such as timer interval option.
Pending data set up in state and POST request to the backend.
This PR related: #11079
Brief change log
Verify this pull request
This pull request is code cleanup without any test coverage.
Screenshot:
Design
Need some drop-down menu user selection, eg., a drop-down menu with a timer option (1s, 2s, 10s, etc) that allow user to select the auto fresh interval.