Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
582c2263
Unverified
Commit
582c2263
authored
Aug 16, 2023
by
Licho
Committed by
GitHub
Aug 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor middle container, make model type constant, and in ide could jump to reduce (#2227)
* refactor: add STUDIO_MODEL * refactor:
parent
70555c74
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
9 deletions
+43
-9
index.tsx
...b/src/pages/DataStudio/MiddleContainer/KeyBoard/index.tsx
+2
-3
index.tsx
...src/pages/DataStudio/MiddleContainer/QuickGuide/index.tsx
+2
-3
function.tsx
dinky-web/src/pages/DataStudio/MiddleContainer/function.tsx
+1
-1
index.tsx
dinky-web/src/pages/DataStudio/MiddleContainer/index.tsx
+0
-0
model.ts
dinky-web/src/pages/DataStudio/model.ts
+38
-2
No files found.
dinky-web/src/pages/DataStudio/MiddleContainer/KeyBoard/index.tsx
View file @
582c2263
...
...
@@ -41,15 +41,14 @@ const KeyBoard = () => {
});
}
return
<>
return
(
<
Typography
style=
{
{
padding
:
'2px'
,
textAlign
:
'center'
,
border
:
'salmon'
}
}
>
<
br
/>
<
Title
level=
{
4
}
>
{
l
(
'shortcut.title'
)
}
</
Title
>
<
Paragraph
style=
{
{
padding
:
0
,
margin
:
0
,
textAlign
:
'center'
,
border
:
'salmon'
}
}
>
{
buildKeyBoard
()
}
</
Paragraph
>
</
Typography
>
</>;
</
Typography
>);
};
export
default
KeyBoard
;
dinky-web/src/pages/DataStudio/MiddleContainer/QuickGuide/index.tsx
View file @
582c2263
...
...
@@ -43,14 +43,13 @@ const QuickGuide = () => {
});
}
return
<>
return
(
<
Typography
style=
{
{
padding
:
'2px'
,
textAlign
:
'center'
,
border
:
'salmon'
}
}
>
<
Title
level=
{
4
}
>
{
l
(
'datastudio.middle.qg'
)
}
</
Title
>
<
Paragraph
style=
{
{
padding
:
0
,
margin
:
0
,
textAlign
:
'center'
,
border
:
'salmon'
}
}
>
{
buildQuickGuide
()
}
</
Paragraph
>
</
Typography
>
</>
</
Typography
>);
};
...
...
dinky-web/src/pages/DataStudio/MiddleContainer/function.tsx
View file @
582c2263
...
...
@@ -14,12 +14,12 @@ import {
}
from
"@/components/Icons/CodeLanguageIcon"
;
import
{
ClickHouseIcons
,
DorisIcons
,
HiveIcons
,
MysqlIcons
,
OracleIcons
,
PhoenixIcons
,
PostgresqlIcons
,
PrestoIcons
,
SqlServerIcons
,
StarRocksIcons
}
from
"@/components/Icons/DBIcons"
;
import
{
FolderOutlined
}
from
"@ant-design/icons"
;
export
const
getTabIcon
=
(
type
:
string
,
size
?:
number
)
=>
{
if
(
!
type
){
return
<
FileIcon
/>;
}
switch
(
type
.
toLowerCase
())
{
case
DIALECT
.
JAVA
:
return
<
JavaSvg
/>;
...
...
dinky-web/src/pages/DataStudio/MiddleContainer/index.tsx
View file @
582c2263
This diff is collapsed.
Click to expand it.
dinky-web/src/pages/DataStudio/model.ts
View file @
582c2263
...
...
@@ -273,9 +273,45 @@ export type ModelType = {
updateJobRunningMsg
:
Reducer
<
StateType
>
;
};
};
const
Model
:
ModelType
=
{
namespace
:
'Studio'
,
const
ModelTypeName
=
'Studio'
;
const
getModelType
=
(
name
:
string
)
=>
{
return
`
${
ModelTypeName
}
/
${
name
}
`
;
}
export
const
STUDIO_MODEL
:
{[
K
in
keyof
ModelType
[
'reducers'
]]:
string
}
=
{
updateToolContentHeight
:
getModelType
(
'updateToolContentHeight'
),
updateCenterContentHeight
:
getModelType
(
'updateCenterContentHeight'
),
updateSelectLeftKey
:
getModelType
(
'updateSelectLeftKey'
),
updateLeftWidth
:
getModelType
(
'updateLeftWidth'
),
updateSelectRightKey
:
getModelType
(
'updateSelectRightKey'
),
updateRightWidth
:
getModelType
(
'updateRightWidth'
),
updateSelectBottomKey
:
getModelType
(
'updateSelectBottomKey'
),
updateSelectBottomSubKey
:
getModelType
(
'updateSelectBottomSubKey'
),
updateBottomHeight
:
getModelType
(
'updateBottomHeight'
),
saveDataBase
:
getModelType
(
'saveDataBase'
),
saveProject
:
getModelType
(
'saveProject'
),
updateTabsActiveKey
:
getModelType
(
'updateTabsActiveKey'
),
closeTab
:
getModelType
(
'closeTab'
),
removeTag
:
getModelType
(
'removeTag'
),
addTab
:
getModelType
(
'addTab'
),
saveTabs
:
getModelType
(
'saveTabs'
),
closeAllTabs
:
getModelType
(
'closeAllTabs'
),
closeOtherTabs
:
getModelType
(
'closeOtherTabs'
),
updateSelectDatabaseId
:
getModelType
(
'updateSelectDatabaseId'
),
updateDatabaseExpandKey
:
getModelType
(
'updateDatabaseExpandKey'
),
updateDatabaseSelectKey
:
getModelType
(
'updateDatabaseSelectKey'
),
updateBottomConsole
:
getModelType
(
'updateBottomConsole'
),
saveSession
:
getModelType
(
'saveSession'
),
saveClusterConfiguration
:
getModelType
(
'saveClusterConfiguration'
),
saveEnv
:
getModelType
(
'saveEnv'
),
saveFooterValue
:
getModelType
(
'saveFooterValue'
),
updateJobRunningMsg
:
getModelType
(
'updateJobRunningMsg'
),
};
const
Model
:
ModelType
=
{
namespace
:
ModelTypeName
,
state
:
{
isFullScreen
:
false
,
toolContentHeight
:
0
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment