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
8bf8adc4
Unverified
Commit
8bf8adc4
authored
Nov 16, 2023
by
gaoyan
Committed by
GitHub
Nov 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix datastudio tabs switch bug (#2537)
* Optimize the process * fix some bug * remove processid in sse
parent
1f0b2b69
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
22 deletions
+17
-22
log4j2.xml
dinky-admin/src/main/resources/log4j2.xml
+1
-1
MainApp.java
...p/dinky-app-1.16/src/main/java/org/dinky/app/MainApp.java
+1
-2
index.tsx
...web/src/pages/DataStudio/MiddleContainer/Editor/index.tsx
+14
-17
index.tsx
dinky-web/src/pages/DataStudio/MiddleContainer/index.tsx
+1
-2
No files found.
dinky-admin/src/main/resources/log4j2.xml
View file @
8bf8adc4
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
<!--这个是输出日志的格式,如果对里面的参数不理解,可以去看我的这篇文章,网址是:“https://blog.csdn.net/qq_42449963/article/details/104617356”-->
<!--这个是输出日志的格式,如果对里面的参数不理解,可以去看我的这篇文章,网址是:“https://blog.csdn.net/qq_42449963/article/details/104617356”-->
<!--<PatternLayout pattern="[dinky] %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/>-->
<!--<PatternLayout pattern="[dinky] %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/>-->
<PatternLayout
<PatternLayout
pattern=
"%d{yyyy-MM-dd HH:mm:ss.SSS} %
p %
c{20}(%L): %m"
/>
pattern=
"%d{yyyy-MM-dd HH:mm:ss.SSS} %c{20}(%L): %m"
/>
</LogSseAppender>
</LogSseAppender>
</appenders>
</appenders>
...
...
dinky-app/dinky-app-1.16/src/main/java/org/dinky/app/MainApp.java
View file @
8bf8adc4
...
@@ -54,8 +54,7 @@ public class MainApp {
...
@@ -54,8 +54,7 @@ public class MainApp {
DBUtil
.
init
(
appConfig
);
DBUtil
.
init
(
appConfig
);
Submitter
.
submit
(
appConfig
);
Submitter
.
submit
(
appConfig
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"exectue app failed with config: {}"
,
appConfig
);
log
.
error
(
"exectue app failed : "
,
e
);
throw
e
;
}
finally
{
}
finally
{
log
.
info
(
"Start Monitor Job"
);
log
.
info
(
"Start Monitor Job"
);
FlinkAppUtil
.
monitorFlinkTask
(
appConfig
.
getTaskId
());
FlinkAppUtil
.
monitorFlinkTask
(
appConfig
.
getTaskId
());
...
...
dinky-web/src/pages/DataStudio/MiddleContainer/Editor/index.tsx
View file @
8bf8adc4
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
import
CodeEdit
from
'@/components/CustomEditor/CodeEdit'
;
import
CodeEdit
from
'@/components/CustomEditor/CodeEdit'
;
import
{
useEditor
}
from
'@/hooks/useEditor'
;
import
{
useEditor
}
from
'@/hooks/useEditor'
;
import
{
getCurrentTab
}
from
'@/pages/DataStudio/function'
;
import
{
TASK_VAR_FILTER
}
from
'@/pages/DataStudio/MiddleContainer/Editor/constants'
;
import
{
TASK_VAR_FILTER
}
from
'@/pages/DataStudio/MiddleContainer/Editor/constants'
;
import
DiffModal
from
'@/pages/DataStudio/MiddleContainer/Editor/DiffModal'
;
import
DiffModal
from
'@/pages/DataStudio/MiddleContainer/Editor/DiffModal'
;
import
{
import
{
...
@@ -42,14 +41,13 @@ import React, { useEffect, useRef, useState } from 'react';
...
@@ -42,14 +41,13 @@ import React, { useEffect, useRef, useState } from 'react';
import
{
format
}
from
'sql-formatter'
;
import
{
format
}
from
'sql-formatter'
;
export
type
EditorProps
=
{
export
type
EditorProps
=
{
ta
skId
:
number
;
ta
bsItem
:
DataStudioTabsItemType
height
?:
number
;
height
?:
number
;
};
};
const
CodeEditor
:
React
.
FC
<
EditorProps
&
any
>
=
(
props
)
=>
{
const
CodeEditor
:
React
.
FC
<
EditorProps
&
any
>
=
(
props
)
=>
{
const
{
const
{
taskId
,
tabsItem
,
tabs
:
{
panes
,
activeKey
},
dispatch
,
dispatch
,
height
height
}
=
props
;
}
=
props
;
...
@@ -69,12 +67,11 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
...
@@ -69,12 +67,11 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
const
editorInstance
=
useRef
<
editor
.
IStandaloneCodeEditor
|
any
>
();
const
editorInstance
=
useRef
<
editor
.
IStandaloneCodeEditor
|
any
>
();
const
monacoInstance
=
useRef
<
Monaco
|
any
>
();
const
monacoInstance
=
useRef
<
Monaco
|
any
>
();
const
currentTab
=
getCurrentTab
(
panes
,
activeKey
)
as
DataStudioTabsItemType
;
const
currentData
=
tabsItem
.
params
.
taskData
;
const
currentData
=
currentTab
.
params
.
taskData
;
const
loadTask
=
(
cache
:
TaskDataType
,
serverParams
:
TaskDataType
)
=>
{
const
loadTask
=
(
cache
:
TaskDataType
,
serverParams
:
TaskDataType
)
=>
{
if
(
!
cache
)
{
if
(
!
cache
)
{
currentTab
.
params
.
taskData
=
{
...
serverParams
,
useResult
:
true
,
maxRowNum
:
100
};
tabsItem
.
params
.
taskData
=
{
...
serverParams
,
useResult
:
true
,
maxRowNum
:
100
};
dispatch
({
type
:
STUDIO_MODEL
.
saveTabs
,
payload
:
{
...
props
.
tabs
}
});
dispatch
({
type
:
STUDIO_MODEL
.
saveTabs
,
payload
:
{
...
props
.
tabs
}
});
return
;
return
;
}
}
...
@@ -93,16 +90,16 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
...
@@ -93,16 +90,16 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
};
};
const
{
loading
,
data
}
=
useRequest
(
const
{
loading
,
data
}
=
useRequest
(
{
url
:
API_CONSTANTS
.
TASK
,
params
:
{
id
:
taskId
}
},
{
url
:
API_CONSTANTS
.
TASK
,
params
:
{
id
:
ta
bsItem
.
params
.
ta
skId
}
},
{
onSuccess
:
(
data
:
any
)
=>
loadTask
(
currentTab
.
params
.
taskData
,
data
)
}
{
onSuccess
:
(
data
:
any
)
=>
loadTask
(
tabsItem
.
params
.
taskData
,
data
)
}
);
);
const
upDateTask
=
(
useServerVersion
:
boolean
)
=>
{
const
upDateTask
=
(
useServerVersion
:
boolean
)
=>
{
if
(
useServerVersion
)
{
if
(
useServerVersion
)
{
currentTab
.
params
.
taskData
=
{
...
data
,
useResult
:
true
,
maxRowNum
:
100
};
tabsItem
.
params
.
taskData
=
{
...
data
,
useResult
:
true
,
maxRowNum
:
100
};
currentTab
.
isModified
=
false
;
tabsItem
.
isModified
=
false
;
}
else
{
}
else
{
currentTab
.
isModified
=
true
;
tabsItem
.
isModified
=
true
;
}
}
dispatch
({
type
:
STUDIO_MODEL
.
saveTabs
,
payload
:
{
...
props
.
tabs
}
});
dispatch
({
type
:
STUDIO_MODEL
.
saveTabs
,
payload
:
{
...
props
.
tabs
}
});
setIsModalOpen
(
false
);
setIsModalOpen
(
false
);
...
@@ -129,13 +126,13 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
...
@@ -129,13 +126,13 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
};
};
const
handleEditChange
=
(
v
:
string
|
undefined
)
=>
{
const
handleEditChange
=
(
v
:
string
|
undefined
)
=>
{
if
(
!
currentData
||
!
currentTab
)
{
if
(
!
currentData
||
!
tabsItem
)
{
return
;
return
;
}
}
if
(
typeof
v
===
'string'
)
{
if
(
typeof
v
===
'string'
)
{
currentData
.
statement
=
v
;
currentData
.
statement
=
v
;
}
}
currentTab
.
isModified
=
true
;
tabsItem
.
isModified
=
true
;
dispatch
({
dispatch
({
type
:
STUDIO_MODEL
.
saveTabs
,
type
:
STUDIO_MODEL
.
saveTabs
,
payload
:
{
...
props
.
tabs
}
payload
:
{
...
props
.
tabs
}
...
@@ -149,7 +146,7 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
...
@@ -149,7 +146,7 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
diffs=
{
diff
}
diffs=
{
diff
}
open=
{
isModalOpen
}
open=
{
isModalOpen
}
language=
{
language=
{
currentTab
?.
params
?.
taskData
?.
dialect
?.
toLowerCase
()
===
DIALECT
.
FLINK_SQL
tabsItem
?.
params
?.
taskData
?.
dialect
?.
toLowerCase
()
===
DIALECT
.
FLINK_SQL
?
'flinksql'
?
'flinksql'
:
'sql'
:
'sql'
}
}
...
@@ -159,9 +156,9 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
...
@@ -159,9 +156,9 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
<
CodeEdit
<
CodeEdit
monacoRef=
{
monacoInstance
}
monacoRef=
{
monacoInstance
}
editorRef=
{
editorInstance
}
editorRef=
{
editorInstance
}
code=
{
currentTab
?.
params
?.
taskData
?.
statement
}
code=
{
tabsItem
?.
params
?.
taskData
?.
statement
}
language=
{
language=
{
currentTab
?.
params
?.
taskData
?.
dialect
?.
toLowerCase
()
===
DIALECT
.
FLINK_SQL
tabsItem
?.
params
?.
taskData
?.
dialect
?.
toLowerCase
()
===
DIALECT
.
FLINK_SQL
?
'flinksql'
?
'flinksql'
:
'sql'
:
'sql'
}
}
...
...
dinky-web/src/pages/DataStudio/MiddleContainer/index.tsx
View file @
8bf8adc4
...
@@ -236,10 +236,9 @@ const MiddleContainer = (props: any) => {
...
@@ -236,10 +236,9 @@ const MiddleContainer = (props: any) => {
return
TabsPageType
.
None
;
return
TabsPageType
.
None
;
}
}
const
v
=
item
.
params
;
return
(
return
(
<
Editor
<
Editor
ta
skId=
{
v
.
taskId
}
ta
bsItem=
{
item
}
height=
{
height=
{
activeKey
===
item
.
key
activeKey
===
item
.
key
?
fullscreen
?
fullscreen
...
...
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