Skip to content
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

Fix(ui): Fix statement list initial loading #846

Merged
merged 4 commits into from
Feb 19, 2021

Conversation

shhdgit
Copy link
Member

@shhdgit shhdgit commented Feb 3, 2021

close #829

  • Set the initial loading statement to true
  • Fix initial loading statement when queryStatementList
  • Hide loading when catch errors

@CLAassistant
Copy link

CLAassistant commented Feb 3, 2021

CLA assistant check
All committers have signed the CLA.

@@ -213,7 +217,6 @@ export default function useStatementTableController(
}

if (allTimeRanges.length === 0) {
setLoadingStatements(false)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be useless statement update when queryStatementList start.

@@ -112,7 +112,7 @@ export default function useStatementTableController(
[queryOptions, allTimeRanges]
)

const [loadingStatements, setLoadingStatements] = useState(false)
const [loadingStatements, setLoadingStatements] = useState(true)
Copy link
Collaborator

@baurine baurine Feb 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember it was true before then I modified it to false, you can see the commit history to understand why it was changed. Maybe I was wrong, just for double check.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll check it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used in combination with cache item. Wow, almost made a mistake.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I think the semantics of the previous code is not clear enough and may cause bug.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will have a test when I am free.

@@ -209,11 +213,11 @@ export default function useStatementTableController(
const cacheItem = cacheMgr?.get(cacheKey)
if (cacheItem) {
setStatements(cacheItem)
setLoadingStatements(false)
Copy link
Member Author

@shhdgit shhdgit Feb 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix by this line.

@baurine
Copy link
Collaborator

baurine commented Feb 18, 2021

I will test it today.

Copy link
Collaborator

@baurine baurine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • baurine

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@baurine baurine merged commit a614fef into pingcap:master Feb 19, 2021
shhdgit added a commit to shhdgit/tidb-dashboard that referenced this pull request Feb 20, 2021
@shhdgit shhdgit deleted the fix/statement-list branch February 20, 2021 05:19
@shhdgit shhdgit changed the title Fix(ui): Fix statemtent list initial loading Fix(ui): Fix statement list initial loading Feb 24, 2021
breezewish added a commit that referenced this pull request Mar 12, 2021
* use cache for slow query and statements (#828)
* Optimize slow-query list (#835)
* keyviz: fix the bug that table info cannot be obtained if the database name contains special chars (#840)
* ui: remember the coarse scrolled position for statements and slow queries list (#843)
* ui: refine page change statistics (#839)
* fix slow query bug when order by other fields (#838)
* config: fix the bug that the dynamic config cannot be obtained when the PD starts later than the dashboard server (#842)
* Add placeholders for using scaffold (#844)
* ui: add more shared session expired duration options (#849)
* Fix(ui): Fix statemtent list initial loading (#846)
* Update github.com/oleiade/reflections to v1.0.1 to avoid checksum mismatch (#850)
* update package name (#857)
* keyviz: support obtaining table info with clustered index from tidb (#845)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix statemtent list initial loading
4 participants