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

Refine ClusterInfo & Instance #591

Merged
merged 17 commits into from
Jun 8, 2020
Merged

Refine ClusterInfo & Instance #591

merged 17 commits into from
Jun 8, 2020

Conversation

breezewish
Copy link
Member

@breezewish breezewish commented Jun 2, 2020

  1. Add manualTestEnv for easier testing. You can use Vagrant to establish the environment. See README in each directory for details.

  2. Refined cluster info from getTopology to getTiDB, getStores, getPD, ...

  3. Introduce pd.Client to backend, which gracefully handles context.

  4. Share TiKV & TiFlash cluster info logic

  5. Remove animations from sider menu to be efficient

  6. Add a DebugPlayground App (TODO: Use Storybook instead @baurine )

  7. Introduce <BaseSelect>, which is a <Select> like component with customization support for the drop content or displayed value

    image

  8. Introduce <InstanceSelect> based on <BaseSelect> to provide a nice UI for selecting multiple instances

    image
    image
    image

It is compatible with Antd form validation:

image

  1. Now Overview is composed by self-managed components (except for Statement & Slow Query -- TODO: Refine them @baurine) instead of sharing some states.

    This makes it possible to allow user customizing the Overview page in future.

  2. Update Overview page UI:

image

  1. Introduce utils/instanceTable to contain everything common about instances (like instance names and variants)

  2. Add more time slots to <TimeRangeSelector>

image

  1. Remove unused <CardTable> (TODO: Rename <CardTableV2> to <CardTable> @baurine)

  2. Update <CardTableV2> to have a correct Checkbox display when there are group headers. (TODO: Drop implementation after DetailsList onRenderCheckbox is not effective for group headers microsoft/fluentui#13144 is merged)

  3. Slightly refine <TimeRangeSelector>

  4. Refine LogSearch to use <InstanceSelect> and utils/instanceTable (and use treeData in <Tree> component)

  5. Add useCallback, useMemo, usePersistFn to several places to reduce unnecessary re-render.

TODO:

  • Test whether "Delete TiDB node" still works

Call for help:

  • This PR has been proposed for a long time and I may made some mistakes (e.g. forget updating something). Please test / play with this PR as much as possible!

@HunDunDM HunDunDM self-requested a review June 3, 2020 03:24
[LogLevel.Warn]: 'WARN',
[LogLevel.Trace]: 'TRACE',
[LogLevel.Critical]: 'CRITICAL',
[LogLevel.Error]: 'ERROR',
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems ok to define the LogLevelText as an Array, likes:

export const LogLevelText = ['UNKNOWN', 'DEBUG' ...]

But this is not a big deal, just simplify the code slightly.

Copy link
Member Author

Choose a reason for hiding this comment

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

It relies on the value of log levels to work, might not be very ideal.

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 for frontend part.

@baurine
Copy link
Collaborator

baurine commented Jun 3, 2020

image

image

Pause a PD node in the virtual box, the PD status seems not correct. And not sure why the TiDB node is "unknown", it works fine actually.

@breezewish
Copy link
Member Author

@baurine Good catch! Let me take a look

Signed-off-by: Breezewish <me@breeswish.org>
@breezewish breezewish merged commit ca11e4d into master Jun 8, 2020
@breezewish breezewish deleted the label branch June 8, 2020 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants