-
Notifications
You must be signed in to change notification settings - Fork 136
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
feature: Query Editor #713
Conversation
Signed-off-by: Breezewish <[email protected]>
Signed-off-by: Breezewish <[email protected]>
} | ||
setRunning(false) | ||
editor.current?.editor.focus() | ||
}, []) |
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.
Not sure whether we can use useClientRequest()
to simplify the code like this:
const {data, isLoading, error, sendRequest: handleRun} = useClientRequest((cancelToken) =>
client.getInstance().queryEditorRun({
max_rows: MAX_DISPLAY_ROWS,
statements: editor.current?.editor.getValue(),
}, {cancelToken}),
{ immediate: false, afterRequest: () => editor.current?.editor.focus() }
)
Then we don't need results
and isRunning
anymore.
For error, we can show an ErrorBar component instead of Modal.error()
.
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.
Let me try 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.
Unlike queries, for operational errors mostly there will be a modal dialog to stop further user actions. Displaying modal dialog using this pattern can be pretty hard.
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.
the rest LGTM!
Signed-off-by: Breezewish <[email protected]> (cherry picked from commit 2a372d4)
* feature: Query Editor (#713) * Backend: replace UNIX_TIMESTAMP with FROM_UNIXTIME in statement query (#731) * test: Stablize e2e tests (#732) * ui: Add store location tree (#728) * log_search: Display instance port (#722) * ui: show store location topology (#719) * ui: Online Config (#733) * ui: Support sharing session (#741) * doc: Update to sig-diagnosis (#742) * statement: Display number of plans in the list (#746) * log search: return zip instead of tar or gzip (#724)
This PR impls a new feature Query Editor, as below: