Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
Questdb
提交
1a4a11b0
Q
Questdb
项目概览
jobily
/
Questdb
10 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
1a4a11b0
编写于
6月 03, 2020
作者:
M
Méril
提交者:
GitHub
6月 03, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(console): disable "Import" section when readOnly mode is on (#357)
上级
042fb230
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
74 addition
and
24 deletion
+74
-24
README.md
README.md
+2
-2
ui/src/components/Tooltip/index.tsx
ui/src/components/Tooltip/index.tsx
+6
-6
ui/src/scenes/Editor/index.tsx
ui/src/scenes/Editor/index.tsx
+20
-6
ui/src/scenes/Footer/index.tsx
ui/src/scenes/Footer/index.tsx
+0
-1
ui/src/scenes/Sidebar/index.tsx
ui/src/scenes/Sidebar/index.tsx
+46
-9
未找到文件。
README.md
浏览文件 @
1a4a11b0
<div
align=
"center"
>
<img
alt=
"QuestDB Logo"
src=
"https://raw.githubusercontent.com/questdb/questdb/master/.github/logo-readme.png"
width=
"
4
05px"
/>
<img
alt=
"QuestDB Logo"
src=
"https://raw.githubusercontent.com/questdb/questdb/master/.github/logo-readme.png"
width=
"
3
05px"
/>
</div>
<div
align=
"center"
>
<kbd><img
src=
"https://raw.githubusercontent.com/questdb/questdb/master/.github/watch.gif"
alt=
"Watch this repo"
width=
"
32
0px"
/></kbd>
<kbd><img
src=
"https://raw.githubusercontent.com/questdb/questdb/master/.github/watch.gif"
alt=
"Watch this repo"
width=
"
40
0px"
/></kbd>
</div>
<p>
</p>
...
...
ui/src/components/Tooltip/index.tsx
浏览文件 @
1a4a11b0
...
...
@@ -27,8 +27,8 @@ export const TooltipArrow = styled.div`
left: 0;
content: "";
transform: rotate(45deg);
background:
${
color
(
"
dracula
Foreground
"
)}
;
border: 1px solid
${
color
(
"
draculaBackgroundDarker
"
)}
;
background:
${
color
(
"
dracula
BackgroundDarker
"
)}
;
border: 1px solid
${
color
(
"
gray1
"
)}
;
border-radius: 1px;
}
`
...
...
@@ -36,9 +36,9 @@ export const TooltipArrow = styled.div`
export
const
Wrapper
=
styled
.
div
`
position: relative;
max-width: 260px;
padding:
0.25rem
1rem;
background:
${
color
(
"
dracula
Foreground
"
)}
;
border: 1px solid
${
color
(
"
draculaBackgroundDarker
"
)}
;
padding: 1rem;
background:
${
color
(
"
dracula
BackgroundDarker
"
)}
;
border: 1px solid
${
color
(
"
gray1
"
)}
;
border-radius: 1px;
&[data-popper-placement^="right"]
${
TooltipArrow
}
{
...
...
@@ -80,7 +80,7 @@ export const Wrapper = styled.div`
export
const
Tooltip
=
({
arrow
,
children
,
...
rest
}:
Props
)
=>
(
<
Wrapper
{
...
rest
}
>
<
Text
color
=
"
black
"
>
{
children
}
</
Text
>
<
Text
color
=
"
draculaForeground
"
>
{
children
}
</
Text
>
{
arrow
&&
<
TooltipArrow
ref
=
{
arrow
.
setArrowElement
}
style
=
{
arrow
.
styles
}
/>
}
</
Wrapper
>
)
ui/src/scenes/Editor/index.tsx
浏览文件 @
1a4a11b0
...
...
@@ -20,12 +20,26 @@ import { BusEvent } from "utils"
import
QueryPicker
from
"
./QueryPicker
"
const
Title
=
styled
(
PaneTitle
)
`
.algolia-autocomplete {
flex: 0 1 168px;
}
`
const
Separator
=
styled
.
div
`
flex: 1;
`
const
DocsearchInput
=
styled
(
Input
)
`
width: 180px;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`
const
QueryPickerButton
=
styled
(
SecondaryButton
)
`
margin: 0 1rem;
flex: 0 0 auto;
`
const
Editor
=
()
=>
{
...
...
@@ -80,7 +94,7 @@ const Editor = () => {
},
[])
return
(
<
Pane
Title
>
<
Title
>
{
running
&&
(
<
ErrorButton
onClick
=
{
handleClick
}
>
<
ControllerStop
size
=
"18px"
/>
...
...
@@ -101,10 +115,10 @@ const Editor = () => {
active
=
{
popperActive
}
onToggle
=
{
handleToggle
}
trigger
=
{
<
Secondary
Button
onClick
=
{
handleClick
}
>
<
QueryPicker
Button
onClick
=
{
handleClick
}
>
<
Plus
size
=
"18px"
/>
<
span
>
Saved queries
</
span
>
</
Secondary
Button
>
</
QueryPicker
Button
>
}
>
<
QueryPicker
hidePicker
=
{
handleHidePicker
}
queries
=
{
savedQueries
}
/>
...
...
@@ -115,10 +129,10 @@ const Editor = () => {
<
DocsearchInput
id
=
"docsearch-input"
placeholder
=
"Search documentation
...
"
placeholder
=
"Search documentation"
title
=
"Search..."
/>
</
Pane
Title
>
</
Title
>
)
}
...
...
ui/src/scenes/Footer/index.tsx
浏览文件 @
1a4a11b0
...
...
@@ -15,7 +15,6 @@ const Icons = styled.div`
display: flex;
padding-right: 1rem;
align-items: center;
font-size: 2rem;
`
const
Footer
=
()
=>
(
...
...
ui/src/scenes/Sidebar/index.tsx
浏览文件 @
1a4a11b0
import
React
,
{
useCallback
,
useEffect
,
useState
}
from
"
react
"
import
{
useSelector
}
from
"
react-redux
"
import
styled
from
"
styled-components
"
import
{
Code
}
from
"
@styled-icons/entypo/Code
"
import
{
Upload
}
from
"
@styled-icons/entypo/Upload
"
import
{
PopperHover
,
PrimaryToggleButton
,
Tooltip
}
from
"
components
"
import
{
selectors
}
from
"
store
"
import
{
color
}
from
"
utils
"
const
Wrapper
=
styled
.
div
`
...
...
@@ -38,6 +40,16 @@ const Navigation = styled(PrimaryToggleButton)<NavigationProps>`
justify-content: center;
`
const
DisabledNavigation
=
styled
.
div
`
display: flex;
position: relative;
height: 100%;
width: 100%;
flex: 0 0 5rem;
align-items: center;
justify-content: center;
`
type
Tab
=
"
console
"
|
"
import
"
const
Sidebar
=
()
=>
{
...
...
@@ -48,6 +60,7 @@ const Sidebar = () => {
const
handleImportClick
=
useCallback
(()
=>
{
setSelected
(
"
import
"
)
},
[])
const
{
readOnly
}
=
useSelector
(
selectors
.
console
.
getConfiguration
)
useEffect
(()
=>
{
const
consolePanel
=
document
.
querySelector
<
HTMLElement
>
(
"
.js-sql-panel
"
)
...
...
@@ -91,19 +104,43 @@ const Sidebar = () => {
</
PopperHover
>
<
PopperHover
delay
=
{
350
}
delay
=
{
readOnly
?
0
:
350
}
placement
=
"right"
trigger
=
{
<
Navigation
direction
=
"left"
onClick
=
{
handleImportClick
}
selected
=
{
selected
===
"
import
"
}
>
<
Upload
size
=
"16px"
/>
</
Navigation
>
readOnly
?
(
<
DisabledNavigation
>
<
Navigation
direction
=
"left"
disabled
onClick
=
{
handleImportClick
}
selected
=
{
selected
===
"
import
"
}
>
<
Upload
size
=
"16px"
/>
</
Navigation
>
</
DisabledNavigation
>
)
:
(
<
Navigation
direction
=
"left"
onClick
=
{
handleImportClick
}
selected
=
{
selected
===
"
import
"
}
>
<
Upload
size
=
"16px"
/>
</
Navigation
>
)
}
>
<
Tooltip
>
Import
</
Tooltip
>
<
Tooltip
>
{
readOnly
?
(
<>
<
b
>
Import
</
b
>
is currently disabled.
<
br
/>
To use this feature, turn
<
b
>
read-only
</
b
>
mode to
<
i
>
false
</
i
>
in
the configuration file
</>
)
:
(
<>
Import
</>
)
}
</
Tooltip
>
</
PopperHover
>
</
Wrapper
>
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录