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
54cebe02
Unverified
Commit
54cebe02
authored
Dec 31, 2022
by
aiwenmo
Committed by
GitHub
Dec 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Feature-1378][web,admin] Add clear console (#1490)
Co-authored-by:
wenmo
<
32723967+wenmo@users.noreply.github.com
>
parent
17a803a7
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
64 additions
and
42 deletions
+64
-42
ProcessController.java
...src/main/java/com/dlink/controller/ProcessController.java
+6
-0
ProcessService.java
...admin/src/main/java/com/dlink/service/ProcessService.java
+2
-0
ProcessServiceImpl.java
.../main/java/com/dlink/service/impl/ProcessServiceImpl.java
+5
-0
RelMdColumnOrigins.java
...a/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java
+3
-7
RelMdColumnOrigins.java
...a/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java
+3
-7
RelMdColumnOrigins.java
...a/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java
+3
-7
RelMdColumnOrigins.java
...a/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java
+3
-7
RelMdColumnOrigins.java
...a/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java
+3
-7
ConsolePool.java
...ess/src/main/java/com/dlink/process/pool/ConsolePool.java
+5
-0
index.tsx
...c/components/Studio/StudioConsole/StudioExplain/index.tsx
+9
-4
DDL.ts
dlink-web/src/components/Studio/StudioEvent/DDL.ts
+5
-0
index.tsx
dlink-web/src/components/Studio/StudioMenu/index.tsx
+15
-3
pages.ts
dlink-web/src/locales/en-US/pages.ts
+1
-0
pages.ts
dlink-web/src/locales/zh-CN/pages.ts
+1
-0
No files found.
dlink-admin/src/main/java/com/dlink/controller/ProcessController.java
View file @
54cebe02
...
...
@@ -57,4 +57,10 @@ public class ProcessController {
public
Result
<
String
>
getConsoleByUserId
()
{
return
Result
.
data
(
processService
.
getConsoleByUserId
(
StpUtil
.
getLoginIdAsInt
()));
}
@GetMapping
(
"/clearConsole"
)
public
Result
<
String
>
clearConsole
()
{
processService
.
clearConsoleByUserId
(
StpUtil
.
getLoginIdAsInt
());
return
Result
.
succeed
(
"Clear succeed."
);
}
}
dlink-admin/src/main/java/com/dlink/service/ProcessService.java
View file @
54cebe02
...
...
@@ -34,4 +34,6 @@ public interface ProcessService {
List
<
ProcessEntity
>
listAllProcess
(
boolean
active
);
String
getConsoleByUserId
(
Integer
userId
);
void
clearConsoleByUserId
(
Integer
userId
);
}
dlink-admin/src/main/java/com/dlink/service/impl/ProcessServiceImpl.java
View file @
54cebe02
...
...
@@ -60,4 +60,9 @@ public class ProcessServiceImpl implements ProcessService {
return
""
;
}
}
@Override
public
void
clearConsoleByUserId
(
Integer
userId
)
{
ConsolePool
.
clear
(
userId
);
}
}
dlink-client/dlink-client-1.11/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java
View file @
54cebe02
...
...
@@ -232,7 +232,6 @@ public class RelMdColumnOrigins implements MetadataHandler<BuiltInMetadata.Colum
return
null
;
}
/**
* Support the field blood relationship of ROW_NUMBER()
*/
...
...
@@ -250,13 +249,10 @@ public class RelMdColumnOrigins implements MetadataHandler<BuiltInMetadata.Colum
if
(!
rel
.
groups
.
isEmpty
())
{
Window
.
Group
group
=
rel
.
groups
.
get
(
groupIndex
);
// process partition by keys
group
.
keys
.
asList
().
forEach
(
index
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
index
))
);
group
.
keys
.
asList
().
forEach
(
index
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
index
)));
// process order by keys
group
.
orderKeys
.
getFieldCollations
().
forEach
(
e
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
e
.
getFieldIndex
()))
);
group
.
orderKeys
.
getFieldCollations
()
.
forEach
(
e
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
e
.
getFieldIndex
())));
}
return
set
;
}
...
...
dlink-client/dlink-client-1.12/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java
View file @
54cebe02
...
...
@@ -232,7 +232,6 @@ public class RelMdColumnOrigins implements MetadataHandler<BuiltInMetadata.Colum
return
null
;
}
/**
* Support the field blood relationship of ROW_NUMBER()
*/
...
...
@@ -250,13 +249,10 @@ public class RelMdColumnOrigins implements MetadataHandler<BuiltInMetadata.Colum
if
(!
rel
.
groups
.
isEmpty
())
{
Window
.
Group
group
=
rel
.
groups
.
get
(
groupIndex
);
// process partition by keys
group
.
keys
.
asList
().
forEach
(
index
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
index
))
);
group
.
keys
.
asList
().
forEach
(
index
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
index
)));
// process order by keys
group
.
orderKeys
.
getFieldCollations
().
forEach
(
e
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
e
.
getFieldIndex
()))
);
group
.
orderKeys
.
getFieldCollations
()
.
forEach
(
e
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
e
.
getFieldIndex
())));
}
return
set
;
}
...
...
dlink-client/dlink-client-1.13/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java
View file @
54cebe02
...
...
@@ -232,7 +232,6 @@ public class RelMdColumnOrigins implements MetadataHandler<BuiltInMetadata.Colum
return
null
;
}
/**
* Support the field blood relationship of ROW_NUMBER()
*/
...
...
@@ -250,13 +249,10 @@ public class RelMdColumnOrigins implements MetadataHandler<BuiltInMetadata.Colum
if
(!
rel
.
groups
.
isEmpty
())
{
Window
.
Group
group
=
rel
.
groups
.
get
(
groupIndex
);
// process partition by keys
group
.
keys
.
asList
().
forEach
(
index
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
index
))
);
group
.
keys
.
asList
().
forEach
(
index
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
index
)));
// process order by keys
group
.
orderKeys
.
getFieldCollations
().
forEach
(
e
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
e
.
getFieldIndex
()))
);
group
.
orderKeys
.
getFieldCollations
()
.
forEach
(
e
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
e
.
getFieldIndex
())));
}
return
set
;
}
...
...
dlink-client/dlink-client-1.15/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java
View file @
54cebe02
...
...
@@ -232,7 +232,6 @@ public class RelMdColumnOrigins implements MetadataHandler<BuiltInMetadata.Colum
return
null
;
}
/**
* Support the field blood relationship of ROW_NUMBER()
*/
...
...
@@ -250,13 +249,10 @@ public class RelMdColumnOrigins implements MetadataHandler<BuiltInMetadata.Colum
if
(!
rel
.
groups
.
isEmpty
())
{
Window
.
Group
group
=
rel
.
groups
.
get
(
groupIndex
);
// process partition by keys
group
.
keys
.
asList
().
forEach
(
index
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
index
))
);
group
.
keys
.
asList
().
forEach
(
index
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
index
)));
// process order by keys
group
.
orderKeys
.
getFieldCollations
().
forEach
(
e
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
e
.
getFieldIndex
()))
);
group
.
orderKeys
.
getFieldCollations
()
.
forEach
(
e
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
e
.
getFieldIndex
())));
}
return
set
;
}
...
...
dlink-client/dlink-client-1.16/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java
View file @
54cebe02
...
...
@@ -232,7 +232,6 @@ public class RelMdColumnOrigins implements MetadataHandler<BuiltInMetadata.Colum
return
null
;
}
/**
* Support the field blood relationship of ROW_NUMBER()
*/
...
...
@@ -250,13 +249,10 @@ public class RelMdColumnOrigins implements MetadataHandler<BuiltInMetadata.Colum
if
(!
rel
.
groups
.
isEmpty
())
{
Window
.
Group
group
=
rel
.
groups
.
get
(
groupIndex
);
// process partition by keys
group
.
keys
.
asList
().
forEach
(
index
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
index
))
);
group
.
keys
.
asList
().
forEach
(
index
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
index
)));
// process order by keys
group
.
orderKeys
.
getFieldCollations
().
forEach
(
e
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
e
.
getFieldIndex
()))
);
group
.
orderKeys
.
getFieldCollations
()
.
forEach
(
e
->
set
.
addAll
(
mq
.
getColumnOrigins
(
input
,
e
.
getFieldIndex
())));
}
return
set
;
}
...
...
dlink-process/src/main/java/com/dlink/process/pool/ConsolePool.java
View file @
54cebe02
...
...
@@ -54,4 +54,9 @@ public class ConsolePool extends AbstractPool<StringBuilder> {
String
user
=
String
.
valueOf
(
userId
);
consoleEntityMap
.
computeIfAbsent
(
user
,
k
->
new
StringBuilder
(
"Dinky User Console:"
)).
append
(
str
);
}
public
static
void
clear
(
Integer
userId
)
{
String
user
=
String
.
valueOf
(
userId
);
consoleEntityMap
.
put
(
user
,
new
StringBuilder
(
"Dinky User Console:"
));
}
}
dlink-web/src/components/Studio/StudioConsole/StudioExplain/index.tsx
View file @
54cebe02
...
...
@@ -84,10 +84,15 @@ const StudioExplain = (props: any) => {
result
.
then
(
res
=>
{
const
errorExplainData
:
[]
=
[];
let
errorCount
:
number
=
0
;
for
(
let
i
in
res
.
datas
)
{
if
(
!
res
.
datas
[
i
].
explainTrue
||
!
res
.
datas
[
i
].
parseTrue
)
{
errorExplainData
.
push
(
res
.
datas
[
i
]);
errorCount
++
;
if
(
!
res
.
datas
){
setResult
(<
Text
type=
"danger"
>
{
res
.
msg
}
</
Text
>);
return
;
}
else
{
for
(
let
i
in
res
.
datas
)
{
if
(
!
res
.
datas
[
i
].
explainTrue
||
!
res
.
datas
[
i
].
parseTrue
)
{
errorExplainData
.
push
(
res
.
datas
[
i
]);
errorCount
++
;
}
}
}
if
(
errorCount
==
0
)
{
...
...
dlink-web/src/components/Studio/StudioEvent/DDL.ts
View file @
54cebe02
...
...
@@ -341,3 +341,8 @@ export async function showMetaStoreCatalogs(task: TaskType, dispatch: any) {
});
})
}
/*--- Clear Console ---*/
export
function
clearConsole
()
{
return
getData
(
'api/process/clearConsole'
,
{});
}
dlink-web/src/components/Studio/StudioMenu/index.tsx
View file @
54cebe02
...
...
@@ -24,6 +24,7 @@ import {
ApiTwoTone
,
CameraTwoTone
,
CarryOutTwoTone
,
ClearOutlined
,
ClusterOutlined
,
CodeTwoTone
,
DeleteTwoTone
,
...
...
@@ -56,7 +57,7 @@ import TaskAPI from "@/pages/API/TaskAPI";
import
StudioHelp
from
"./StudioHelp"
;
import
StudioGraph
from
"./StudioGraph"
;
import
{
cancelTask
,
cancelTask
,
clearConsole
,
developTask
,
offLineTask
,
onLineTask
,
...
...
@@ -322,6 +323,10 @@ const StudioMenu = (props: any) => {
}
};
const
toClearConsole
=
()
=>
{
clearConsole
();
};
const
saveSqlAndSettingToTask
=
()
=>
{
props
.
saveTask
(
current
);
};
...
...
@@ -557,7 +562,7 @@ const StudioMenu = (props: any) => {
<
Divider
className=
{
styles
[
"ant-divider-horizontal-0"
]
}
/>
<
Col
span=
{
24
}
>
<
Row
>
<
Col
span=
{
1
6
}
>
<
Col
span=
{
1
2
}
>
<
Breadcrumb
className=
{
styles
[
"dw-path"
]
}
>
<
EnvironmentOutlined
style=
{
{
lineHeight
:
'32px'
}
}
/>
<
Divider
type=
"vertical"
style=
{
{
height
:
'unset'
}
}
/>
...
...
@@ -579,7 +584,14 @@ const StudioMenu = (props: any) => {
)
}
</
Col
>
{
current
?.
task
?
<
Col
span=
{
8
}
>
<
Col
span=
{
12
}
>
<
Tooltip
title=
{
l
(
'pages.datastudio.editor.clearConsole'
)
}
>
<
Button
type=
"text"
icon=
{
<
ClearOutlined
style=
{
{
color
:
'#1890ff'
}
}
/>
}
onClick=
{
toClearConsole
}
/>
</
Tooltip
>
<
Tooltip
title=
{
l
(
'pages.datastudio.editor.fullScreen'
)
}
>
<
Button
type=
"text"
...
...
dlink-web/src/locales/en-US/pages.ts
View file @
54cebe02
...
...
@@ -128,6 +128,7 @@ export default {
'pages.datastudio.editor.recovery.job.success'
:
'The recovery job [{jobName}] succeeded'
,
'pages.datastudio.editor.api.doc'
:
'API Manual'
,
'pages.datastudio.editor.usehelp'
:
'Use help'
,
'pages.datastudio.editor.clearConsole'
:
'Clear Console'
,
'pages.datastudio.editor.fullScreen'
:
'FullScreen Development'
,
'pages.datastudio.editor.fullScreen.exit'
:
'Exit FullScreen'
,
'pages.datastudio.editor.save'
:
'Save the current FlinkSql and Config'
,
...
...
dlink-web/src/locales/zh-CN/pages.ts
View file @
54cebe02
...
...
@@ -129,6 +129,7 @@ export default {
'pages.datastudio.editor.recovery.job.success'
:
'恢复作业【{jobName}】成功'
,
'pages.datastudio.editor.api.doc'
:
' API 手册'
,
'pages.datastudio.editor.usehelp'
:
'使用帮助'
,
'pages.datastudio.editor.clearConsole'
:
'清空控制台'
,
'pages.datastudio.editor.fullScreen'
:
'全屏开发'
,
'pages.datastudio.editor.fullScreen.exit'
:
'退出全屏'
,
'pages.datastudio.editor.save'
:
'保存当前的 FlinkSql 及配置'
,
...
...
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