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
0ee0a855
Unverified
Commit
0ee0a855
authored
Oct 16, 2022
by
aiwenmo
Committed by
GitHub
Oct 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Feature-1108][admin,web] Add system log and fix import order (#1109)
Co-authored-by:
wenmo
<
32723967+wenmo@users.noreply.github.com
>
parent
e52e5d3b
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
591 additions
and
52 deletions
+591
-52
pom.xml
dlink-admin/pom.xml
+5
-8
Result.java
...k-admin/src/main/java/com/dlink/common/result/Result.java
+5
-2
DirConstant.java
...k-admin/src/main/java/com/dlink/constant/DirConstant.java
+43
-0
SystemController.java
.../src/main/java/com/dlink/controller/SystemController.java
+64
-0
TenantInterceptor.java
...rc/main/java/com/dlink/interceptor/TenantInterceptor.java
+3
-5
FileNode.java
dlink-admin/src/main/java/com/dlink/model/FileNode.java
+73
-0
SystemService.java
...-admin/src/main/java/com/dlink/service/SystemService.java
+56
-0
SystemServiceImpl.java
...c/main/java/com/dlink/service/impl/SystemServiceImpl.java
+54
-0
DirUtil.java
dlink-admin/src/main/java/com/dlink/utils/DirUtil.java
+84
-0
application.yml
dlink-admin/src/main/resources/application.yml
+3
-3
DirUtilTest.java
dlink-admin/src/test/java/com/dlink/utils/DirUtilTest.java
+55
-0
routes.ts
dlink-web/config/routes.ts
+6
-0
package.json
dlink-web/package.json
+1
-1
menu.ts
dlink-web/src/locales/en-US/menu.ts
+1
-2
menu.ts
dlink-web/src/locales/zh-CN/menu.ts
+1
-5
data.d.ts
dlink-web/src/pages/SettingCenter/SystemInfo/data.d.ts
+18
-0
index.tsx
dlink-web/src/pages/SettingCenter/SystemInfo/index.tsx
+71
-0
service.ts
dlink-web/src/pages/SettingCenter/SystemInfo/service.ts
+24
-0
pom.xml
pom.xml
+5
-2
eclipse.importorder
style/eclipse.importorder
+0
-24
license_header
style/license_header
+19
-0
No files found.
dlink-admin/pom.xml
View file @
0ee0a855
...
...
@@ -15,16 +15,14 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
<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"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<artifactId>
dlink
</artifactId>
<groupId>
com.dlink
</groupId>
<artifactId>
dlink
</artifactId>
<version>
0.6.8-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
dlink-admin
</artifactId>
...
...
@@ -206,7 +204,6 @@
<groupId>
com.dlink
</groupId>
<artifactId>
dlink-scheduler
</artifactId>
</dependency>
</dependencies>
<build>
...
...
@@ -225,10 +222,10 @@
<executions>
<execution>
<id>
make-assembly
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
<phase>
package
</phase>
</execution>
</executions>
</plugin>
...
...
@@ -239,10 +236,10 @@
<executions>
<execution>
<id>
copy-static
</id>
<phase>
validate
</phase>
<goals>
<goal>
copy-resources
</goal>
</goals>
<phase>
validate
</phase>
<configuration>
<outputDirectory>
src/main/resources/static
</outputDirectory>
<overwrite>
true
</overwrite>
...
...
dlink-admin/src/main/java/com/dlink/common/result/Result.java
View file @
0ee0a855
...
...
@@ -56,8 +56,12 @@ public class Result<T> implements Serializable {
return
of
(
model
,
CodeEnum
.
SUCCESS
.
getCode
(),
""
);
}
public
static
<
T
>
Result
<
T
>
data
(
T
model
)
{
return
of
(
model
,
CodeEnum
.
SUCCESS
.
getCode
(),
""
);
}
public
static
<
T
>
Result
<
T
>
of
(
T
datas
,
Integer
code
,
String
msg
)
{
return
new
Result
<>(
datas
,
code
,
msg
,
new
DateTime
().
toString
());
return
new
Result
<>(
datas
,
code
,
msg
,
new
DateTime
().
toString
());
}
public
static
<
T
>
Result
<
T
>
failed
(
String
msg
)
{
...
...
@@ -72,4 +76,3 @@ public class Result<T> implements Serializable {
return
of
(
model
,
CodeEnum
.
ERROR
.
getCode
(),
msg
);
}
}
dlink-admin/src/main/java/com/dlink/constant/DirConstant.java
0 → 100644
View file @
0ee0a855
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
com
.
dlink
.
constant
;
import
com.dlink.Dlink
;
import
org.springframework.boot.system.ApplicationHome
;
/**
* DirConstant
*
* @author wenmo
* @since 2022/10/15 18:37
*/
public
class
DirConstant
{
public
static
final
String
LOG_DIR_PATH
;
public
static
final
String
ROOT_LOG_PATH
;
static
{
// String rootPath = new ApplicationHome(Dlink.class).getSource().getParent();
String
rootPath
=
new
ApplicationHome
(
Dlink
.
class
).
getDir
().
getPath
();
LOG_DIR_PATH
=
rootPath
+
"/../logs"
;
ROOT_LOG_PATH
=
rootPath
+
"/../logs/dlink.log"
;
}
}
dlink-admin/src/main/java/com/dlink/controller/SystemController.java
0 → 100644
View file @
0ee0a855
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
com
.
dlink
.
controller
;
import
com.dlink.common.result.Result
;
import
com.dlink.constant.DirConstant
;
import
com.dlink.service.SystemService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* SystemController
*
* @author wenmo
* @since 2022/10/15 19:20
*/
@RestController
@RequestMapping
(
"/api/system"
)
public
class
SystemController
{
@Autowired
private
SystemService
systemService
;
@GetMapping
(
"/listLogDir"
)
public
Result
listLogDir
()
{
return
Result
.
data
(
systemService
.
listLogDir
());
}
@GetMapping
(
"/getRootLog"
)
public
Result
getRootLog
()
{
return
Result
.
data
(
systemService
.
readFile
(
DirConstant
.
ROOT_LOG_PATH
));
}
@GetMapping
(
"/listDirByPath"
)
public
Result
listDirByPath
(
@RequestParam
String
path
)
{
return
Result
.
data
(
systemService
.
listDirByPath
(
path
));
}
@GetMapping
(
"/readFile"
)
public
Result
readFile
(
@RequestParam
String
path
)
{
return
Result
.
data
(
systemService
.
readFile
(
path
));
}
}
dlink-admin/src/main/java/com/dlink/interceptor/TenantInterceptor.java
View file @
0ee0a855
...
...
@@ -30,7 +30,6 @@ import com.mysql.cj.util.StringUtils;
import
lombok.extern.slf4j.Slf4j
;
/**
* tenant interceptor
*/
...
...
@@ -38,13 +37,13 @@ import lombok.extern.slf4j.Slf4j;
public
class
TenantInterceptor
implements
HandlerInterceptor
{
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
String
tenantId
=
request
.
getHeader
(
"tenantId"
);
log
.
info
(
"tenant interceptor preHandle execute ; current tenant id: 【"
+
tenantId
+
"】"
);
if
(!
StringUtils
.
isNullOrEmpty
(
tenantId
))
{
RequestContext
.
set
(
Integer
.
valueOf
(
tenantId
));
}
return
HandlerInterceptor
.
super
.
preHandle
(
request
,
response
,
handler
);
}
}
\ No newline at end of file
}
dlink-admin/src/main/java/com/dlink/model/FileNode.java
0 → 100644
View file @
0ee0a855
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
com
.
dlink
.
model
;
/**
* FileNode
*
* @author wenmo
* @since 2022/10/15 18:41
*/
public
class
FileNode
{
private
String
name
;
private
boolean
isDir
;
private
long
size
;
private
String
path
;
public
FileNode
(
String
name
,
boolean
isDir
,
long
size
,
String
path
)
{
this
.
name
=
name
;
this
.
isDir
=
isDir
;
this
.
size
=
size
;
this
.
path
=
path
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
boolean
isDir
()
{
return
isDir
;
}
public
void
setDir
(
boolean
dir
)
{
isDir
=
dir
;
}
public
long
getSize
()
{
return
size
;
}
public
void
setSize
(
long
size
)
{
this
.
size
=
size
;
}
public
String
getPath
()
{
return
path
;
}
public
void
setPath
(
String
path
)
{
this
.
path
=
path
;
}
}
dlink-admin/src/main/java/com/dlink/service/SystemService.java
0 → 100644
View file @
0ee0a855
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
com
.
dlink
.
service
;
import
com.dlink.model.FileNode
;
import
java.util.List
;
/**
* SystemService
*
* @author wenmo
* @since 2022/10/15 19:16
*/
public
interface
SystemService
{
/**
* list all dir and file by dir path
*
* @param path
* @return {@link List<FileNode>}
*/
List
<
FileNode
>
listDirByPath
(
String
path
);
/**
* List log root dir.
*
* @return {@link List<FileNode>}
*/
List
<
FileNode
>
listLogDir
();
/**
* readFile
*
* @param path
* @return {@link String}
*/
String
readFile
(
String
path
);
}
dlink-admin/src/main/java/com/dlink/service/impl/SystemServiceImpl.java
0 → 100644
View file @
0ee0a855
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
com
.
dlink
.
service
.
impl
;
import
com.dlink.constant.DirConstant
;
import
com.dlink.model.FileNode
;
import
com.dlink.service.SystemService
;
import
com.dlink.utils.DirUtil
;
import
java.util.List
;
import
org.springframework.stereotype.Service
;
/**
* SystemServiceImpl
*
* @author wenmo
* @since 2022/10/15 19:17
*/
@Service
public
class
SystemServiceImpl
implements
SystemService
{
@Override
public
List
<
FileNode
>
listDirByPath
(
String
path
)
{
return
DirUtil
.
listDirByPath
(
path
);
}
@Override
public
List
<
FileNode
>
listLogDir
()
{
return
DirUtil
.
listDirByPath
(
DirConstant
.
LOG_DIR_PATH
);
}
@Override
public
String
readFile
(
String
path
)
{
return
DirUtil
.
readFile
(
path
);
}
}
dlink-admin/src/main/java/com/dlink/utils/DirUtil.java
0 → 100644
View file @
0ee0a855
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
com
.
dlink
.
utils
;
import
com.dlink.assertion.Asserts
;
import
com.dlink.exception.BusException
;
import
com.dlink.model.FileNode
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.InputStreamReader
;
import
java.nio.charset.StandardCharsets
;
import
java.util.ArrayList
;
import
java.util.List
;
import
cn.hutool.core.util.StrUtil
;
/**
* DirUtil
*
* @author wenmo
* @since 2022/10/14 21:43
*/
public
class
DirUtil
{
public
static
List
<
FileNode
>
listDirByPath
(
String
path
)
{
List
<
FileNode
>
dirList
=
new
ArrayList
<>();
File
logDir
=
new
File
(
path
);
if
(
logDir
.
isFile
())
{
throw
new
BusException
(
StrUtil
.
format
(
"Directory path {} is a file."
,
path
));
}
File
[]
files
=
logDir
.
listFiles
();
if
(
Asserts
.
isNull
(
files
))
{
throw
new
BusException
(
StrUtil
.
format
(
"Directory path {} does not exist."
,
path
));
}
for
(
File
file
:
files
)
{
FileNode
fileNode
=
new
FileNode
(
file
.
getName
(),
file
.
isDirectory
(),
0
,
file
.
getAbsolutePath
());
if
(!
fileNode
.
isDir
())
{
fileNode
.
setSize
(
file
.
length
());
}
dirList
.
add
(
fileNode
);
}
return
dirList
;
}
public
static
String
readFile
(
String
path
)
{
StringBuilder
builder
=
new
StringBuilder
();
File
file
=
new
File
(
path
);
if
(!
file
.
isFile
())
{
throw
new
BusException
(
StrUtil
.
format
(
"File path {} is not a file."
,
path
));
}
try
(
InputStreamReader
inputStreamReader
=
new
InputStreamReader
(
new
FileInputStream
(
file
),
StandardCharsets
.
UTF_8
);
BufferedReader
bufferedReader
=
new
BufferedReader
(
inputStreamReader
))
{
String
content
=
""
;
while
((
content
=
bufferedReader
.
readLine
())
!=
null
)
{
builder
.
append
(
"\n"
);
builder
.
append
(
content
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
builder
.
toString
();
}
}
dlink-admin/src/main/resources/application.yml
View file @
0ee0a855
...
...
@@ -93,10 +93,10 @@ dinky:
dolphinscheduler
:
enabled
:
false
# dolphinscheduler 地址
url
:
http://127.0.0.1:
12345
/dolphinscheduler
url
:
http://127.0.0.1:
5173
/dolphinscheduler
# dolphinscheduler 生成的token
token
:
466cb6f6455b1b8689fff770746e2e79
token
:
ad54eb8f57fadea95f52763517978b26
# dolphinscheduler 中指定的项目名不区分大小写
project-name
:
d
inky
project-name
:
D
inky
# Dolphinscheduler DinkyTask Address
address
:
http://127.0.0.1:8888
dlink-admin/src/test/java/com/dlink/utils/DirUtilTest.java
0 → 100644
View file @
0ee0a855
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
com
.
dlink
.
utils
;
import
com.dlink.constant.DirConstant
;
import
com.dlink.model.FileNode
;
import
java.util.List
;
import
org.assertj.core.api.Assertions
;
import
org.junit.Test
;
/**
* DirUtilTest
*
* @author wenmo
* @since 2022/10/14 22:00
*/
public
class
DirUtilTest
{
@Test
public
void
testListDirByPath
()
{
List
<
FileNode
>
dirList
=
DirUtil
.
listDirByPath
(
DirConstant
.
LOG_DIR_PATH
);
Assertions
.
assertThat
(
dirList
).
isNotNull
();
}
@Test
public
void
testReadFile
()
{
String
result
=
DirUtil
.
readFile
(
DirConstant
.
LOG_DIR_PATH
+
"/dlink.log"
);
Assertions
.
assertThat
(
result
).
isNotNull
();
}
@Test
public
void
testReadRootLog
()
{
String
result
=
DirUtil
.
readFile
(
DirConstant
.
ROOT_LOG_PATH
);
Assertions
.
assertThat
(
result
).
isNotNull
();
}
}
dlink-web/config/routes.ts
View file @
0ee0a855
...
...
@@ -176,6 +176,12 @@ export default [
icon
:
'setting'
,
component
:
'./SettingCenter/FlinkSettings'
,
},
{
path
:
'/settingcenter/systeminfo'
,
name
:
'systemInfo'
,
icon
:
'desktop'
,
component
:
'./SettingCenter/SystemInfo'
,
},
],
},
{
...
...
dlink-web/package.json
View file @
0ee0a855
...
...
@@ -57,7 +57,7 @@
"@ant-design/charts"
:
"^1.3.4"
,
"@ant-design/icons"
:
"^4.5.0"
,
"@ant-design/plots"
:
"^1.0.7"
,
"@ant-design/pro-components"
:
"^1.1.2
3
"
,
"@ant-design/pro-components"
:
"^1.1.2
4
"
,
"@ant-design/pro-descriptions"
:
"^1.6.8"
,
"@ant-design/pro-form"
:
"^1.18.3"
,
"@ant-design/pro-layout"
:
"^6.18.0"
,
...
...
dlink-web/src/locales/en-US/menu.ts
View file @
0ee0a855
...
...
@@ -66,8 +66,6 @@ export default {
'menu.editor.mind'
:
'Mind Editor'
,
'menu.editor.koni'
:
'Koni Editor'
,
// ------------------------------------------------------------------------------
'menu.account.center'
:
'Account Center'
,
'menu.account.settings'
:
'Account Settings'
,
'menu.account.changePassword'
:
'Change Password'
,
...
...
@@ -103,6 +101,7 @@ export default {
'menu.settings'
:
'Setting Center'
,
'menu.settings.flinkConfig'
:
'Flink Settings'
,
'menu.settings.systemInfo'
:
'System Info'
,
'menu.about'
:
'About'
,
};
dlink-web/src/locales/zh-CN/menu.ts
View file @
0ee0a855
...
...
@@ -72,15 +72,12 @@ export default {
'menu.dev.ant-design.docs'
:
'官方文档'
,
'menu.dev.ant-design.preview'
:
'官方预览'
,
// ------------------------------------------------------------------------------
'menu.account.center'
:
'个人中心'
,
'menu.account.settings'
:
'个人设置'
,
'menu.account.changePassword'
:
'修改密码'
,
'menu.account.checkTenant'
:
'切换租户'
,
'menu.account.logout'
:
'退出登录'
,
'menu.datastudio'
:
'数据开发'
,
'menu.devops'
:
'运维中心'
,
...
...
@@ -101,16 +98,15 @@ export default {
'menu.registration.document'
:
'文档管理'
,
'menu.registration.fragment'
:
'全局变量管理'
,
'menu.authenticationcenter'
:
'认证中心'
,
'menu.authenticationcenter.usermanager'
:
'用户管理'
,
'menu.authenticationcenter.namespacemanager'
:
'命名空间管理'
,
'menu.authenticationcenter.rolemanager'
:
'角色管理'
,
'menu.authenticationcenter.tenantmanager'
:
'租户管理'
,
'menu.settings'
:
'配置中心'
,
'menu.settings.flinkConfig'
:
'Flink 配置'
,
'menu.settings.systemInfo'
:
'系统信息'
,
'menu.about'
:
'关于'
,
};
dlink-web/src/pages/SettingCenter/SystemInfo/data.d.ts
0 → 100644
View file @
0ee0a855
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
dlink-web/src/pages/SettingCenter/SystemInfo/index.tsx
0 → 100644
View file @
0ee0a855
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
PageContainer
}
from
"@ant-design/pro-layout"
;
import
{
Button
,
Empty
,
Tabs
}
from
"antd"
;
import
CodeShow
from
"@/components/Common/CodeShow"
;
import
{
getRootLog
}
from
"@/pages/SettingCenter/SystemInfo/service"
;
import
{
RedoOutlined
}
from
"@ant-design/icons"
;
const
{
TabPane
}
=
Tabs
;
const
SystemInfo
=
(
props
:
any
)
=>
{
const
[
log
,
setLog
]
=
useState
<
string
>
(
"Nothing."
);
useEffect
(()
=>
{
refreshRootLog
();
},
[]);
const
refreshRootLog
=
()
=>
{
const
res
=
getRootLog
();
res
.
then
((
result
)
=>
{
result
.
datas
&&
setLog
(
result
.
datas
);
});
}
return
(
<
PageContainer
title=
{
false
}
>
<
Tabs
defaultActiveKey=
"metrics"
size=
"small"
tabPosition=
"top"
style=
{
{
border
:
"1px solid #f0f0f0"
,
backgroundColor
:
'#fff'
,
}
}
tabBarExtraContent=
{
<
Button
icon=
{
<
RedoOutlined
/>
}
onClick=
{
refreshRootLog
}
></
Button
>
}
>
<
TabPane
tab=
{
<
span
>
Metrics
</
span
>
}
key=
"metrics"
>
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description=
'Coming soon'
/>
</
TabPane
>
<
TabPane
tab=
{
<
span
>
Configuration
</
span
>
}
key=
"configuration"
>
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description=
'Coming soon'
/>
</
TabPane
>
<
TabPane
tab=
{
<
span
>
Logs
</
span
>
}
key=
"logs"
>
<
CodeShow
code=
{
log
}
language=
'java'
height=
'500px'
/>
</
TabPane
>
<
TabPane
tab=
{
<
span
>
Log List
</
span
>
}
key=
"logList"
>
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description=
'Coming soon'
/>
</
TabPane
>
</
Tabs
>
</
PageContainer
>
);
};
export
default
SystemInfo
;
dlink-web/src/pages/SettingCenter/SystemInfo/service.ts
0 → 100644
View file @
0ee0a855
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import
{
getData
}
from
"@/components/Common/crud"
;
export
function
getRootLog
()
{
return
getData
(
"api/system/getRootLog"
);
}
pom.xml
View file @
0ee0a855
...
...
@@ -21,8 +21,8 @@
<groupId>
com.dlink
</groupId>
<artifactId>
dlink
</artifactId>
<packaging>
pom
</packaging>
<version>
0.6.8-SNAPSHOT
</version>
<packaging>
pom
</packaging>
<modules>
<module>
dlink-flink
</module>
...
...
@@ -535,8 +535,11 @@
</eclipse>
<removeUnusedImports
/>
<importOrder>
<
file>
style/eclipse.importorder
</file
>
<
order>
com.dlink,org.apache,java,javax,org,com,,\#
</order
>
</importOrder>
<licenseHeader>
<file>
style/license_header
</file>
</licenseHeader>
<replaceRegex>
<name>
Remove wildcard imports
</name>
<searchRegex>
import\s+[^\*\s]+\*;(\r\n|\r|\n)
</searchRegex>
...
...
style/eclipse.importorder
deleted
100644 → 0
View file @
e52e5d3b
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#Organize Import Order
0=com.dlink
1=org.apache
2=java
3=javax
4=org
5=com
\ No newline at end of file
style/license_header
0 → 100644
View file @
0ee0a855
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
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