Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
Questdb
提交
6b0c2575
Q
Questdb
项目概览
jobily
/
Questdb
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
Questdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
6b0c2575
编写于
10月 23, 2021
作者:
M
Maciej Bodek
提交者:
GitHub
10月 23, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore(ui): fix example query logic (#1466)
上级
3b70e403
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
34 addition
and
13 deletion
+34
-13
ui/src/consts/index.ts
ui/src/consts/index.ts
+2
-0
ui/src/scenes/Editor/Ace/index.tsx
ui/src/scenes/Editor/Ace/index.tsx
+12
-1
ui/src/scenes/Editor/QueryPicker/Row/index.tsx
ui/src/scenes/Editor/QueryPicker/Row/index.tsx
+4
-5
ui/src/scenes/Editor/QueryPicker/index.tsx
ui/src/scenes/Editor/QueryPicker/index.tsx
+13
-5
ui/src/scenes/Schema/Row/index.tsx
ui/src/scenes/Schema/Row/index.tsx
+2
-1
ui/src/store/Console/selectors.ts
ui/src/store/Console/selectors.ts
+1
-1
未找到文件。
ui/src/consts/index.ts
浏览文件 @
6b0c2575
...
...
@@ -28,6 +28,8 @@ export enum BusEvent {
MSG_EDITOR_EXECUTE_ALT
=
"
editor.execute.alt
"
,
MSG_EDITOR_FOCUS
=
"
editor.focus
"
,
MSG_EDITOR_SET
=
"
editor.set
"
,
MSG_EDITOR_INSERT_COLUMN
=
"
editor.insert.column
"
,
MSG_EDITOR_INSERT_QUERY
=
"
editor.insert.query
"
,
MSG_QUERY_CANCEL
=
"
query.in.cancel
"
,
MSG_QUERY_DATASET
=
"
query.out.dataset
"
,
MSG_QUERY_ERROR
=
"
query.out.error
"
,
...
...
ui/src/scenes/Editor/Ace/index.tsx
浏览文件 @
6b0c2575
...
...
@@ -308,11 +308,22 @@ const Ace = () => {
},
)
window
.
bus
.
on
(
"
editor.insert.column
"
,
(
_event
,
column
)
=>
{
window
.
bus
.
on
(
BusEvent
.
MSG_EDITOR_INSERT_COLUMN
,
(
_event
,
column
)
=>
{
editor
.
insert
(
column
)
editor
.
focus
()
})
window
.
bus
.
on
(
BusEvent
.
MSG_EDITOR_INSERT_QUERY
,
(
_event
,
text
)
=>
{
const
firstLine
=
editor
.
session
.
getLine
(
0
)
const
{
row
}
=
editor
.
getCursorPosition
()
const
line
=
editor
.
session
.
getLine
(
row
)
editor
.
session
.
insert
(
{
column
:
line
.
length
,
row
},
firstLine
===
""
?
text
:
`\n\n
${
text
}
`
,
)
editor
.
focus
()
})
window
.
bus
.
on
(
BusEvent
.
MSG_EDITOR_FOCUS
,
()
=>
{
editor
.
scrollToLine
(
editor
.
getCursorPosition
().
row
+
1
,
...
...
ui/src/scenes/Editor/QueryPicker/Row/index.tsx
浏览文件 @
6b0c2575
...
...
@@ -27,7 +27,6 @@ import styled, { css } from "styled-components"
import
{
FileCode
}
from
"
@styled-icons/remix-line/FileCode
"
import
{
Text
,
TransitionDuration
}
from
"
components
"
import
{
BusEvent
}
from
"
consts
"
import
{
QueryShape
}
from
"
types
"
import
{
color
}
from
"
utils
"
...
...
@@ -35,6 +34,7 @@ type Props = Readonly<{
active
:
boolean
hidePicker
:
()
=>
void
onHover
:
(
query
?:
QueryShape
)
=>
void
onAdd
:
(
query
:
QueryShape
)
=>
void
query
:
QueryShape
}
>
...
...
@@ -78,11 +78,10 @@ const Name = styled(Text)`
flex: 0 0 auto;
`
const
Row
=
({
active
,
hidePicker
,
onHover
,
query
}:
Props
)
=>
{
const
Row
=
({
active
,
onHover
,
onAdd
,
query
}:
Props
)
=>
{
const
handleClick
=
useCallback
(()
=>
{
hidePicker
()
window
.
bus
.
trigger
(
BusEvent
.
MSG_EDITOR_SET
,
query
.
value
)
},
[
hidePicker
,
query
])
onAdd
(
query
)
},
[
query
,
onAdd
])
const
handleMouseEnter
=
useCallback
(()
=>
{
onHover
(
query
)
},
[
query
,
onHover
])
...
...
ui/src/scenes/Editor/QueryPicker/index.tsx
浏览文件 @
6b0c2575
...
...
@@ -22,7 +22,7 @@
*
******************************************************************************/
import
React
,
{
forwardRef
,
Ref
,
useEffect
,
useState
}
from
"
react
"
import
React
,
{
forwardRef
,
Ref
,
use
Callback
,
use
Effect
,
useState
}
from
"
react
"
import
styled
from
"
styled-components
"
import
{
DownArrowSquare
}
from
"
@styled-icons/boxicons-solid/DownArrowSquare
"
import
{
UpArrowSquare
}
from
"
@styled-icons/boxicons-solid/UpArrowSquare
"
...
...
@@ -72,6 +72,14 @@ const QueryPicker = ({ hidePicker, queries, ref }: Props) => {
const
[
cursor
,
setCursor
]
=
useState
(
0
)
const
[
hovered
,
setHovered
]
=
useState
<
QueryShape
|
undefined
>
()
const
addQuery
=
useCallback
(
(
query
:
QueryShape
)
=>
{
hidePicker
()
window
.
bus
.
trigger
(
BusEvent
.
MSG_EDITOR_INSERT_QUERY
,
query
.
value
)
},
[
hidePicker
],
)
useEffect
(()
=>
{
if
(
queries
.
length
&&
downPress
)
{
setCursor
((
prevState
)
=>
...
...
@@ -88,10 +96,9 @@ const QueryPicker = ({ hidePicker, queries, ref }: Props) => {
useEffect
(()
=>
{
if
(
enterPress
&&
queries
[
cursor
])
{
hidePicker
()
window
.
bus
.
trigger
(
BusEvent
.
MSG_EDITOR_SET
,
queries
[
cursor
].
value
)
addQuery
(
queries
[
cursor
])
}
},
[
cursor
,
enterPress
,
hidePicker
,
queries
])
},
[
cursor
,
enterPress
,
hidePicker
,
queries
,
addQuery
])
useEffect
(()
=>
{
if
(
hovered
)
{
...
...
@@ -113,7 +120,8 @@ const QueryPicker = ({ hidePicker, queries, ref }: Props) => {
<
Row
active
=
{
i
===
cursor
}
hidePicker
=
{
hidePicker
}
key
=
{
query
.
name
}
key
=
{
query
.
value
}
onAdd
=
{
addQuery
}
onHover
=
{
setHovered
}
query
=
{
query
}
/>
...
...
ui/src/scenes/Schema/Row/index.tsx
浏览文件 @
6b0c2575
...
...
@@ -38,6 +38,7 @@ import {
TransitionDuration
,
}
from
"
components
"
import
{
color
}
from
"
utils
"
import
{
BusEvent
}
from
"
../../../consts
"
type
Props
=
Readonly
<
{
className
?:
string
...
...
@@ -143,7 +144,7 @@ const Row = ({
(
event
:
MouseEvent
)
=>
{
event
.
stopPropagation
()
window
.
bus
.
trigger
(
"
editor.insert.column
"
,
BusEvent
.
MSG_EDITOR_INSERT_COLUMN
,
kind
===
"
table
"
?
`'
${
name
}
'`
:
name
,
)
},
...
...
ui/src/store/Console/selectors.ts
浏览文件 @
6b0c2575
...
...
@@ -28,7 +28,7 @@ import { ConsoleConfigShape, StoreShape } from "types"
import
{
defaultConfig
}
from
"
./reducers
"
const
getConfig
:
(
store
:
StoreShape
)
=>
ConsoleConfigShape
=
(
store
)
=>
store
.
console
.
config
||
defaultConfig
store
.
console
.
config
??
defaultConfig
const
getSideMenuOpened
:
(
store
:
StoreShape
)
=>
boolean
=
(
store
)
=>
store
.
console
.
sideMenuOpened
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录