Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dlink
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
zhaowei
dlink
Commits
bb4f4e78
Commit
bb4f4e78
authored
Aug 24, 2021
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复自动补全
parent
80f4e127
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
29 deletions
+23
-29
JobManager.java
dlink-core/src/main/java/com/dlink/job/JobManager.java
+1
-1
data.d.ts
dlink-web/src/components/Studio/StudioEdit/data.d.ts
+2
-2
index.tsx
dlink-web/src/components/Studio/StudioEdit/index.tsx
+17
-22
DDL.ts
dlink-web/src/components/Studio/StudioEvent/DDL.ts
+0
-1
index.tsx
dlink-web/src/components/Studio/StudioTabs/index.tsx
+0
-3
Welcome.tsx
dlink-web/src/pages/Welcome.tsx
+3
-0
No files found.
dlink-core/src/main/java/com/dlink/job/JobManager.java
View file @
bb4f4e78
...
@@ -76,7 +76,7 @@ public class JobManager extends RunTime {
...
@@ -76,7 +76,7 @@ public class JobManager extends RunTime {
private
Executor
createExecutor
()
{
private
Executor
createExecutor
()
{
initEnvironmentSetting
();
initEnvironmentSetting
();
if
(
config
.
isUseRemote
())
{
if
(
config
.
isUseRemote
()
&&
config
.
getClusterId
()!=
0
)
{
executor
=
Executor
.
buildRemoteExecutor
(
environmentSetting
,
config
.
getExecutorSetting
());
executor
=
Executor
.
buildRemoteExecutor
(
environmentSetting
,
config
.
getExecutorSetting
());
return
executor
;
return
executor
;
}
else
{
}
else
{
...
...
dlink-web/src/components/Studio/StudioEdit/data.d.ts
View file @
bb4f4e78
...
@@ -23,9 +23,9 @@ export type BaseDataSourceHeader = {
...
@@ -23,9 +23,9 @@ export type BaseDataSourceHeader = {
}
}
export
type
CompletionItem
=
{
export
type
CompletionItem
=
{
label
?
:
string
,
label
:
string
,
kind
?:
any
,
kind
?:
any
,
insertText
?
:
string
,
insertText
:
string
,
insertTextRules
?:
any
,
insertTextRules
?:
any
,
detail
?:
string
,
detail
?:
string
,
}
}
...
...
dlink-web/src/components/Studio/StudioEdit/index.tsx
View file @
bb4f4e78
import
React
,
{
useEffect
,
useImperativeHandle
,
useRef
}
from
'react'
;
import
React
,
{
useEffect
,
useImperativeHandle
,
useRef
}
from
'react'
;
import
*
as
_monaco
from
"monaco-editor"
;
import
*
as
_monaco
from
"monaco-editor"
;
// import MonacoEditor from "react-monaco-editor/lib/editor";
import
MonacoEditor
from
"react-monaco-editor"
;
import
MonacoEditor
from
"react-monaco-editor"
;
import
{
BaseDataSourceField
,
BaseDataSourceHeader
,
CompletionItem
}
from
"./data"
;
import
{
BaseDataSourceField
,
BaseDataSourceHeader
,
CompletionItem
}
from
"./data"
;
import
Completion
from
"./completion"
;
import
Completion
from
"./completion"
;
...
@@ -20,6 +19,13 @@ interface IRightContent {
...
@@ -20,6 +19,13 @@ interface IRightContent {
secondRightData
:
(
BaseDataSourceField
|
BaseDataSourceHeader
)[];
secondRightData
:
(
BaseDataSourceField
|
BaseDataSourceHeader
)[];
}
}
interface
ISuggestions
{
label
:
string
;
kind
:
string
;
insertText
:
string
;
detail
?:
string
;
}
const
FlinkSqlEditor
=
(
props
:
any
)
=>
{
const
FlinkSqlEditor
=
(
props
:
any
)
=>
{
const
{
const
{
height
=
'100%'
,
height
=
'100%'
,
...
@@ -30,9 +36,7 @@ const FlinkSqlEditor = (props:any) => {
...
@@ -30,9 +36,7 @@ const FlinkSqlEditor = (props:any) => {
selectOnLineNumbers
:
true
,
selectOnLineNumbers
:
true
,
renderSideBySide
:
false
,
renderSideBySide
:
false
,
},
},
// current,
tabs
,
tabs
,
// current=props.current,
dispatch
,
dispatch
,
}
=
props
}
=
props
;
;
...
@@ -52,16 +56,9 @@ const FlinkSqlEditor = (props:any) => {
...
@@ -52,16 +56,9 @@ const FlinkSqlEditor = (props:any) => {
return
0
;
return
0
;
};
};
const
tabIndex
=
getTabIndex
();
const
tabIndex
=
getTabIndex
();
const
code
:
any
=
useRef
(
tabs
.
panes
[
tabIndex
].
value
?
tabs
.
panes
[
tabIndex
].
value
:
''
);
const
code
:
any
=
useRef
(
tabs
.
panes
[
tabIndex
].
value
?
tabs
.
panes
[
tabIndex
].
value
:
''
);
// const code: any = useRef(current.sql ? current.sql : '');
// const code: any = useRef(value ? value.formulaContent : '');
const
cache
:
any
=
useRef
(
code
.
current
);
const
cache
:
any
=
useRef
(
code
.
current
);
const
[
refresh
,
setRefresh
]
=
React
.
useState
<
boolean
>
(
false
);
const
[
selectValue
,
setSelectValue
]
=
React
.
useState
<
string
>
(
""
);
useEffect
(
useEffect
(
()
=>
()
=>
{
()
=>
()
=>
{
provider
.
dispose
();
provider
.
dispose
();
...
@@ -107,13 +104,6 @@ const FlinkSqlEditor = (props:any) => {
...
@@ -107,13 +104,6 @@ const FlinkSqlEditor = (props:any) => {
});
});
};
};
interface
ISuggestions
{
label
:
string
;
kind
:
string
;
insertText
:
string
;
detail
?:
string
;
}
const
editorDidMountHandle
=
(
editor
:
any
,
monaco
:
any
)
=>
{
const
editorDidMountHandle
=
(
editor
:
any
,
monaco
:
any
)
=>
{
monacoInstance
.
current
=
monaco
;
monacoInstance
.
current
=
monaco
;
editorInstance
.
current
=
editor
;
editorInstance
.
current
=
editor
;
...
@@ -129,7 +119,7 @@ const FlinkSqlEditor = (props:any) => {
...
@@ -129,7 +119,7 @@ const FlinkSqlEditor = (props:any) => {
// 提示项设值
// 提示项设值
provider
=
monaco
.
languages
.
registerCompletionItemProvider
(
'sql'
,
{
provider
=
monaco
.
languages
.
registerCompletionItemProvider
(
'sql'
,
{
provideCompletionItems
()
{
provideCompletionItems
()
{
cons
t
suggestions
:
ISuggestions
[]
=
[];
le
t
suggestions
:
ISuggestions
[]
=
[];
if
(
code
&&
code
.
current
)
{
if
(
code
&&
code
.
current
)
{
code
.
current
.
forEach
((
record
:
any
)
=>
{
code
.
current
.
forEach
((
record
:
any
)
=>
{
suggestions
.
push
({
suggestions
.
push
({
...
@@ -146,14 +136,20 @@ const FlinkSqlEditor = (props:any) => {
...
@@ -146,14 +136,20 @@ const FlinkSqlEditor = (props:any) => {
});
});
}
}
Completion
.
forEach
((
item
:
CompletionItem
)
=>
{
Completion
.
forEach
((
item
:
CompletionItem
)
=>
{
suggestions
.
push
(
item
);
suggestions
.
push
(
{
label
:
item
.
label
,
kind
:
item
.
kind
,
insertText
:
item
.
insertText
,
insertTextRules
:
item
.
insertTextRules
,
detail
:
item
.
detail
});
});
});
return
{
return
{
suggestions
,
suggestions
,
};
};
},
},
quickSuggestions
:
tru
e
,
quickSuggestions
:
fals
e
,
triggerCharacters
:
[
'$'
,
'.'
,
'='
],
//
triggerCharacters: ['$', '.', '='],
});
});
editor
.
focus
();
editor
.
focus
();
};
};
...
@@ -171,7 +167,6 @@ return (
...
@@ -171,7 +167,6 @@ return (
theme=
"vs-dark"
theme=
"vs-dark"
editorDidMount=
{
editorDidMountHandle
}
editorDidMount=
{
editorDidMountHandle
}
/>
/>
{
selectValue
}
</
React
.
Fragment
>
</
React
.
Fragment
>
);
);
};
};
...
...
dlink-web/src/components/Studio/StudioEvent/DDL.ts
View file @
bb4f4e78
...
@@ -16,7 +16,6 @@ export function createSession(session: SessionType,dispatch: any) {
...
@@ -16,7 +16,6 @@ export function createSession(session: SessionType,dispatch: any) {
export
function
listSession
(
dispatch
:
any
)
{
export
function
listSession
(
dispatch
:
any
)
{
const
res
=
getData
(
"api/studio/listSession"
);
const
res
=
getData
(
"api/studio/listSession"
);
res
.
then
((
result
)
=>
{
res
.
then
((
result
)
=>
{
console
.
log
(
result
.
datas
);
dispatch
&&
dispatch
({
dispatch
&&
dispatch
({
type
:
"Studio/saveSession"
,
type
:
"Studio/saveSession"
,
payload
:
result
.
datas
,
payload
:
result
.
datas
,
...
...
dlink-web/src/components/Studio/StudioTabs/index.tsx
View file @
bb4f4e78
...
@@ -9,9 +9,6 @@ const { TabPane } = Tabs;
...
@@ -9,9 +9,6 @@ const { TabPane } = Tabs;
const
EditorTabs
=
(
props
:
any
)
=>
{
const
EditorTabs
=
(
props
:
any
)
=>
{
const
{
tabs
,
dispatch
,
current
}
=
props
;
const
{
tabs
,
dispatch
,
current
}
=
props
;
const
[
newTabIndex
,
setNewTabIndex
]
=
useState
<
number
>
(
0
);
const
[
activeKey
,
setActiveKey
]
=
useState
<
number
>
(
tabs
.
activeKey
);
const
[
panes
,
setPanes
]
=
useState
<
any
>
(
tabs
.
panes
);
const
onChange
=
(
activeKey
:
any
)
=>
{
const
onChange
=
(
activeKey
:
any
)
=>
{
dispatch
({
dispatch
({
...
...
dlink-web/src/pages/Welcome.tsx
View file @
bb4f4e78
...
@@ -298,6 +298,9 @@ export default (): React.ReactNode => {
...
@@ -298,6 +298,9 @@ export default (): React.ReactNode => {
<
li
>
<
li
>
<
Link
>
增加了 Flink StreamGraph 预览功能
</
Link
>
<
Link
>
增加了 Flink StreamGraph 预览功能
</
Link
>
</
li
>
</
li
>
<
li
>
<
Link
>
修复了 Studio 编辑器的自动补全无法正常提示的bug
</
Link
>
</
li
>
</
ul
>
</
ul
>
</
Paragraph
>
</
Paragraph
>
</
Timeline
.
Item
>
</
Timeline
.
Item
>
...
...
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