Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
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
zhaochengxiang
szse
Commits
aff703a6
Commit
aff703a6
authored
May 28, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采集日志
parent
566a678b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
286 additions
and
6 deletions
+286
-6
datasource.js
src/model/datasource.js
+17
-0
datasourcemanager.js
src/service/datasourcemanager.js
+16
-0
AssetTree.jsx
src/view/Manage/AssetManage/Component/AssetTree.jsx
+2
-1
UpdateDirectoryModal.jsx
...iew/Manage/AssetManage/Component/UpdateDirectoryModal.jsx
+1
-1
TaskReportModal.jsx
...iew/Manage/DatasourceManage/Component/TaskReportModal.jsx
+209
-0
TaskReportModal.less
...ew/Manage/DatasourceManage/Component/TaskReportModal.less
+15
-0
index.jsx
src/view/Manage/DatasourceManage/index.jsx
+17
-0
index.jsx
src/view/Manage/Model/index.jsx
+9
-4
No files found.
src/model/datasource.js
View file @
aff703a6
...
...
@@ -59,3 +59,19 @@ export function* deleteTask(payload) {
export
function
*
startTask
(
payload
)
{
return
yield
call
(
service
.
startTask
,
payload
);
}
export
function
*
getTaskReportSummary
(
payload
)
{
return
yield
call
(
service
.
getTaskReportSummary
,
payload
);
}
export
function
*
getTaskReportDetail
(
payload
)
{
return
yield
call
(
service
.
getTaskReportDetail
,
payload
);
}
export
function
*
getTaskStates
(
payload
)
{
return
yield
call
(
service
.
getTaskStates
,
payload
);
}
export
function
*
getTaskTracerByStateId
(
payload
)
{
return
yield
call
(
service
.
getTaskTracerByStateId
,
payload
);
}
\ No newline at end of file
src/service/datasourcemanager.js
View file @
aff703a6
...
...
@@ -56,3 +56,19 @@ export function startTask(payload) {
return
PostJSON
(
"/metadataharvester/task/startHarvestingTask"
,
payload
);
}
export
function
getTaskReportSummary
(
payload
)
{
return
GetJSON
(
"/metadataharvester/task/getTaskReportSummary"
,
payload
);
}
export
function
getTaskReportDetail
(
payload
)
{
return
GetJSON
(
"/metadataharvester/task/getTaskReportDetail"
,
payload
);
}
export
function
getTaskStates
(
payload
)
{
return
GetJSON
(
"/metadataharvester/task/getTaskStates"
,
payload
);
}
export
function
getTaskTracerByStateId
(
payload
)
{
return
GetJSON
(
"/metadataharvester/task/getTaskTracerByStateId"
,
payload
);
}
src/view/Manage/AssetManage/Component/AssetTree.jsx
View file @
aff703a6
...
...
@@ -112,7 +112,8 @@ const AssetTree = (props) => {
}
const
editDir
=
()
=>
{
if
(
currentDirType
===
''
)
{
if
((
currentDirType
||
''
)
===
''
)
{
setUpdateDirectoryAction
(
'edit'
);
setUpdateDirectoryModalVisible
(
true
);
...
...
src/view/Manage/AssetManage/Component/UpdateDirectoryModal.jsx
View file @
aff703a6
...
...
@@ -15,8 +15,8 @@ const UpdateDirectoryModal = (props) => {
useEffect
(()
=>
{
if
(
visible
)
{
onReset
();
setDir
(
null
);
form
.
resetFields
();
if
((
dirId
||
''
)
!==
''
)
{
getDirectory
();
}
...
...
src/view/Manage/DatasourceManage/Component/TaskReportModal.jsx
0 → 100644
View file @
aff703a6
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Modal
,
Row
,
Col
,
Card
,
Table
,
Typography
,
Spin
,
Empty
,
Button
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
{
dispatch
,
dispatchLatest
}
from
'../../../../model'
;
import
'./TaskReportModal.less'
;
const
{
Meta
}
=
Card
;
const
TaskReportModal
=
(
props
)
=>
{
const
{
visible
,
onCancel
,
scope
}
=
props
;
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
summaryDatas
,
setSummaryDatas
]
=
useState
([]);
const
[
currentSummaryData
,
setCurrentSummaryData
]
=
useState
({});
const
[
reportDetail
,
setReportDetail
]
=
useState
({});
const
[
taskTracersBindStateId
,
setTaskTracersBindStateId
]
=
useState
([]);
useEffect
(()
=>
{
if
(
visible
)
{
getTaskReportSummary
();
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
visible
])
const
getTaskReportSummary
=
()
=>
{
dispatch
({
type
:
'datasource.getTaskReportSummary'
,
payload
:
{
namespace
:
((
scope
||
[]).
length
>
0
?
scope
[
0
]:
''
)
},
callback
:
data
=>
{
function
compare
(
val1
,
val2
)
{
var
a
=
val1
.
seq
;
var
b
=
val2
.
seq
;
return
(
a
-
b
);
}
(
data
||
[]).
sort
(
compare
);
setSummaryDatas
(
data
||
[]);
const
_currentSummaryData
=
(
data
||
[]).
length
>
0
?
data
[
0
]:{};
setCurrentSummaryData
(
_currentSummaryData
);
getTaskReportDetail
(
_currentSummaryData
.
params
);
}
})
}
const
getTaskReportDetail
=
(
params
)
=>
{
dispatchLatest
({
type
:
'datasource.getTaskReportDetail'
,
payload
:
{
namespace
:
((
scope
||
[]).
length
>
0
?
scope
[
0
]:
''
),
params
,
},
callback
:
data
=>
{
function
compare
(
val1
,
val2
)
{
var
a
=
val1
.
seq
;
var
b
=
val2
.
seq
;
return
(
a
-
b
);
}
data
&&
(
data
.
title
||
[]).
sort
(
compare
);
data
&&
(
data
.
title
||
[]).
forEach
(
item
=>
{
item
.
title
=
item
.
value
||
''
;
item
.
dataIndex
=
item
.
name
||
''
;
item
.
ellipsis
=
true
;
})
setReportDetail
(
data
||
{});
}
})
}
const
getTaskTracer
=
(
record
)
=>
{
dispatch
({
type
:
'datasource.getTaskTracerByStateId'
,
payload
:
{
taskStateId
:
record
.
taskStateId
},
callback
:
data
=>
{
setTaskTracersBindStateId
([...
taskTracersBindStateId
,
{
key
:
record
.
taskStateId
,
value
:
data
||
[]
}]);
}
});
}
const
onSummaryDataChange
=
(
item
)
=>
{
if
(
item
.
hasDetail
)
{
setCurrentSummaryData
(
item
);
setTaskTracersBindStateId
([]);
getTaskReportDetail
(
item
.
params
);
}
}
const
reset
=
()
=>
{
setSummaryDatas
([]);
setCurrentSummaryData
({});
setReportDetail
({});
setTaskTracersBindStateId
([]);
}
return
(
<
Modal
className=
'task-report-modal'
forceRender
title=
{
'日志报告'
}
visible=
{
visible
}
width=
{
1000
}
confirmLoading=
{
confirmLoading
}
onCancel=
{
()
=>
{
reset
();
onCancel
&&
onCancel
()
}
}
footer
=
{
<
Button
key=
"1"
type=
"primary"
onClick=
{
()
=>
{
reset
();
onCancel
&&
onCancel
()
}
}
>
取消
</
Button
>
}
>
<
Row
gutter=
{
20
}
>
{
summaryDatas
&&
summaryDatas
.
map
((
item
,
index
)
=>
{
const
classes
=
classNames
(
(
item
===
currentSummaryData
)?
'title-highlight'
:
'title'
,
{
'pointer'
:
item
.
hasDetail
});
return
(
<
Col
key=
{
index
}
span=
{
6
}
>
<
Card
>
<
Meta
title=
{
<
div
className=
{
classes
}
onClick=
{
()
=>
{
onSummaryDataChange
(
item
);
}
}
>
{
item
.
cnName
||
''
}
</
div
>
}
description=
{
item
.
value
||
''
}
/>
</
Card
>
</
Col
>
);
})
}
</
Row
>
<
Table
className=
'mt-5'
columns=
{
reportDetail
.
title
||
[]
}
rowKey=
{
'taskStateId'
}
dataSource=
{
reportDetail
.
datas
||
[]
}
pagination=
{
false
}
sticky
expandable=
{
{
expandedRowRender
:
record
=>
{
let
_tracer
=
null
;
(
taskTracersBindStateId
||
[]).
forEach
(
item
=>
{
if
(
item
.
key
===
record
.
taskStateId
)
{
_tracer
=
item
.
value
||
[];
}
})
return
(
<
Spin
spinning=
{
_tracer
===
null
}
>
{
(
_tracer
||
[]).
length
===
0
&&
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description=
"暂无日志"
/>
}
{
_tracer
&&
_tracer
.
map
((
_item
,
index
)
=>
{
return
(
<
Typography
.
Paragraph
key=
{
index
}
>
{
_item
.
value
||
''
}
</
Typography
.
Paragraph
>
)
})
}
</
Spin
>
);
},
onExpand
:
(
expanded
,
record
)
=>
{
let
exsit
=
false
;
(
taskTracersBindStateId
||
[]).
forEach
(
item
=>
{
if
(
item
.
key
===
record
.
taskStateId
)
{
exsit
=
true
;
}
})
if
(
expanded
&&
!
exsit
)
{
getTaskTracer
(
record
);
}
}
}
}
/>
<
/
Modal
>
);
}
export default TaskReportModal;
\ No newline at end of file
src/view/Manage/DatasourceManage/Component/TaskReportModal.less
0 → 100644
View file @
aff703a6
.task-report-modal {
.yy-table {
max-height: 500px !important;
overflow: auto !important;
}
.title-highlight {
color: #f5222d;
}
.title {
color: #249aec;
}
}
\ No newline at end of file
src/view/Manage/DatasourceManage/index.jsx
View file @
aff703a6
...
...
@@ -3,6 +3,7 @@ import { Space, Select, Button, Modal, Cascader } from 'antd';
import
DatasourceList
from
'./Component/DatasourceList'
;
import
UpdateDatasourceModal
from
'./Component/UpdateDatasourceModal'
;
import
TaskReportModal
from
'./Component/TaskReportModal'
;
import
UpdateTaskModal
from
'./Component/UpdateTaskModal'
;
import
{
dispatch
}
from
'../../../model'
;
import
{
showMessage
}
from
'../../../util'
;
...
...
@@ -26,6 +27,7 @@ const DatasourceManage = () => {
const
[
updateDatasourceModalAction
,
setUpdateDatasourceModalAction
]
=
useState
(
''
);
const
[
updateTaskModalVisible
,
setUpdateTaskModalVisible
]
=
useState
(
false
);
const
[
updateTaskModalAction
,
setUpdateTaskModalAction
]
=
useState
(
''
);
const
[
taskReportModalVisible
,
setTaskReportModalVisible
]
=
useState
(
false
);
const
[
currentDatasourceId
,
setCurrentDatasourceId
]
=
useState
(
''
);
const
[
currentDatasourceIdBindTasksNeedRefresh
,
setCurrentDatasourceIdBindTasksNeedRefresh
]
=
useState
(
''
);
const
[
currentTaskId
,
setCurrentTaskId
]
=
useState
(
''
);
...
...
@@ -134,6 +136,14 @@ const DatasourceManage = () => {
setFilterDatasources
((
datasources
||
[]).
filter
(
item
=>
value
===
'all'
||
item
.
type
===
value
));
}
const
showTaskReport
=
()
=>
{
setTaskReportModalVisible
(
true
);
}
const
onTaskReportModalCancel
=
()
=>
{
setTaskReportModalVisible
(
false
);
}
const
addDatasource
=
()
=>
{
setUpdateDatasourceModalAction
(
'add'
);
setUpdateDatasourceModalVisible
(
true
);
...
...
@@ -266,6 +276,7 @@ const DatasourceManage = () => {
</
Select
>
</
Space
>
<
Space
>
<
Button
type=
'primary'
onClick=
{
showTaskReport
}
>
日志报告
</
Button
>
<
Button
type=
'primary'
onClick=
{
addDatasource
}
>
新增数据源
</
Button
>
</
Space
>
</
div
>
...
...
@@ -286,6 +297,12 @@ const DatasourceManage = () => {
/>
</
div
>
<
TaskReportModal
visible=
{
taskReportModalVisible
}
scope=
{
selectedScope
}
onCancel=
{
onTaskReportModalCancel
}
/>
<
UpdateDatasourceModal
visible=
{
updateDatasourceModalVisible
}
id=
{
currentDatasourceId
}
...
...
src/view/Manage/Model/index.jsx
View file @
aff703a6
...
...
@@ -125,10 +125,15 @@ class Model extends React.Component {
//模型名称在导出ddl的时候有使用
const
_selectModelerNames
=
[];
(
tableData
||
[]).
forEach
(
item
=>
{
if
((
selectModelerIds
||
[]).
indexOf
(
item
.
id
)
!==
-
1
)
{
_selectModelerNames
.
push
(
item
.
name
||
''
);
}
(
selectModelerIds
||
[]).
forEach
(
id
=>
{
(
tableData
||
[]).
forEach
(
item
=>
{
if
(
item
.
id
===
id
)
{
_selectModelerNames
.
push
(
item
.
name
||
''
);
}
});
});
this
.
setState
({
exportDDLModalVisible
:
true
,
selectModelerNames
:
_selectModelerNames
});
...
...
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