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
eb0b5714
Unverified
Commit
eb0b5714
authored
Dec 15, 2023
by
ZackYoung
Committed by
GitHub
Dec 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Web]Fix datastudio layout (#2650)
* fix_datastudio_layout
parent
d64e6eb7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
725 additions
and
740 deletions
+725
-740
ConsoleContent.tsx
...ges/DataStudio/BottomContainer/Console/ConsoleContent.tsx
+3
-3
model.ts
dinky-web/src/pages/DataStudio/model.ts
+722
-737
No files found.
dinky-web/src/pages/DataStudio/BottomContainer/Console/ConsoleContent.tsx
View file @
eb0b5714
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
import
CodeShow
from
'@/components/CustomEditor/CodeShow'
;
import
CodeShow
from
'@/components/CustomEditor/CodeShow'
;
import
{
SseData
}
from
'@/models/Sse'
;
import
{
SseData
}
from
'@/models/Sse'
;
import
{
DataStudioTabsItemType
,
StateType
}
from
'@/pages/DataStudio/model'
;
import
{
DataStudioTabsItemType
,
StateType
,
VIEW
}
from
'@/pages/DataStudio/model'
;
import
{
SSE_TOPIC
}
from
'@/pages/DevOps/constants'
;
import
{
SSE_TOPIC
}
from
'@/pages/DevOps/constants'
;
import
{
API_CONSTANTS
}
from
'@/services/endpoints'
;
import
{
API_CONSTANTS
}
from
'@/services/endpoints'
;
import
{
parseMilliSecondStr
}
from
'@/utils/function'
;
import
{
parseMilliSecondStr
}
from
'@/utils/function'
;
...
@@ -139,7 +139,7 @@ const ConsoleContent = (props: ConsoleProps) => {
...
@@ -139,7 +139,7 @@ const ConsoleContent = (props: ConsoleProps) => {
};
};
return
(
return
(
<
div
style=
{
{
height
:
props
.
height
-
53
}
}
>
<
div
style=
{
{
height
:
props
.
height
-
VIEW
.
leftMargin
}
}
>
<
SplitPane
<
SplitPane
split=
{
'vertical'
}
split=
{
'vertical'
}
defaultSizes=
{
[
100
,
500
]
}
defaultSizes=
{
[
100
,
500
]
}
...
@@ -178,7 +178,7 @@ const ConsoleContent = (props: ConsoleProps) => {
...
@@ -178,7 +178,7 @@ const ConsoleContent = (props: ConsoleProps) => {
>
>
<
CodeShow
<
CodeShow
code=
{
selectNode
?.
log
?
selectNode
.
log
:
''
}
code=
{
selectNode
?.
log
?
selectNode
.
log
:
''
}
height=
{
props
.
height
-
53
}
height=
{
props
.
height
-
VIEW
.
leftMargin
}
language=
{
'javalog'
}
language=
{
'javalog'
}
lineNumbers=
{
'off'
}
lineNumbers=
{
'off'
}
enableMiniMap
enableMiniMap
...
...
dinky-web/src/pages/DataStudio/model.ts
View file @
eb0b5714
...
@@ -17,21 +17,21 @@
...
@@ -17,21 +17,21 @@
*
*
*/
*/
import
{
getFooterValue
,
isDataStudioTabsItemType
}
from
'@/pages/DataStudio/function'
;
import
{
getFooterValue
,
isDataStudioTabsItemType
}
from
'@/pages/DataStudio/function'
;
import
{
getTaskData
}
from
'@/pages/DataStudio/LeftContainer/Project/service'
;
import
{
getTaskData
}
from
'@/pages/DataStudio/LeftContainer/Project/service'
;
import
{
import
{
getFlinkConfigs
,
getFlinkConfigs
,
querySuggessionData
querySuggessionData
}
from
'@/pages/DataStudio/RightContainer/JobConfig/service'
;
}
from
'@/pages/DataStudio/RightContainer/JobConfig/service'
;
import
{
QueryParams
}
from
'@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/data'
;
import
{
QueryParams
}
from
'@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/data'
;
import
{
SuggestionInfo
}
from
'@/types/Public/data'
;
import
{
SuggestionInfo
}
from
'@/types/Public/data'
;
import
{
Cluster
,
DataSources
}
from
'@/types/RegCenter/data'
;
import
{
Cluster
,
DataSources
}
from
'@/types/RegCenter/data'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
createModelTypes
}
from
'@/utils/modelUtils'
;
import
{
createModelTypes
}
from
'@/utils/modelUtils'
;
import
{
Effect
,
Reducer
}
from
'@@/plugin-dva/types'
;
import
{
Effect
,
Reducer
}
from
'@@/plugin-dva/types'
;
import
{
Monaco
}
from
'@monaco-editor/react'
;
import
{
Monaco
}
from
'@monaco-editor/react'
;
import
{
DefaultOptionType
}
from
'antd/es/select'
;
import
{
DefaultOptionType
}
from
'antd/es/select'
;
import
{
editor
}
from
'monaco-editor'
;
import
{
editor
}
from
'monaco-editor'
;
import
React
from
'react'
;
import
React
from
'react'
;
import
ICodeEditor
=
editor
.
ICodeEditor
;
import
ICodeEditor
=
editor
.
ICodeEditor
;
...
@@ -39,844 +39,829 @@ import ICodeEditor = editor.ICodeEditor;
...
@@ -39,844 +39,829 @@ import ICodeEditor = editor.ICodeEditor;
* 初始化布局宽高度
* 初始化布局宽高度
*/
*/
export
const
VIEW
=
{
export
const
VIEW
=
{
headerHeight
:
32
,
headerHeight
:
32
,
headerNavHeight
:
56
,
headerNavHeight
:
56
,
footerHeight
:
25
,
footerHeight
:
25
,
sideWidth
:
40
,
sideWidth
:
40
,
leftToolWidth
:
180
,
leftToolWidth
:
180
,
marginTop
:
84
,
marginTop
:
84
,
topHeight
:
35.6
,
topHeight
:
35.6
,
bottomHeight
:
100
,
bottomHeight
:
100
,
rightMargin
:
32
,
rightMargin
:
32
,
leftMargin
:
36
,
leftMargin
:
36
,
midMargin
:
44
,
midMargin
:
44
,
otherHeight
:
0
,
otherHeight
:
0
,
paddingInline
:
50
paddingInline
:
50
};
};
export
type
SqlMetaData
=
{
export
type
SqlMetaData
=
{
statement
?:
string
;
statement
?:
string
;
metaData
?:
MetaData
[];
metaData
?:
MetaData
[];
};
};
export
type
MetaData
=
{
export
type
MetaData
=
{
table
:
string
;
table
:
string
;
connector
:
string
;
connector
:
string
;
columns
:
Column
[];
columns
:
Column
[];
};
};
export
type
Column
=
{
export
type
Column
=
{
name
:
string
;
name
:
string
;
type
:
string
;
type
:
string
;
};
};
type
TargetKey
=
React
.
MouseEvent
|
React
.
KeyboardEvent
|
number
;
type
TargetKey
=
React
.
MouseEvent
|
React
.
KeyboardEvent
|
number
;
export
type
EnvType
=
{
export
type
EnvType
=
{
id
?:
number
;
id
?:
number
;
name
?:
string
;
name
?:
string
;
fragment
?:
boolean
;
fragment
?:
boolean
;
};
};
export
type
TaskType
=
{
export
type
TaskType
=
{
id
?:
number
;
id
?:
number
;
catalogueId
?:
number
;
catalogueId
?:
number
;
name
?:
string
;
name
?:
string
;
dialect
?:
string
;
dialect
?:
string
;
type
?:
string
;
type
?:
string
;
checkPoint
?:
number
;
checkPoint
?:
number
;
savePointStrategy
?:
number
;
savePointStrategy
?:
number
;
savePointPath
?:
string
;
savePointPath
?:
string
;
parallelism
?:
number
;
parallelism
?:
number
;
fragment
?:
boolean
;
fragment
?:
boolean
;
statementSet
?:
boolean
;
statementSet
?:
boolean
;
batchModel
?:
boolean
;
batchModel
?:
boolean
;
config
?:
[];
config
?:
[];
clusterId
?:
any
;
clusterId
?:
any
;
clusterName
?:
string
;
clusterName
?:
string
;
clusterConfigurationId
?:
number
;
clusterConfigurationId
?:
number
;
clusterConfigurationName
?:
string
;
clusterConfigurationName
?:
string
;
databaseId
?:
number
;
databaseId
?:
number
;
databaseName
?:
string
;
databaseName
?:
string
;
envId
?:
number
;
envId
?:
number
;
jobInstanceId
?:
number
;
jobInstanceId
?:
number
;
note
?:
string
;
note
?:
string
;
enabled
?:
boolean
;
enabled
?:
boolean
;
createTime
?:
Date
;
createTime
?:
Date
;
updateTime
?:
Date
;
updateTime
?:
Date
;
statement
?:
string
;
statement
?:
string
;
session
:
string
;
session
:
string
;
maxRowNum
:
number
;
maxRowNum
:
number
;
jobName
:
string
;
jobName
:
string
;
useChangeLog
:
boolean
;
useChangeLog
:
boolean
;
useAutoCancel
:
boolean
;
useAutoCancel
:
boolean
;
};
};
export
type
ConsoleType
=
{
export
type
ConsoleType
=
{
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/ban-types
result
:
{};
result
:
{};
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/ban-types
chart
:
{};
chart
:
{};
};
};
export
type
MetadataParams
=
{
export
type
MetadataParams
=
{
queryParams
:
QueryParams
;
queryParams
:
QueryParams
;
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/ban-types
tableInfo
:
{};
tableInfo
:
{};
};
};
export
type
TaskDataBaseType
=
{
export
type
TaskDataBaseType
=
{
id
:
number
;
id
:
number
;
name
:
string
;
name
:
string
;
statement
:
string
;
statement
:
string
;
dialect
:
string
;
dialect
:
string
;
step
:
number
;
step
:
number
;
// Only common sql has(只有普通sql才有)
// Only common sql has(只有普通sql才有)
databaseId
?:
number
;
databaseId
?:
number
;
envId
?:
number
;
envId
?:
number
;
};
};
export
type
TaskDataType
=
TaskDataBaseType
&
Record
<
string
,
any
>
;
export
type
TaskDataType
=
TaskDataBaseType
&
Record
<
string
,
any
>
;
export
type
DataStudioParams
=
{
export
type
DataStudioParams
=
{
taskId
:
number
;
taskId
:
number
;
taskData
:
TaskDataType
;
taskData
:
TaskDataType
;
};
};
export
enum
TabsPageType
{
export
enum
TabsPageType
{
None
=
''
,
None
=
''
,
metadata
=
'metadata'
,
metadata
=
'metadata'
,
project
=
'project'
project
=
'project'
}
}
export
enum
TabsPageSubType
{
export
enum
TabsPageSubType
{
flinkSql
=
'FlinkSql'
,
flinkSql
=
'FlinkSql'
,
flinkJar
=
'FlinkJar'
,
flinkJar
=
'FlinkJar'
,
None
=
''
None
=
''
}
}
export
interface
TabsItemType
{
export
interface
TabsItemType
{
id
:
string
;
id
:
string
;
label
:
string
;
label
:
string
;
breadcrumbLabel
:
string
;
breadcrumbLabel
:
string
;
type
:
TabsPageType
;
type
:
TabsPageType
;
subType
?:
TabsPageSubType
;
subType
?:
TabsPageSubType
;
key
:
string
;
key
:
string
;
treeKey
:
number
;
treeKey
:
number
;
value
:
string
;
value
:
string
;
icon
:
any
;
icon
:
any
;
closable
:
boolean
;
closable
:
boolean
;
path
:
string
[];
path
:
string
[];
monacoInstance
:
React
.
RefObject
<
Monaco
|
undefined
>
;
monacoInstance
:
React
.
RefObject
<
Monaco
|
undefined
>
;
console
:
ConsoleType
;
console
:
ConsoleType
;
isModified
:
boolean
;
isModified
:
boolean
;
}
}
export
interface
MetadataTabsItemType
extends
TabsItemType
{
export
interface
MetadataTabsItemType
extends
TabsItemType
{
params
:
MetadataParams
;
params
:
MetadataParams
;
sqlMetaData
?:
SqlMetaData
;
sqlMetaData
?:
SqlMetaData
;
metaStore
?:
MetaStoreCatalogType
[];
metaStore
?:
MetaStoreCatalogType
[];
}
}
export
interface
DataStudioTabsItemType
extends
TabsItemType
{
export
interface
DataStudioTabsItemType
extends
TabsItemType
{
task
?:
TaskType
;
task
?:
TaskType
;
monaco
?:
ICodeEditor
;
monaco
?:
ICodeEditor
;
params
:
DataStudioParams
;
params
:
DataStudioParams
;
}
}
export
type
TabsType
=
{
export
type
TabsType
=
{
activeKey
:
string
;
activeKey
:
string
;
activeBreadcrumbTitle
:
string
;
activeBreadcrumbTitle
:
string
;
panes
:
TabsItemType
[];
panes
:
TabsItemType
[];
};
};
export
type
ConnectorType
=
{
export
type
ConnectorType
=
{
tableName
:
string
;
tableName
:
string
;
};
};
export
type
MetaStoreCatalogType
=
{
export
type
MetaStoreCatalogType
=
{
name
:
string
;
name
:
string
;
databases
:
MetaStoreDataBaseType
[];
databases
:
MetaStoreDataBaseType
[];
};
};
export
type
MetaStoreDataBaseType
=
{
export
type
MetaStoreDataBaseType
=
{
name
:
string
;
name
:
string
;
tables
:
MetaStoreTableType
[];
tables
:
MetaStoreTableType
[];
views
:
string
[];
views
:
string
[];
functions
:
string
[];
functions
:
string
[];
userFunctions
:
string
[];
userFunctions
:
string
[];
modules
:
string
[];
modules
:
string
[];
};
};
export
type
MetaStoreTableType
=
{
export
type
MetaStoreTableType
=
{
name
:
string
;
name
:
string
;
columns
:
MetaStoreColumnType
[];
columns
:
MetaStoreColumnType
[];
};
};
export
type
MetaStoreColumnType
=
{
export
type
MetaStoreColumnType
=
{
name
:
string
;
name
:
string
;
type
:
string
;
type
:
string
;
};
};
export
type
Container
=
{
export
type
Container
=
{
selectKey
:
string
;
selectKey
:
string
;
selectSubKey
:
{
[
c
:
string
]:
string
};
selectSubKey
:
{
[
c
:
string
]:
string
};
height
:
number
|
string
;
height
:
number
|
string
;
width
:
number
|
string
;
width
:
number
|
string
;
maxWidth
?:
number
|
string
;
maxWidth
?:
number
|
string
;
};
};
export
type
BottomContainerContent
=
{
export
type
BottomContainerContent
=
{
console
:
string
;
console
:
string
;
};
};
export
type
SessionType
=
{
export
type
SessionType
=
{
session
?:
string
;
session
?:
string
;
sessionConfig
?:
{
sessionConfig
?:
{
type
?:
string
;
type
?:
string
;
clusterId
?:
number
;
clusterId
?:
number
;
clusterName
?:
string
;
clusterName
?:
string
;
address
?:
string
;
address
?:
string
;
};
};
createUser
?:
string
;
createUser
?:
string
;
createTime
?:
string
;
createTime
?:
string
;
connectors
:
ConnectorType
[];
connectors
:
ConnectorType
[];
};
};
/**
/**
* job running type msg
* job running type msg
*/
*/
export
type
JobRunningMsgType
=
{
export
type
JobRunningMsgType
=
{
taskId
:
number
|
null
;
taskId
:
number
|
null
;
jobName
:
string
;
jobName
:
string
;
jobState
:
string
;
jobState
:
string
;
runningLog
:
string
;
runningLog
:
string
;
};
};
/**
/**
* footer
* footer
*/
*/
export
type
FooterType
=
{
export
type
FooterType
=
{
codePosition
:
[
number
,
number
];
codePosition
:
[
number
,
number
];
space
:
number
;
space
:
number
;
codeEncoding
:
string
;
codeEncoding
:
string
;
lineSeparator
:
string
;
lineSeparator
:
string
;
codeType
:
string
;
codeType
:
string
;
memDetails
:
string
;
memDetails
:
string
;
jobRunningMsg
:
JobRunningMsgType
;
jobRunningMsg
:
JobRunningMsgType
;
};
};
/**
/**
* state type overview
* state type overview
*/
*/
export
type
StateType
=
{
export
type
StateType
=
{
isFullScreen
:
boolean
;
isFullScreen
:
boolean
;
toolContentHeight
:
number
;
toolContentHeight
:
number
;
centerContentHeight
:
number
;
centerContentHeight
:
number
;
leftContainer
:
Container
;
leftContainer
:
Container
;
rightContainer
:
Container
;
rightContainer
:
Container
;
bottomContainer
:
Container
;
bottomContainer
:
Container
;
database
:
{
database
:
{
dbData
:
DataSources
.
DataSource
[];
dbData
:
DataSources
.
DataSource
[];
selectDatabaseId
:
number
|
null
;
selectDatabaseId
:
number
|
null
;
expandKeys
:
[];
expandKeys
:
[];
selectKey
:
[];
selectKey
:
[];
};
};
project
:
{
project
:
{
data
:
any
[];
data
:
any
[];
// selectId: number | null;
// selectId: number | null;
expandKeys
:
[];
expandKeys
:
[];
selectKey
:
[];
selectKey
:
[];
};
};
sessionCluster
:
Cluster
.
Instance
[];
sessionCluster
:
Cluster
.
Instance
[];
clusterConfiguration
:
Cluster
.
Config
[];
clusterConfiguration
:
Cluster
.
Config
[];
flinkConfigOptions
:
DefaultOptionType
[];
flinkConfigOptions
:
DefaultOptionType
[];
env
:
EnvType
[];
env
:
EnvType
[];
tabs
:
TabsType
;
tabs
:
TabsType
;
bottomContainerContent
:
BottomContainerContent
;
bottomContainerContent
:
BottomContainerContent
;
footContainer
:
FooterType
;
footContainer
:
FooterType
;
suggestions
:
SuggestionInfo
[];
suggestions
:
SuggestionInfo
[];
};
};
export
type
ModelType
=
{
export
type
ModelType
=
{
namespace
:
string
;
namespace
:
string
;
state
:
StateType
;
state
:
StateType
;
effects
:
{
effects
:
{
queryProject
:
Effect
;
queryProject
:
Effect
;
queryFlinkConfigOptions
:
Effect
;
queryFlinkConfigOptions
:
Effect
;
querySuggestions
:
Effect
;
querySuggestions
:
Effect
;
};
};
reducers
:
{
reducers
:
{
updateToolContentHeight
:
Reducer
<
StateType
>
;
updateToolContentHeight
:
Reducer
<
StateType
>
;
updateCenterContentHeight
:
Reducer
<
StateType
>
;
updateCenterContentHeight
:
Reducer
<
StateType
>
;
updateSelectLeftKey
:
Reducer
<
StateType
>
;
updateSelectLeftKey
:
Reducer
<
StateType
>
;
updateLeftWidth
:
Reducer
<
StateType
>
;
updateLeftWidth
:
Reducer
<
StateType
>
;
updateSelectRightKey
:
Reducer
<
StateType
>
;
updateSelectRightKey
:
Reducer
<
StateType
>
;
updateRightWidth
:
Reducer
<
StateType
>
;
updateRightWidth
:
Reducer
<
StateType
>
;
updateSelectBottomKey
:
Reducer
<
StateType
>
;
updateSelectBottomKey
:
Reducer
<
StateType
>
;
updateSelectBottomSubKey
:
Reducer
<
StateType
>
;
updateSelectBottomSubKey
:
Reducer
<
StateType
>
;
updateBottomHeight
:
Reducer
<
StateType
>
;
updateBottomHeight
:
Reducer
<
StateType
>
;
saveDataBase
:
Reducer
<
StateType
>
;
saveDataBase
:
Reducer
<
StateType
>
;
saveProject
:
Reducer
<
StateType
>
;
saveProject
:
Reducer
<
StateType
>
;
updateProjectExpandKey
:
Reducer
<
StateType
>
;
updateProjectExpandKey
:
Reducer
<
StateType
>
;
updateProjectSelectKey
:
Reducer
<
StateType
>
;
updateProjectSelectKey
:
Reducer
<
StateType
>
;
updateTabsActiveKey
:
Reducer
<
StateType
>
;
updateTabsActiveKey
:
Reducer
<
StateType
>
;
closeTab
:
Reducer
<
StateType
>
;
closeTab
:
Reducer
<
StateType
>
;
removeTag
:
Reducer
<
StateType
>
;
removeTag
:
Reducer
<
StateType
>
;
addTab
:
Reducer
<
StateType
>
;
addTab
:
Reducer
<
StateType
>
;
saveTabs
:
Reducer
<
StateType
>
;
saveTabs
:
Reducer
<
StateType
>
;
closeAllTabs
:
Reducer
<
StateType
>
;
closeAllTabs
:
Reducer
<
StateType
>
;
closeOtherTabs
:
Reducer
<
StateType
>
;
closeOtherTabs
:
Reducer
<
StateType
>
;
updateSelectDatabaseId
:
Reducer
<
StateType
>
;
updateSelectDatabaseId
:
Reducer
<
StateType
>
;
updateDatabaseExpandKey
:
Reducer
<
StateType
>
;
updateDatabaseExpandKey
:
Reducer
<
StateType
>
;
updateDatabaseSelectKey
:
Reducer
<
StateType
>
;
updateDatabaseSelectKey
:
Reducer
<
StateType
>
;
updateBottomConsole
:
Reducer
<
StateType
>
;
updateBottomConsole
:
Reducer
<
StateType
>
;
saveSession
:
Reducer
<
StateType
>
;
saveSession
:
Reducer
<
StateType
>
;
saveClusterConfiguration
:
Reducer
<
StateType
>
;
saveClusterConfiguration
:
Reducer
<
StateType
>
;
saveEnv
:
Reducer
<
StateType
>
;
saveEnv
:
Reducer
<
StateType
>
;
saveFooterValue
:
Reducer
<
StateType
>
;
saveFooterValue
:
Reducer
<
StateType
>
;
updateJobRunningMsg
:
Reducer
<
StateType
>
;
updateJobRunningMsg
:
Reducer
<
StateType
>
;
saveFlinkConfigOptions
:
Reducer
<
StateType
>
;
saveFlinkConfigOptions
:
Reducer
<
StateType
>
;
updateSuggestions
:
Reducer
<
StateType
>
;
updateSuggestions
:
Reducer
<
StateType
>
;
};
};
};
};
const
Model
:
ModelType
=
{
const
Model
:
ModelType
=
{
namespace
:
'Studio'
,
namespace
:
'Studio'
,
state
:
{
state
:
{
isFullScreen
:
false
,
isFullScreen
:
false
,
toolContentHeight
:
0
,
toolContentHeight
:
0
,
centerContentHeight
:
0
,
centerContentHeight
:
0
,
leftContainer
:
{
selectKey
:
'menu.datastudio.project'
,
selectSubKey
:
{},
height
:
'100%'
,
width
:
260
},
rightContainer
:
{
selectKey
:
''
,
selectSubKey
:
{},
height
:
'100%'
,
width
:
260
},
bottomContainer
:
{
selectKey
:
'menu.datastudio.console'
,
selectSubKey
:
{},
height
:
180
,
width
:
'100%'
},
database
:
{
dbData
:
[],
selectDatabaseId
:
null
,
expandKeys
:
[],
selectKey
:
[]
},
project
:
{
data
:
[],
expandKeys
:
[],
selectKey
:
[]
},
tabs
:
{
activeBreadcrumbTitle
:
''
,
activeKey
:
'0'
,
panes
:
[]
},
bottomContainerContent
:
{
console
:
''
},
sessionCluster
:
[],
clusterConfiguration
:
[],
flinkConfigOptions
:
[],
env
:
[],
footContainer
:
{
codePosition
:
[
1
,
1
],
space
:
2
,
codeEncoding
:
'UTF-8'
,
lineSeparator
:
'LF'
,
codeType
:
''
,
memDetails
:
'100/500M'
,
jobRunningMsg
:
{
taskId
:
null
,
jobName
:
''
,
jobState
:
''
,
runningLog
:
''
}
},
suggestions
:
[]
},
effects
:
{
*
queryProject
({
payload
},
{
call
,
put
})
{
const
response
:
[]
=
yield
call
(
getTaskData
,
payload
);
yield
put
({
type
:
'saveProject'
,
payload
:
response
});
},
*
queryFlinkConfigOptions
({
payload
},
{
call
,
put
})
{
const
response
:
[]
=
yield
call
(
getFlinkConfigs
,
payload
);
yield
put
({
type
:
'saveFlinkConfigOptions'
,
payload
:
response
});
},
*
querySuggestions
({
payload
},
{
call
,
put
})
{
const
response
:
SuggestionInfo
[]
=
yield
call
(
querySuggessionData
,
payload
);
yield
put
({
type
:
'updateSuggestions'
,
payload
:
response
});
}
},
reducers
:
{
/**
* 更新工具栏高度
*/
updateToolContentHeight
(
state
,
{
payload
})
{
if
(
payload
!=
state
.
toolContentHeight
)
{
return
{
...
state
,
toolContentHeight
:
payload
};
}
return
state
;
},
/**
* 更新中间内容高度
*/
updateCenterContentHeight
(
state
,
{
payload
})
{
if
(
payload
!=
state
.
centerContentHeight
)
{
return
{
...
state
,
centerContentHeight
:
payload
};
}
return
state
;
},
/**
* 更新左侧选中key
*/
updateSelectLeftKey
(
state
,
{
payload
})
{
return
{
...
state
,
leftContainer
:
{
...
state
.
leftContainer
,
selectKey
:
payload
,
label
:
payload
.
trim
()
===
''
?
''
:
l
(
payload
)
}
};
},
/**
* 更新左侧宽度
*/
updateLeftWidth
(
state
,
{
payload
})
{
return
{
...
state
,
leftContainer
:
{
leftContainer
:
{
...
state
.
leftContainer
,
selectKey
:
'menu.datastudio.project'
,
width
:
payload
selectSubKey
:
{},
}
height
:
'100%'
,
};
width
:
260
},
},
/**
* 更新右侧选中key
*/
updateSelectRightKey
(
state
,
{
payload
})
{
return
{
...
state
,
rightContainer
:
{
...
state
.
rightContainer
,
selectKey
:
payload
}
};
},
/**
* 更新右侧选中key
*/
updateRightWidth
(
state
,
{
payload
})
{
return
{
...
state
,
rightContainer
:
{
rightContainer
:
{
...
state
.
rightContainer
,
selectKey
:
''
,
width
:
payload
selectSubKey
:
{},
}
height
:
'100%'
,
};
width
:
260
},
},
/**
* 更新底部选中key
*/
updateSelectBottomKey
(
state
,
{
payload
})
{
let
centerContentHeight
=
0
;
let
toolContentHeight
=
0
;
if
(
payload
===
''
)
{
centerContentHeight
=
state
.
centerContentHeight
+
(
state
.
bottomContainer
.
height
as
number
);
toolContentHeight
=
state
.
toolContentHeight
+
(
state
.
bottomContainer
.
height
as
number
);
}
else
if
(
state
.
bottomContainer
.
selectKey
!==
''
&&
payload
!==
state
.
bottomContainer
.
selectKey
)
{
centerContentHeight
=
state
.
centerContentHeight
;
toolContentHeight
=
state
.
toolContentHeight
;
}
else
{
if
(
state
.
centerContentHeight
>
state
.
bottomContainer
.
height
)
{
centerContentHeight
=
state
.
centerContentHeight
-
(
state
.
bottomContainer
.
height
as
number
);
toolContentHeight
=
state
.
toolContentHeight
-
(
state
.
bottomContainer
.
height
as
number
);
}
else
{
centerContentHeight
=
state
.
centerContentHeight
;
toolContentHeight
=
state
.
toolContentHeight
;
}
}
return
{
...
state
,
centerContentHeight
:
centerContentHeight
,
toolContentHeight
:
toolContentHeight
,
bottomContainer
:
{
...
state
.
bottomContainer
,
selectKey
:
payload
}
};
},
updateSelectBottomSubKey
(
state
,
{
payload
})
{
return
{
...
state
,
bottomContainer
:
{
bottomContainer
:
{
...
state
.
bottomContainer
,
selectKey
:
'menu.datastudio.console'
,
selectSubKey
:
{
selectSubKey
:
{},
...
state
.
bottomContainer
.
selectSubKey
,
height
:
180
,
[
state
.
bottomContainer
.
selectKey
]:
payload
width
:
'100%'
}
},
database
:
{
dbData
:
[],
selectDatabaseId
:
null
,
expandKeys
:
[],
selectKey
:
[]
},
project
:
{
data
:
[],
expandKeys
:
[],
selectKey
:
[]
},
tabs
:
{
activeBreadcrumbTitle
:
''
,
activeKey
:
'0'
,
panes
:
[]
},
bottomContainerContent
:
{
console
:
''
},
sessionCluster
:
[],
clusterConfiguration
:
[],
flinkConfigOptions
:
[],
env
:
[],
footContainer
:
{
codePosition
:
[
1
,
1
],
space
:
2
,
codeEncoding
:
'UTF-8'
,
lineSeparator
:
'LF'
,
codeType
:
''
,
memDetails
:
'100/500M'
,
jobRunningMsg
:
{
taskId
:
null
,
jobName
:
''
,
jobState
:
''
,
runningLog
:
''
}
},
suggestions
:
[]
},
effects
:
{
*
queryProject
({
payload
},
{
call
,
put
})
{
const
response
:
[]
=
yield
call
(
getTaskData
,
payload
);
yield
put
({
type
:
'saveProject'
,
payload
:
response
});
},
*
queryFlinkConfigOptions
({
payload
},
{
call
,
put
})
{
const
response
:
[]
=
yield
call
(
getFlinkConfigs
,
payload
);
yield
put
({
type
:
'saveFlinkConfigOptions'
,
payload
:
response
});
},
*
querySuggestions
({
payload
},
{
call
,
put
})
{
const
response
:
SuggestionInfo
[]
=
yield
call
(
querySuggessionData
,
payload
);
yield
put
({
type
:
'updateSuggestions'
,
payload
:
response
});
}
}
};
},
/**
* 更新底部高度
*/
updateBottomHeight
(
state
,
{
payload
})
{
if
(
payload
!=
state
.
bottomContainer
.
height
)
{
return
{
...
state
,
bottomContainer
:
{
...
state
.
bottomContainer
,
height
:
payload
}
};
}
return
state
;
},
/**
* 更新数据库列表
*/
saveDataBase
(
state
,
{
payload
})
{
return
{
...
state
,
database
:
{
...
state
.
database
,
dbData
:
payload
}
};
},
saveProject
(
state
,
{
payload
})
{
return
{
...
state
,
project
:
{
...
state
.
project
,
data
:
payload
}
};
},
},
reducers
:
{
/**
* 更新工具栏高度
*/
updateToolContentHeight
(
state
,
{
payload
})
{
if
(
payload
!=
state
.
toolContentHeight
)
{
return
{
...
state
,
toolContentHeight
:
payload
};
}
return
state
;
},
/**
* 更新中间内容高度
*/
updateCenterContentHeight
(
state
,
{
payload
})
{
if
(
payload
!=
state
.
centerContentHeight
)
{
return
{
...
state
,
centerContentHeight
:
payload
};
}
return
state
;
},
/**
* 更新左侧选中key
*/
updateSelectLeftKey
(
state
,
{
payload
})
{
return
{
...
state
,
leftContainer
:
{
...
state
.
leftContainer
,
selectKey
:
payload
,
label
:
payload
.
trim
()
===
''
?
''
:
l
(
payload
)
}
};
},
/**
* 更新左侧宽度
*/
updateLeftWidth
(
state
,
{
payload
})
{
return
{
...
state
,
leftContainer
:
{
...
state
.
leftContainer
,
width
:
payload
}
};
},
/**
* 更新右侧选中key
*/
updateSelectRightKey
(
state
,
{
payload
})
{
return
{
...
state
,
rightContainer
:
{
...
state
.
rightContainer
,
selectKey
:
payload
}
};
},
/**
* 更新右侧选中key
*/
updateRightWidth
(
state
,
{
payload
})
{
return
{
...
state
,
rightContainer
:
{
...
state
.
rightContainer
,
width
:
payload
}
};
},
/**
* 更新底部选中key
*/
updateSelectBottomKey
(
state
,
{
payload
})
{
let
centerContentHeight
=
0
;
let
toolContentHeight
=
0
;
if
(
payload
===
''
)
{
centerContentHeight
=
state
.
centerContentHeight
+
(
state
.
bottomContainer
.
height
as
number
);
toolContentHeight
=
state
.
toolContentHeight
+
(
state
.
bottomContainer
.
height
as
number
);
}
else
if
(
state
.
bottomContainer
.
selectKey
!==
''
)
{
centerContentHeight
=
state
.
centerContentHeight
;
toolContentHeight
=
state
.
toolContentHeight
;
}
else
{
centerContentHeight
=
state
.
centerContentHeight
-
(
state
.
bottomContainer
.
height
as
number
);
toolContentHeight
=
state
.
toolContentHeight
-
(
state
.
bottomContainer
.
height
as
number
);
}
updateProjectExpandKey
(
state
,
{
payload
})
{
return
{
return
{
...
state
,
...
state
,
centerContentHeight
:
centerContentHeight
,
project
:
{
...
state
.
project
,
expandKeys
:
payload
}
toolContentHeight
:
toolContentHeight
,
};
bottomContainer
:
{
},
...
state
.
bottomContainer
,
updateProjectSelectKey
(
state
,
{
payload
})
{
selectKey
:
payload
return
{
}
...
state
,
};
project
:
{
...
state
.
project
,
selectKey
:
payload
}
},
};
updateSelectBottomSubKey
(
state
,
{
payload
})
{
},
return
{
...
state
,
bottomContainer
:
{
...
state
.
bottomContainer
,
selectSubKey
:
{
...
state
.
bottomContainer
.
selectSubKey
,
[
state
.
bottomContainer
.
selectKey
]:
payload
}
}
};
},
/**
* 更新底部高度
*/
updateBottomHeight
(
state
,
{
payload
})
{
if
(
payload
!=
state
.
bottomContainer
.
height
)
{
return
{
...
state
,
bottomContainer
:
{
...
state
.
bottomContainer
,
height
:
payload
}
};
}
return
state
;
},
/**
* 更新数据库列表
*/
saveDataBase
(
state
,
{
payload
})
{
return
{
...
state
,
database
:
{...
state
.
database
,
dbData
:
payload
}
};
},
saveProject
(
state
,
{
payload
})
{
return
{
...
state
,
project
:
{...
state
.
project
,
data
:
payload
}
};
},
/**
updateProjectExpandKey
(
state
,
{
payload
})
{
* flink config options
return
{
*/
...
state
,
saveFlinkConfigOptions
(
state
,
{
payload
})
{
project
:
{...
state
.
project
,
expandKeys
:
payload
}
return
{
};
...
state
,
},
flinkConfigOptions
:
payload
updateProjectSelectKey
(
state
,
{
payload
})
{
};
return
{
},
...
state
,
/**
project
:
{...
state
.
project
,
selectKey
:
payload
}
* 更新tabs activeKey
};
*/
updateTabsActiveKey
(
state
,
{
payload
})
{
const
itemTypes
=
state
.
tabs
.
panes
.
filter
((
x
)
=>
x
.
key
===
payload
);
if
(
itemTypes
.
length
===
1
)
{
let
footerValue
:
object
=
getFooterValue
(
state
.
tabs
.
panes
,
payload
);
const
itemType
=
itemTypes
[
0
];
return
{
...
state
,
tabs
:
{
...
state
.
tabs
,
activeKey
:
payload
,
activeBreadcrumbTitle
:
[
itemType
.
type
,
itemType
.
breadcrumbLabel
,
itemType
.
label
].
join
(
'/'
)
},
footContainer
:
{
...
state
.
footContainer
,
...
footerValue
}
};
}
return
{
...
state
,
tabs
:
{
...
state
.
tabs
,
activeKey
:
payload
},
},
rightContainer
:
{
...
state
.
rightContainer
,
selectKey
:
''
}
};
},
/**
* 移除标签
*/
removeTag
(
state
,
{
payload
})
{
const
needRemoveKey
=
payload
;
const
{
tabs
:
{
panes
,
activeKey
}
}
=
state
;
const
index
=
panes
.
findIndex
((
item
,
index
)
=>
{
if
(
isDataStudioTabsItemType
(
item
))
{
return
item
.
params
.
taskId
===
needRemoveKey
;
}
return
false
;
});
// 关闭 传过来的key
if
(
index
!==
-
1
)
{
panes
.
splice
(
index
,
1
);
}
const
newActiveKey
=
activeKey
===
needRemoveKey
?
panes
[
panes
.
length
-
1
].
key
:
activeKey
;
return
{
...
state
,
tabs
:
{
...
state
.
tabs
,
panes
:
panes
,
activeKey
:
newActiveKey
}
};
},
/**
/**
* 关闭tab
* flink config options
*/
*/
closeTab
(
state
,
{
payload
})
{
saveFlinkConfigOptions
(
state
,
{
payload
})
{
const
needCloseKey
=
(
payload
as
TargetKey
).
toString
();
const
{
tabs
:
{
panes
,
activeKey
}
}
=
state
;
// close self
if
(
needCloseKey
===
activeKey
)
{
for
(
const
[
index
,
pane
]
of
panes
.
entries
())
{
if
(
pane
.
key
===
needCloseKey
)
{
const
nextPane
=
panes
[(
index
+
1
)
%
panes
.
length
];
const
height
=
document
.
documentElement
.
clientHeight
-
VIEW
.
headerHeight
-
VIEW
.
headerNavHeight
-
VIEW
.
footerHeight
-
VIEW
.
otherHeight
;
return
{
return
{
...
state
,
...
state
,
tabs
:
{
flinkConfigOptions
:
payload
panes
:
panes
.
filter
((
pane
)
=>
pane
.
key
!==
needCloseKey
),
activeKey
:
nextPane
.
key
,
activeBreadcrumbTitle
:
panes
.
length
<
2
?
''
:
[
nextPane
.
type
,
nextPane
.
breadcrumbLabel
,
nextPane
.
label
].
join
(
'/'
)
},
footContainer
:
{
...
state
.
footContainer
,
...
getFooterValue
(
panes
,
nextPane
.
key
)
},
toolContentHeight
:
panes
.
length
<
2
?
height
-
VIEW
.
leftMargin
:
state
.
toolContentHeight
,
centerContentHeight
:
panes
.
length
<
2
?
height
:
state
.
toolContentHeight
};
};
}
},
}
/**
}
* 更新tabs activeKey
*/
updateTabsActiveKey
(
state
,
{
payload
})
{
const
itemTypes
=
state
.
tabs
.
panes
.
filter
((
x
)
=>
x
.
key
===
payload
);
if
(
itemTypes
.
length
===
1
)
{
let
footerValue
:
object
=
getFooterValue
(
state
.
tabs
.
panes
,
payload
);
const
itemType
=
itemTypes
[
0
];
return
{
...
state
,
tabs
:
{
...
state
.
tabs
,
activeKey
:
payload
,
activeBreadcrumbTitle
:
[
itemType
.
type
,
itemType
.
breadcrumbLabel
,
itemType
.
label
].
join
(
'/'
)
},
footContainer
:
{
...
state
.
footContainer
,
...
footerValue
}
};
}
return
{
...
state
,
tabs
:
{
...
state
.
tabs
,
activeKey
:
payload
},
rightContainer
:
{
...
state
.
rightContainer
,
selectKey
:
''
}
};
},
/**
* 移除标签
*/
removeTag
(
state
,
{
payload
})
{
const
needRemoveKey
=
payload
;
const
{
tabs
:
{
panes
,
activeKey
}
}
=
state
;
const
index
=
panes
.
findIndex
((
item
,
index
)
=>
{
if
(
isDataStudioTabsItemType
(
item
))
{
return
item
.
params
.
taskId
===
needRemoveKey
;
}
return
false
;
});
// 关闭 传过来的key
if
(
index
!==
-
1
)
{
panes
.
splice
(
index
,
1
);
}
const
newActiveKey
=
activeKey
===
needRemoveKey
?
panes
[
panes
.
length
-
1
].
key
:
activeKey
;
return
{
...
state
,
tabs
:
{
...
state
.
tabs
,
panes
:
panes
,
activeKey
:
newActiveKey
}
};
},
const
newPanes
=
panes
.
filter
((
pane
)
=>
pane
.
key
!==
needCloseKey
);
/**
return
{
* 关闭tab
...
state
,
*/
tabs
:
{
closeTab
(
state
,
{
payload
})
{
panes
:
newPanes
,
const
needCloseKey
=
(
payload
as
TargetKey
).
toString
();
activeKey
:
activeKey
,
const
{
activeBreadcrumbTitle
:
state
.
tabs
.
activeBreadcrumbTitle
tabs
:
{
panes
,
activeKey
}
}
=
state
;
// close self
if
(
needCloseKey
===
activeKey
)
{
for
(
const
[
index
,
pane
]
of
panes
.
entries
())
{
if
(
pane
.
key
===
needCloseKey
)
{
const
nextPane
=
panes
[(
index
+
1
)
%
panes
.
length
];
const
height
=
document
.
documentElement
.
clientHeight
-
VIEW
.
headerHeight
-
VIEW
.
headerNavHeight
-
VIEW
.
footerHeight
-
VIEW
.
otherHeight
;
return
{
...
state
,
tabs
:
{
panes
:
panes
.
filter
((
pane
)
=>
pane
.
key
!==
needCloseKey
),
activeKey
:
nextPane
.
key
,
activeBreadcrumbTitle
:
panes
.
length
<
2
?
''
:
[
nextPane
.
type
,
nextPane
.
breadcrumbLabel
,
nextPane
.
label
].
join
(
'/'
)
},
footContainer
:
{
...
state
.
footContainer
,
...
getFooterValue
(
panes
,
nextPane
.
key
)
},
toolContentHeight
:
panes
.
length
<
2
?
height
-
VIEW
.
leftMargin
:
state
.
toolContentHeight
,
centerContentHeight
:
panes
.
length
<
2
?
height
:
state
.
toolContentHeight
,
};
}
}
}
const
newPanes
=
panes
.
filter
((
pane
)
=>
pane
.
key
!==
needCloseKey
);
return
{
...
state
,
tabs
:
{
panes
:
newPanes
,
activeKey
:
activeKey
,
activeBreadcrumbTitle
:
state
.
tabs
.
activeBreadcrumbTitle
},
footContainer
:
{
...
state
.
footContainer
,
...
getFooterValue
(
newPanes
,
activeKey
)
}
};
},
},
footContainer
:
{
...
state
.
footContainer
,
...
getFooterValue
(
newPanes
,
activeKey
)
}
};
},
/**
/**
* 添加tab 如果存在则不添加
* 添加tab 如果存在则不添加
*/
*/
addTab
(
state
,
{
payload
})
{
addTab
(
state
,
{
payload
})
{
const
node
=
payload
as
TabsItemType
;
const
node
=
payload
as
TabsItemType
;
for
(
const
item
of
state
.
tabs
.
panes
)
{
for
(
const
item
of
state
.
tabs
.
panes
)
{
if
(
item
.
id
===
node
.
id
)
{
if
(
item
.
id
===
node
.
id
)
{
let
footerValue
:
object
=
getFooterValue
(
state
.
tabs
.
panes
,
item
.
key
);
let
footerValue
:
object
=
getFooterValue
(
state
.
tabs
.
panes
,
item
.
key
);
return
{
return
{
...
state
,
...
state
,
tabs
:
{
tabs
:
{
...
state
.
tabs
,
...
state
.
tabs
,
activeKey
:
item
.
key
activeKey
:
item
.
key
},
},
footContainer
:
{
footContainer
:
{
...
state
.
footContainer
,
...
state
.
footContainer
,
...
footerValue
...
footerValue
}
};
}
}
}
};
}
node
.
key
=
}
state
.
tabs
.
panes
.
length
===
0
?
'0'
node
.
key
=
:
(
parseInt
(
state
.
tabs
.
panes
[
state
.
tabs
.
panes
.
length
-
1
].
key
)
+
1
).
toString
();
state
.
tabs
.
panes
.
length
===
0
const
panes
=
[...
state
.
tabs
.
panes
,
node
];
?
'0'
let
footerValue
:
object
=
getFooterValue
(
panes
,
node
.
key
);
:
(
parseInt
(
state
.
tabs
.
panes
[
state
.
tabs
.
panes
.
length
-
1
].
key
)
+
1
).
toString
();
return
{
const
panes
=
[...
state
.
tabs
.
panes
,
node
];
...
state
,
let
footerValue
:
object
=
getFooterValue
(
panes
,
node
.
key
);
tabs
:
{
return
{
panes
:
panes
,
...
state
,
activeBreadcrumbTitle
:
[
node
.
type
,
node
.
breadcrumbLabel
,
node
.
label
].
join
(
'/'
),
tabs
:
{
activeKey
:
node
.
key
panes
:
panes
,
},
activeBreadcrumbTitle
:
[
node
.
type
,
node
.
breadcrumbLabel
,
node
.
label
].
join
(
'/'
),
footContainer
:
{
activeKey
:
node
.
key
...
state
.
footContainer
,
...
footerValue
}
};
},
},
footContainer
:
{
...
state
.
footContainer
,
...
footerValue
}
};
},
/**
/**
* 关闭所有tab
* 关闭所有tab
*/
*/
closeAllTabs
(
state
)
{
closeAllTabs
(
state
)
{
return
{
return
{
...
state
,
...
state
,
tabs
:
{
tabs
:
{
panes
:
[],
panes
:
[],
activeKey
:
''
,
activeKey
:
''
,
activeBreadcrumbTitle
:
''
activeBreadcrumbTitle
:
''
}
}
};
};
},
},
/**
/**
* 关闭其他tab
* 关闭其他tab
*/
*/
closeOtherTabs
(
state
,
{
payload
})
{
closeOtherTabs
(
state
,
{
payload
})
{
// 从 pans 中找到需要关闭的 tab
// 从 pans 中找到需要关闭的 tab
const
tabsItem
=
state
.
tabs
.
panes
.
find
((
pane
)
=>
pane
.
key
===
payload
.
key
);
const
tabsItem
=
state
.
tabs
.
panes
.
find
((
pane
)
=>
pane
.
key
===
payload
.
key
);
return
{
return
{
...
state
,
...
state
,
tabs
:
{
tabs
:
{
panes
:
tabsItem
?
[
tabsItem
]
:
[],
panes
:
tabsItem
?
[
tabsItem
]
:
[],
activeKey
:
tabsItem
?.
key
??
''
,
activeKey
:
tabsItem
?.
key
??
''
,
activeBreadcrumbTitle
:
tabsItem
?.
breadcrumbLabel
??
''
activeBreadcrumbTitle
:
tabsItem
?.
breadcrumbLabel
??
''
}
}
};
};
},
},
/**
/**
* 更新选中数据库id
* 更新选中数据库id
*/
*/
updateSelectDatabaseId
(
state
,
{
payload
})
{
updateSelectDatabaseId
(
state
,
{
payload
})
{
return
{
return
{
...
state
,
...
state
,
database
:
{
...
state
.
database
,
selectDatabaseId
:
payload
}
database
:
{...
state
.
database
,
selectDatabaseId
:
payload
}
};
};
},
},
/**
/**
* 更新数据库展开key
* 更新数据库展开key
* @param state
* @param state
* @param payload
* @param payload
* @returns {any}
* @returns {any}
*/
*/
updateDatabaseExpandKey
(
state
,
{
payload
})
{
updateDatabaseExpandKey
(
state
,
{
payload
})
{
return
{
return
{
...
state
,
...
state
,
database
:
{
...
state
.
database
,
expandKeys
:
payload
}
database
:
{...
state
.
database
,
expandKeys
:
payload
}
};
};
},
},
/**
/**
* 更新数据库选中key
* 更新数据库选中key
*/
*/
updateDatabaseSelectKey
(
state
,
{
payload
})
{
updateDatabaseSelectKey
(
state
,
{
payload
})
{
return
{
return
{
...
state
,
...
state
,
database
:
{
...
state
.
database
,
selectKeys
:
payload
}
database
:
{...
state
.
database
,
selectKeys
:
payload
}
};
};
},
},
updateBottomConsole
(
state
,
{
payload
})
{
updateBottomConsole
(
state
,
{
payload
})
{
return
{
return
{
...
state
,
...
state
,
bottomContainerContent
:
{
bottomContainerContent
:
{
...
state
.
bottomContainerContent
,
...
state
.
bottomContainerContent
,
console
:
payload
console
:
payload
}
}
};
};
},
},
saveSession
(
state
,
{
payload
})
{
saveSession
(
state
,
{
payload
})
{
return
{
return
{
...
state
,
...
state
,
sessionCluster
:
payload
sessionCluster
:
payload
};
};
},
},
saveEnv
(
state
,
{
payload
})
{
saveEnv
(
state
,
{
payload
})
{
return
{
return
{
...
state
,
...
state
,
env
:
payload
env
:
payload
};
};
},
},
saveTabs
(
state
,
{
payload
})
{
saveTabs
(
state
,
{
payload
})
{
return
{
return
{
...
state
,
...
state
,
tabs
:
payload
tabs
:
payload
};
};
},
},
saveClusterConfiguration
(
state
,
{
payload
})
{
saveClusterConfiguration
(
state
,
{
payload
})
{
return
{
return
{
...
state
,
...
state
,
clusterConfiguration
:
payload
clusterConfiguration
:
payload
};
};
},
},
saveFooterValue
(
state
,
{
payload
})
{
saveFooterValue
(
state
,
{
payload
})
{
return
{
return
{
...
state
,
...
state
,
footContainer
:
payload
footContainer
:
payload
};
};
},
},
updateJobRunningMsg
(
state
,
{
payload
})
{
updateJobRunningMsg
(
state
,
{
payload
})
{
return
{
return
{
...
state
,
...
state
,
footContainer
:
{
footContainer
:
{
...
state
.
footContainer
,
...
state
.
footContainer
,
jobRunningMsg
:
payload
jobRunningMsg
:
payload
}
};
},
updateSuggestions
(
state
,
{
payload
})
{
return
{
...
state
,
suggestions
:
payload
};
}
}
};
},
updateSuggestions
(
state
,
{
payload
})
{
return
{
...
state
,
suggestions
:
payload
};
}
}
}
};
};
export
const
[
STUDIO_MODEL
,
STUDIO_MODEL_ASYNC
]
=
createModelTypes
(
Model
);
export
const
[
STUDIO_MODEL
,
STUDIO_MODEL_ASYNC
]
=
createModelTypes
(
Model
);
...
...
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