mirror of
https://github.com/apache/druid.git
synced 2025-02-23 03:03:02 +00:00
Web-console: Add run keyboard short cut to sql-control (#7787)
* add run keyboard shortcut * add allow input
This commit is contained in:
parent
782863ed0f
commit
245eded350
@ -25,6 +25,7 @@ import {
|
||||
Popover,
|
||||
Position, ResizeSensor
|
||||
} from '@blueprintjs/core';
|
||||
import { Hotkey, Hotkeys, HotkeysTarget } from '@blueprintjs/core';
|
||||
import { IconNames } from '@blueprintjs/icons';
|
||||
import axios from 'axios';
|
||||
import * as ace from 'brace';
|
||||
@ -77,6 +78,7 @@ export interface SqlControlState {
|
||||
editorHeight: number;
|
||||
}
|
||||
|
||||
@HotkeysTarget
|
||||
export class SqlControl extends React.Component<SqlControlProps, SqlControlState> {
|
||||
constructor(props: SqlControlProps, context: any) {
|
||||
super(props, context);
|
||||
@ -303,6 +305,18 @@ export class SqlControl extends React.Component<SqlControlProps, SqlControlState
|
||||
</Menu>;
|
||||
}
|
||||
|
||||
public renderHotkeys() {
|
||||
return <Hotkeys>
|
||||
<Hotkey
|
||||
allowInInput
|
||||
global
|
||||
combo="ctrl + enter"
|
||||
label="run on click"
|
||||
onKeyDown={this.onRunClick}
|
||||
/>
|
||||
</Hotkeys>;
|
||||
}
|
||||
|
||||
render() {
|
||||
const { queryElapsed } = this.props;
|
||||
const { query, autoComplete, wrapQuery, editorHeight } = this.state;
|
||||
|
@ -16,7 +16,7 @@ exports[`describe sql view sql view snapshot 1`] = `
|
||||
<div
|
||||
className="top-pane"
|
||||
>
|
||||
<SqlControl
|
||||
<HotkeysTarget(SqlControl)
|
||||
initSql="test"
|
||||
onExplain={[Function]}
|
||||
onRun={[Function]}
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"noImplicitAny": true,
|
||||
"noEmitOnError": true,
|
||||
"declaration": false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user