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
44ba44d2
Commit
44ba44d2
authored
Jun 05, 2021
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.1.0 rc4
parent
b02ec081
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
319 additions
and
87 deletions
+319
-87
pom.xml
dlink-admin/pom.xml
+17
-0
StudioController.java
.../src/main/java/com/dlink/controller/StudioController.java
+30
-6
StudioService.java
...-admin/src/main/java/com/dlink/service/StudioService.java
+2
-0
StudioServiceImpl.java
...c/main/java/com/dlink/service/impl/StudioServiceImpl.java
+10
-0
pom.xml
dlink-connector/pom.xml
+67
-0
pom.xml
dlink-core/pom.xml
+27
-24
JobManager.java
dlink-core/src/main/java/com/dlink/job/JobManager.java
+11
-7
auto.sh
dlink-doc/bin/auto.sh
+2
-2
application.yml
dlink-doc/config/application.yml
+29
-0
crud.ts
dlink-web/src/components/Common/crud.ts
+2
-2
index.tsx
dlink-web/src/components/Studio/StudioConnector/index.tsx
+31
-8
index.tsx
...eb/src/components/Studio/StudioConsole/StudioFX/index.tsx
+4
-12
index.tsx
dlink-web/src/components/Studio/StudioConsole/index.tsx
+20
-9
index.tsx
dlink-web/src/components/Studio/StudioMenu/index.tsx
+27
-7
index.tsx
dlink-web/src/components/Studio/StudioTree/index.tsx
+29
-5
model.ts
dlink-web/src/pages/FlinkSqlStudio/model.ts
+0
-2
Welcome.tsx
dlink-web/src/pages/Welcome.tsx
+5
-2
index.tsx
dlink-web/src/pages/user/Login/index.tsx
+0
-1
pom.xml
pom.xml
+6
-0
No files found.
dlink-admin/pom.xml
View file @
44ba44d2
...
...
@@ -74,6 +74,10 @@
<groupId>
com.dlink
</groupId>
<artifactId>
dlink-core
</artifactId>
</dependency>
<!--<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-connector</artifactId>
</dependency>-->
</dependencies>
<build>
<plugins>
...
...
@@ -92,6 +96,19 @@
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
versions-maven-plugin
</artifactId>
</plugin>
<!--<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.dlink.Dlink</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>-->
</plugins>
<finalName>
${project.artifactId}
</finalName>
</build>
...
...
dlink-admin/src/main/java/com/dlink/controller/StudioController.java
View file @
44ba44d2
...
...
@@ -6,12 +6,13 @@ import com.dlink.dto.StudioExecuteDTO;
import
com.dlink.model.Task
;
import
com.dlink.result.RunResult
;
import
com.dlink.service.StudioService
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.
PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.
*
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* StudioController
...
...
@@ -31,7 +32,7 @@ public class StudioController {
* 执行Sql
*/
@PostMapping
(
"/executeSql"
)
public
Result
executeSql
(
@RequestBody
StudioExecuteDTO
studioExecuteDTO
)
throws
Exception
{
public
Result
executeSql
(
@RequestBody
StudioExecuteDTO
studioExecuteDTO
)
{
RunResult
runResult
=
studioService
.
executeSql
(
studioExecuteDTO
);
return
Result
.
succeed
(
runResult
,
"执行成功"
);
}
...
...
@@ -40,8 +41,31 @@ public class StudioController {
* 进行DDL操作
*/
@PostMapping
(
"/executeDDL"
)
public
Result
executeDDL
(
@RequestBody
StudioDDLDTO
studioDDLDTO
)
throws
Exception
{
public
Result
executeDDL
(
@RequestBody
StudioDDLDTO
studioDDLDTO
)
{
RunResult
runResult
=
studioService
.
executeDDL
(
studioDDLDTO
);
return
Result
.
succeed
(
runResult
,
"执行成功"
);
}
/**
* 清除指定session
*/
@DeleteMapping
(
"/clearSession"
)
public
Result
clearSession
(
@RequestBody
JsonNode
para
)
{
if
(
para
.
size
()>
0
){
List
<
String
>
error
=
new
ArrayList
<>();
for
(
final
JsonNode
item
:
para
){
String
session
=
item
.
asText
();
if
(!
studioService
.
clearSession
(
session
)){
error
.
add
(
session
);
}
}
if
(
error
.
size
()==
0
)
{
return
Result
.
succeed
(
"清除成功"
);
}
else
{
return
Result
.
succeed
(
"清除部分成功,但"
+
error
.
toString
()+
"清除失败,共"
+
error
.
size
()+
"次失败。"
);
}
}
else
{
return
Result
.
failed
(
"请选择要清除的记录"
);
}
}
}
dlink-admin/src/main/java/com/dlink/service/StudioService.java
View file @
44ba44d2
...
...
@@ -14,4 +14,6 @@ public interface StudioService {
RunResult
executeSql
(
StudioExecuteDTO
studioExecuteDTO
);
RunResult
executeDDL
(
StudioDDLDTO
studioDDLDTO
);
boolean
clearSession
(
String
session
);
}
dlink-admin/src/main/java/com/dlink/service/impl/StudioServiceImpl.java
View file @
44ba44d2
...
...
@@ -11,6 +11,7 @@ import com.dlink.model.Cluster;
import
com.dlink.result.RunResult
;
import
com.dlink.service.ClusterService
;
import
com.dlink.service.StudioService
;
import
com.dlink.session.SessionPool
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -70,4 +71,13 @@ public class StudioServiceImpl implements StudioService {
return
jobManager
.
execute
(
studioDDLDTO
.
getStatement
(),
new
ExecutorSetting
(
ExecuteType
));
}
@Override
public
boolean
clearSession
(
String
session
)
{
if
(
SessionPool
.
remove
(
session
)>
0
){
return
true
;
}
else
{
return
false
;
}
}
}
dlink-connector/pom.xml
0 → 100644
View file @
44ba44d2
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
dlink
</artifactId>
<groupId>
com.dlink
</groupId>
<version>
0.1.0
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<packaging>
jar
</packaging>
<artifactId>
dlink-connector
</artifactId>
<properties>
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<flink.version>
1.12.4
</flink.version>
<scala.binary.version>
2.11
</scala.binary.version>
<maven.compiler.source>
1.8
</maven.compiler.source>
<maven.compiler.target>
1.8
</maven.compiler.target>
<junit.version>
4.12
</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.apache.flink
</groupId>
<artifactId>
flink-table-planner-blink_${scala.binary.version}
</artifactId>
<!--<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>-->
<version>
${flink.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.flink
</groupId>
<artifactId>
flink-clients_${scala.binary.version}
</artifactId>
<version>
${flink.version}
</version>
<!--<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>-->
<!--<scope>provided</scope>-->
</dependency>
<dependency>
<groupId>
org.apache.flink
</groupId>
<artifactId>
flink-connector-jdbc_2.11
</artifactId>
<version>
${flink.version}
</version>
<!--<scope>provided</scope>-->
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>
maven-assembly-plugin
</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>
jar-with-dependencies
</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
<finalName>
${project.artifactId}
</finalName>
</build>
</project>
\ No newline at end of file
dlink-core/pom.xml
View file @
44ba44d2
...
...
@@ -11,14 +11,14 @@
<packaging>
jar
</packaging>
<artifactId>
dlink-core
</artifactId>
<properties>
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<flink.version>
1.12.4
</flink.version>
<scala.binary.version>
2.11
</scala.binary.version>
<maven.compiler.source>
1.8
</maven.compiler.source>
<maven.compiler.target>
1.8
</maven.compiler.target>
<junit.version>
4.12
</junit.version>
</properties>
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<flink.version>
1.12.4
</flink.version>
<scala.binary.version>
2.11
</scala.binary.version>
<maven.compiler.source>
1.8
</maven.compiler.source>
<maven.compiler.target>
1.8
</maven.compiler.target>
<junit.version>
4.12
</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>
cn.hutool
</groupId>
...
...
@@ -26,37 +26,40 @@
</dependency>
<!--<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner_${scala.binary.version}</artifactId>
<artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
<version>${flink.version}</version>
</dependency>-->
<dependency>
<
!--<
dependency>
<groupId>org.apache.flink</groupId>
<artifactId>
flink-
table-planner-blink
_${scala.binary.version}
</artifactId>
<artifactId>flink-
clients
_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
</dependency>
<dependency>
</dependency>
-->
<
!--<
dependency>
<groupId>org.apache.flink</groupId>
<artifactId>
f
link-clients_${scala.binary.version}
</artifactId>
<artifactId>f
orce-shading
</artifactId>
<version>${flink.version}</version>
</dependency>
<dependency>
</dependency>
-->
<
!--<
dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-jdbc_2.11</artifactId>
<version>${flink.version}</version>
<scope>
provided
</scope>
</dependency>
</dependency>-->
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
${junit.version}
</version>
<scope>
provided
</scope>
</dependency>
<!--<!–@Nullable–>
<dependency>
<groupId>com.
google.code.findbugs
</groupId>
<artifactId>
jsr305
</artifactId>
<
version>1.3.9</version
>
</dependency>
-->
<groupId>
com.
dlink
</groupId>
<artifactId>
dlink-connector
</artifactId>
<
!--<scope>provided</scope>--
>
</dependency>
</dependencies>
</project>
\ No newline at end of file
dlink-core/src/main/java/com/dlink/job/JobManager.java
View file @
44ba44d2
...
...
@@ -110,14 +110,16 @@ public class JobManager {
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
StackTraceElement
[]
trace
=
e
.
getStackTrace
();
StringBuffer
resMsg
=
new
StringBuffer
(
""
);
StackTraceElement
[]
trace
=
e
.
get
Cause
().
get
StackTrace
();
/*
StringBuffer resMsg = new StringBuffer("");
for (StackTraceElement s : trace) {
resMsg.append(" \n " + s + " ");
}
}
*/
runResult
.
setFinishDate
(
LocalDateTime
.
now
());
runResult
.
setSuccess
(
false
);
runResult
.
setError
(
LocalDateTime
.
now
().
toString
()
+
":"
+
"运行第"
+
currentIndex
+
"行sql时出现异常:"
+
e
.
getMessage
()
+
" \n >>>堆栈信息<<<"
+
resMsg
.
toString
());
// runResult.setError(LocalDateTime.now().toString() + ":" + "运行第" + currentIndex + "行sql时出现异常:" + e.getMessage());
// runResult.setError(LocalDateTime.now().toString() + ":" + "运行第" + currentIndex + "行sql时出现异常:" + e.getMessage() + " \n >>>堆栈信息<<<" + resMsg.toString());
runResult
.
setError
(
LocalDateTime
.
now
().
toString
()
+
":"
+
"运行第"
+
currentIndex
+
"行sql时出现异常:"
+
e
.
getMessage
()
+
"\n >>>异常原因<<< \n"
+
e
.
getCause
().
toString
());
return
runResult
;
}
return
runResult
;
...
...
@@ -164,12 +166,14 @@ public class JobManager {
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
StackTraceElement
[]
trace
=
e
.
getStackTrace
();
StringBuilder
resMsg
=
new
StringBuilder
();
/*
StringBuilder resMsg = new StringBuilder();
for (StackTraceElement s : trace) {
resMsg.append(" \n " + s + " ");
}
}
*/
result
.
setSuccess
(
false
);
result
.
setError
(
LocalDateTime
.
now
().
toString
()
+
":"
+
"运行第"
+
currentIndex
+
"行sql时出现异常:"
+
e
.
getMessage
()
+
"\n >>>堆栈信息<<<"
+
resMsg
.
toString
());
// result.setError(LocalDateTime.now().toString() + ":" + "运行第" + currentIndex + "行sql时出现异常:" + e.getMessage());
// result.setError(LocalDateTime.now().toString() + ":" + "运行第" + currentIndex + "行sql时出现异常:" + e.getMessage() + "\n >>>堆栈信息<<<" + resMsg.toString());
result
.
setError
(
LocalDateTime
.
now
().
toString
()
+
":"
+
"运行第"
+
currentIndex
+
"行sql时出现异常:"
+
e
.
getMessage
()
+
"\n >>>异常原因<<< \n"
+
e
.
getCause
().
toString
());
return
result
;
}
...
...
dlink-doc/bin/auto.sh
View file @
44ba44d2
...
...
@@ -2,7 +2,7 @@
# 定义变量
# 要运行的jar包路径,加不加引号都行。 注意:等号两边 不能 有空格,否则会提示command找不到
JAR_NAME
=
"./dlink-admin.jar"
LIB_PATH
=
"
./lib"
SETTING
=
"-Djava.ext.dirs=
./lib"
# 如果输入格式不对,给出提示!
tips
()
{
...
...
@@ -19,7 +19,7 @@ start() {
pid
=
`
ps
-ef
|
grep
$JAR_NAME
|
grep
-v
grep
|
awk
'{print $2}'
`
# -z 表示如果$pid为空时执行
if
[
-z
$pid
]
;
then
nohup
java
-Djava
.ext.dirs
=
$LIB_PATH
-Doracle
.jdbc.thinLogonCapability
=
o3
-jar
-Xms512M
-Xmx2048M
-XX
:PermSize
=
512M
-XX
:MaxPermSize
=
1024M
$JAR_NAME
>
/dev/null 2>&1 &
nohup
java
$SETTING
-jar
-Xms512M
-Xmx2048M
-XX
:PermSize
=
512M
-XX
:MaxPermSize
=
1024M
$JAR_NAME
>
/dev/null 2>&1 &
pid
=
`
ps
-ef
|
grep
$JAR_NAME
|
grep
-v
grep
|
awk
'{print $2}'
`
echo
""
echo
"Service
${
JAR_NAME
}
is starting!pid=
${
pid
}
"
...
...
dlink-doc/config/application.yml
0 → 100644
View file @
44ba44d2
spring
:
datasource
:
url
:
jdbc:mysql://192.168.24.1:3306/dlink?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
username
:
dlink
password
:
dlink
driver-class-name
:
com.mysql.cj.jdbc.Driver
application
:
name
:
dlink
server
:
port
:
8888
mybatis-plus
:
mapper-locations
:
classpath:/mapper/*Mapper.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage
:
com.dlink.model
global-config
:
db-config
:
id-type
:
auto
configuration
:
##### mybatis-plus打印完整sql(只适用于开发环境)
log-impl
:
org.apache.ibatis.logging.nologging.NoLoggingImpl
dlink
:
##### 登录用户配置
login
:
username
:
admin
password
:
admin
\ No newline at end of file
dlink-web/src/components/Common/crud.ts
View file @
44ba44d2
...
...
@@ -12,7 +12,7 @@ export async function queryData(url:string,params?: TableListParams) {
});
}
export
async
function
removeData
(
url
:
string
,
params
:
number
[])
{
export
async
function
removeData
(
url
:
string
,
params
:
any
[])
{
return
request
(
url
,
{
method
:
'DELETE'
,
data
:
{
...
...
@@ -87,7 +87,7 @@ export const handleRemove = async (url:string,selectedRows: []) => {
}
};
export
const
handleSubmit
=
async
(
url
:
string
,
title
:
string
,
selectedRows
:
[])
=>
{
export
const
handleSubmit
=
async
(
url
:
string
,
title
:
string
,
selectedRows
:
any
[])
=>
{
const
hide
=
message
.
loading
(
'正在'
+
title
);
if
(
!
selectedRows
)
return
true
;
try
{
...
...
dlink-web/src/components/Studio/StudioConnector/index.tsx
View file @
44ba44d2
...
...
@@ -3,9 +3,10 @@ import {StateType} from "@/pages/FlinkSqlStudio/model";
import
{
connect
}
from
"umi"
;
import
{
useState
}
from
"react"
;
// import Highlighter from 'react-highlight-words';
import
{
SearchOutlined
,
DownOutlined
,
Tabl
eOutlined
}
from
'@ant-design/icons'
;
import
{
SearchOutlined
,
DownOutlined
,
Delet
eOutlined
}
from
'@ant-design/icons'
;
import
React
from
"react"
;
import
{
executeDDL
}
from
"@/pages/FlinkSqlStudio/service"
;
import
{
handleRemove
}
from
"@/components/Common/crud"
;
const
StudioConnector
=
(
props
:
any
)
=>
{
...
...
@@ -151,6 +152,22 @@ const StudioConnector = (props:any) => {
});
};
const
clearSession
=
()
=>
{
let
newLoadings
=
[...
loadings
];
newLoadings
[
2
]
=
true
;
setLoadings
(
newLoadings
);
let
session
=
{
id
:
current
.
task
.
clusterId
+
'_'
+
current
.
task
.
session
,
};
const
res
=
handleRemove
(
'/api/studio/clearSession'
,[
session
]);
res
.
then
((
result
)
=>
{
getTables
();
let
newLoadings
=
[...
loadings
];
newLoadings
[
2
]
=
false
;
setLoadings
(
newLoadings
);
});
};
const
getColumns
=
()
=>
{
let
columns
:
any
=
[{
title
:
"表名"
,
...
...
@@ -183,14 +200,20 @@ const StudioConnector = (props:any) => {
return
(
<>
<
Space
>
<
Button
type=
"primary"
icon=
{
<
SearchOutlined
/>
}
loading=
{
loadings
[
0
]
}
onClick=
{
()
=>
getTables
()
}
/>
<
Button
type=
"primary"
icon=
{
<
TableOutlined
/>
}
loading=
{
loadings
[
0
]
}
onClick=
{
()
=>
getTables
()
}
>
获取Connectors
</
Button
>
danger
icon=
{
<
DeleteOutlined
/>
}
loading=
{
loadings
[
2
]
}
onClick=
{
()
=>
clearSession
()
}
/>
</
Space
>
{
tableData
&&
tableData
.
length
>
0
?(<
Table
dataSource=
{
tableData
}
columns=
{
getColumns
()
}
/>):(<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>)
}
</>
);
...
...
dlink-web/src/components/Studio/StudioConsole/StudioFX/index.tsx
View file @
44ba44d2
...
...
@@ -15,19 +15,10 @@ const StudioFX = () => {
const
[
row
,
setRow
]
=
useState
<
DocumentTableListItem
>
();
const
columns
:
ProColumns
<
DocumentTableListItem
>
[]
=
[
{
title
:
'
名称
'
,
title
:
'
函数
'
,
dataIndex
:
'name'
,
tip
:
'名称是唯一的'
,
sorter
:
true
,
width
:
'400px'
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'名称为必填项'
,
},
],
},
render
:
(
dom
,
entity
)
=>
{
return
<
a
onClick=
{
()
=>
setRow
(
entity
)
}
>
{
dom
}
</
a
>;
},
...
...
@@ -176,7 +167,8 @@ const StudioFX = () => {
hideInForm
:
true
,
hideInSearch
:
true
,
hideInTable
:
true
,
},{
},
{
title
:
'赞'
,
sorter
:
true
,
dataIndex
:
'likeNum'
,
...
...
@@ -249,7 +241,7 @@ const StudioFX = () => {
return
(
<>
<
ProTable
<
DocumentTableListItem
>
headerTitle="
文档
浏览"
headerTitle="
FlinkSql 函数
浏览"
actionRef=
{
actionRef
}
rowKey="id"
search=
{
{
...
...
dlink-web/src/components/Studio/StudioConsole/index.tsx
View file @
44ba44d2
import
{
Tabs
,
Empty
}
from
"antd"
;
import
{
CodeOutlined
,
TableOutlined
,
RadarChartOutlined
,
CalendarOutlined
,
FileSearchOutlined
,
DesktopOutlined
,
FunctionOutlined
}
from
"@ant-design/icons"
;
,
FunctionOutlined
,
ApartmentOutlined
}
from
"@ant-design/icons"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
connect
}
from
"umi"
;
import
styles
from
"./index.less"
;
...
...
@@ -16,7 +16,7 @@ const { TabPane } = Tabs;
const
StudioConsole
=
(
props
:
any
)
=>
{
return
(
<
Tabs
defaultActiveKey=
"
1
"
size=
"small"
>
<
Tabs
defaultActiveKey=
"
StudioMsg
"
size=
"small"
>
<
TabPane
tab=
{
<
span
>
...
...
@@ -24,7 +24,7 @@ const StudioConsole = (props:any) => {
信息
</
span
>
}
key=
"
1
"
key=
"
StudioMsg
"
>
<
StudioMsg
/>
</
TabPane
>
...
...
@@ -35,7 +35,7 @@ const StudioConsole = (props:any) => {
结果
</
span
>
}
key=
"
2
"
key=
"
StudioTable
"
>
<
StudioTable
/>
</
TabPane
>
...
...
@@ -46,7 +46,18 @@ const StudioConsole = (props:any) => {
指标
</
span
>
}
key=
"3"
key=
"StudioMetrics"
>
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
</
TabPane
>
<
TabPane
tab=
{
<
span
>
<
ApartmentOutlined
/>
血缘
</
span
>
}
key=
"StudioConsanguinity"
>
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
</
TabPane
>
...
...
@@ -57,7 +68,7 @@ const StudioConsole = (props:any) => {
进程
</
span
>
}
key=
"
4
"
key=
"
StudioProcess
"
>
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
</
TabPane
>
...
...
@@ -68,7 +79,7 @@ const StudioConsole = (props:any) => {
历史
</
span
>
}
key=
"
5
"
key=
"
StudioHistory
"
>
<
StudioHistory
/>
</
TabPane
>
...
...
@@ -79,7 +90,7 @@ const StudioConsole = (props:any) => {
函数
</
span
>
}
key=
"
6
"
key=
"
StudioFX
"
>
<
StudioFX
/>
</
TabPane
>
...
...
@@ -90,7 +101,7 @@ const StudioConsole = (props:any) => {
文档
</
span
>
}
key=
"
7
"
key=
"
StudioDocument
"
>
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
</
TabPane
>
...
...
dlink-web/src/components/Studio/StudioMenu/index.tsx
View file @
44ba44d2
import
styles
from
"./index.less"
;
import
{
Menu
,
Dropdown
,
Tooltip
,
Row
,
Col
,
Popconfirm
,
notification
}
from
"antd"
;
import
{
Menu
,
Dropdown
,
Tooltip
,
Row
,
Col
,
Popconfirm
,
notification
,
Modal
}
from
"antd"
;
import
{
PauseCircleTwoTone
,
CopyTwoTone
,
DeleteTwoTone
,
PlayCircleTwoTone
,
DiffTwoTone
,
FileAddTwoTone
,
FolderOpenTwoTone
,
SafetyCertificateTwoTone
,
SaveTwoTone
,
FlagTwoTone
,
EnvironmentOutlined
,
SmileOutlined
}
from
"@ant-design/icons"
;
EnvironmentOutlined
,
SmileOutlined
,
RocketTwoTone
}
from
"@ant-design/icons"
;
import
Space
from
"antd/es/space"
;
import
Divider
from
"antd/es/divider"
;
import
Button
from
"antd/es/button/button"
;
import
Breadcrumb
from
"antd/es/breadcrumb/Breadcrumb"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
connect
}
from
"umi"
;
import
{
postAll
}
from
"@/components/Common/crud"
;
import
{
handleSubmit
,
postAll
}
from
"@/components/Common/crud"
;
import
{
executeSql
}
from
"@/pages/FlinkSqlStudio/service"
;
const
menu
=
(
...
...
@@ -69,6 +69,21 @@ const StudioMenu = (props: any) => {
})
};
const
submit
=
()
=>
{
Modal
.
confirm
({
title
:
'异步提交作业'
,
content
:
'确定异步提交该作业到其配置的集群吗?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onOk
:
async
()
=>
{
let
task
=
{
id
:
current
.
task
.
id
,
};
handleSubmit
(
'/api/task/submit'
,
'作业'
,[
task
]);
}
});
};
const
saveSqlAndSettingToTask
=
async
()
=>
{
const
fieldsValue
=
await
form
.
validateFields
();
if
(
current
.
task
){
...
...
@@ -81,9 +96,6 @@ const StudioMenu = (props: any) => {
type
:
"Studio/saveTask"
,
payload
:
task
,
});
/*const success = handleAddOrUpdate('api/task',task);
console.log(success);
console.log(tabs);*/
}
else
{
}
...
...
@@ -91,7 +103,8 @@ const StudioMenu = (props: any) => {
const
runMenu
=
(
<
Menu
>
<
Menu
.
Item
onClick=
{
execute
}
>
执行
</
Menu
.
Item
>
<
Menu
.
Item
onClick=
{
execute
}
>
同步执行
</
Menu
.
Item
>
<
Menu
.
Item
onClick=
{
submit
}
>
异步提交
</
Menu
.
Item
>
</
Menu
>
);
...
...
@@ -174,6 +187,13 @@ const StudioMenu = (props: any) => {
onClick=
{
execute
}
/>
</
Tooltip
>
<
Tooltip
title=
"提交当前的作业到集群"
>
<
Button
type=
"text"
icon=
{
<
RocketTwoTone
/>
}
onClick=
{
submit
}
/>
</
Tooltip
>
<
Popconfirm
title=
"您确定要停止所有的 FlinkSql 任务吗?"
// onConfirm={confirm}
...
...
dlink-web/src/components/Studio/StudioTree/index.tsx
View file @
44ba44d2
...
...
@@ -6,7 +6,7 @@ import {getCatalogueTreeData} from "@/pages/FlinkSqlStudio/service";
import
{
convertToTreeData
,
DataType
,
TreeDataNode
}
from
"@/components/Studio/StudioTree/Function"
;
import
style
from
"./index.less"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
getInfoById
,
handleAddOrUpdate
,
handleInfo
,
handleRemove
}
from
"@/components/Common/crud"
;
import
{
getInfoById
,
handleAddOrUpdate
,
handleInfo
,
handleRemove
,
handleSubmit
}
from
"@/components/Common/crud"
;
import
UpdateCatalogueForm
from
'./components/UpdateCatalogueForm'
;
import
{
ActionType
}
from
"@ant-design/pro-table"
;
import
UpdateTaskForm
from
"@/components/Studio/StudioTree/components/UpdateTaskForm"
;
...
...
@@ -77,6 +77,8 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
setRightClickNodeTreeItem
(
null
);
if
(
key
==
'Open'
){
toOpen
(
rightClickNode
);
}
else
if
(
key
==
'Submit'
){
toSubmit
(
rightClickNode
);
}
else
if
(
key
==
'CreateCatalogue'
){
createCatalogue
(
rightClickNode
);
}
else
if
(
key
==
'CreateTask'
){
...
...
@@ -99,7 +101,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
return
;
}
}
const
result
=
getInfoById
(
'api/task'
,
node
.
taskId
);
const
result
=
getInfoById
(
'
/
api/task'
,
node
.
taskId
);
result
.
then
(
result
=>
{
let
newTabs
=
tabs
;
let
newPane
=
{
...
...
@@ -140,6 +142,21 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
}
};
const
toSubmit
=
(
node
:
TreeDataNode
)
=>
{
Modal
.
confirm
({
title
:
'提交作业'
,
content
:
'确定提交该作业到其配置的集群吗?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onOk
:
async
()
=>
{
let
task
=
{
id
:
node
.
taskId
,
};
handleSubmit
(
'/api/task/submit'
,
'作业'
,[
task
]);
}
});
};
const
toRename
=
(
node
:
TreeDataNode
)
=>
{
handleUpdateCatalogueModalVisible
(
true
);
setIsCreate
(
false
);
...
...
@@ -171,7 +188,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
okText
:
'确认'
,
cancelText
:
'取消'
,
onOk
:
async
()
=>
{
await
handleRemove
(
'api/catalogue'
,[
node
]);
await
handleRemove
(
'
/
api/catalogue'
,[
node
]);
getTreeData
();
}
});
...
...
@@ -190,9 +207,16 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
if
(
rightClickNode
&&
rightClickNode
.
isLeaf
){
menuItems
=
(<>
<
Menu
.
Item
key=
'Open'
>
{
'打开'
}
</
Menu
.
Item
>
<
Menu
.
Item
key=
'Submit'
>
{
'异步提交'
}
</
Menu
.
Item
>
<
Menu
.
Item
key=
'Rename'
>
{
'重命名'
}
</
Menu
.
Item
>
<
Menu
.
Item
key=
'Delete'
>
{
'删除'
}
</
Menu
.
Item
>
</>)
}
else
if
(
rightClickNode
&&
rightClickNode
.
children
&&
rightClickNode
.
children
.
length
>
0
){
menuItems
=
(<>
<
Menu
.
Item
key=
'CreateCatalogue'
>
{
'创建目录'
}
</
Menu
.
Item
>
<
Menu
.
Item
key=
'CreateTask'
>
{
'创建作业'
}
</
Menu
.
Item
>
<
Menu
.
Item
key=
'Rename'
>
{
'重命名'
}
</
Menu
.
Item
>
</>)
}
else
{
menuItems
=
(<>
<
Menu
.
Item
key=
'CreateCatalogue'
>
{
'创建目录'
}
</
Menu
.
Item
>
...
...
@@ -259,7 +283,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
<
UpdateCatalogueForm
onSubmit=
{
async
(
value
)
=>
{
const
success
=
await
handleAddOrUpdate
(
isCreate
?
'
api/catalogue'
:
'
api/catalogue/toRename'
,
value
);
isCreate
?
'
/api/catalogue'
:
'/
api/catalogue/toRename'
,
value
);
if
(
success
)
{
handleUpdateCatalogueModalVisible
(
false
);
setCatalogueFormValues
({});
...
...
@@ -278,7 +302,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
{
updateTaskModalVisible
?
(
<
UpdateTaskForm
onSubmit=
{
async
(
value
)
=>
{
const
success
=
await
handleAddOrUpdate
(
'api/catalogue/createTask'
,
value
);
const
success
=
await
handleAddOrUpdate
(
'
/
api/catalogue/createTask'
,
value
);
if
(
success
)
{
handleUpdateTaskModalVisible
(
false
);
setTaskFormValues
({});
...
...
dlink-web/src/pages/FlinkSqlStudio/model.ts
View file @
44ba44d2
...
...
@@ -195,7 +195,6 @@ const Model: ModelType = {
newCurrent
=
payload
.
panes
[
i
];
}
}
console
.
log
(
newCurrent
);
return
{
...
state
,
current
:{
...
...
@@ -247,7 +246,6 @@ const Model: ModelType = {
}
}
newSession
.
push
(
payload
);
console
.
log
(
newSession
);
return
{
...
state
,
session
:
newSession
,
...
...
dlink-web/src/pages/Welcome.tsx
View file @
44ba44d2
...
...
@@ -68,10 +68,13 @@ export default (): React.ReactNode => {
<
Paragraph
>
<
ul
>
<
li
>
<
Link
href=
""
>
FlinkSql Studio
会话管理
</
Link
>
<
Link
href=
""
>
FlinkSql Studio
进程监控
</
Link
>
</
li
>
<
li
>
<
Link
href=
""
>
FlinkSql Studio 进程监控
</
Link
>
<
Link
href=
""
>
FlinkSql Studio 集群总览
</
Link
>
</
li
>
<
li
>
<
Link
href=
""
>
FlinkSql Studio 集群任务
</
Link
>
</
li
>
<
li
>
<
Link
href=
""
>
FlinkSql Studio 任务详情
</
Link
>
...
...
dlink-web/src/pages/user/Login/index.tsx
View file @
44ba44d2
...
...
@@ -49,7 +49,6 @@ const Login: React.FC = () => {
const
fetchUserInfo
=
async
()
=>
{
const
userInfo
=
await
initialState
?.
fetchUserInfo
?.();
console
.
log
(
userInfo
);
if
(
userInfo
)
{
setInitialState
({
...
initialState
,
...
...
pom.xml
View file @
44ba44d2
...
...
@@ -11,6 +11,7 @@
<modules>
<module>
dlink-core
</module>
<module>
dlink-admin
</module>
<module>
dlink-connector
</module>
</modules>
<properties>
...
...
@@ -120,6 +121,11 @@
<artifactId>
dlink-core
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
com.dlink
</groupId>
<artifactId>
dlink-connector
</artifactId>
<version>
${project.version}
</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
...
...
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