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
bec4a91d
Commit
bec4a91d
authored
Jun 14, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采集
parent
25c0900a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
27 deletions
+30
-27
ScheduleAction.jsx
...view/Manage/DatasourceManage/Component/ScheduleAction.jsx
+10
-7
Task.jsx
src/view/Manage/MetadataHarvester/Component/Task.jsx
+12
-16
TaskReport.jsx
src/view/Manage/MetadataHarvester/Component/TaskReport.jsx
+6
-3
UpdateTask.jsx
src/view/Manage/MetadataHarvester/Component/UpdateTask.jsx
+0
-0
index.less
src/view/Manage/MetadataHarvester/index.less
+2
-1
No files found.
src/view/Manage/DatasourceManage/Component/ScheduleAction.jsx
View file @
bec4a91d
...
@@ -4,6 +4,12 @@ import moment from 'moment';
...
@@ -4,6 +4,12 @@ import moment from 'moment';
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
function
compare
(
val1
,
val2
)
{
var
a
=
val1
.
seq
;
var
b
=
val2
.
seq
;
return
(
a
-
b
);
}
const
ScheduleAction
=
(
props
)
=>
{
const
ScheduleAction
=
(
props
)
=>
{
const
{
action
,
id
,
form
,
tid
,
onChange
}
=
props
;
const
{
action
,
id
,
form
,
tid
,
onChange
}
=
props
;
...
@@ -11,7 +17,7 @@ const ScheduleAction = (props) => {
...
@@ -11,7 +17,7 @@ const ScheduleAction = (props) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
reset
();
reset
();
if
(
action
===
'add'
&&
tid
)
{
if
(
action
===
'add'
)
{
getScheduleForm
();
getScheduleForm
();
}
else
if
(
action
===
'edit'
&&
id
)
{
}
else
if
(
action
===
'edit'
&&
id
)
{
getScheduleById
();
getScheduleById
();
...
@@ -26,6 +32,9 @@ const ScheduleAction = (props) => {
...
@@ -26,6 +32,9 @@ const ScheduleAction = (props) => {
targetConfId
:
tid
targetConfId
:
tid
},
},
callback
:
data
=>
{
callback
:
data
=>
{
(
data
?.
targetParameters
||
[]).
sort
(
compare
);
(
data
?.
scheduleParameters
||
[]).
sort
(
compare
);
setSchedule
(
data
||
{});
setSchedule
(
data
||
{});
onChange
&&
onChange
(
data
||
{});
onChange
&&
onChange
(
data
||
{});
}
}
...
@@ -39,12 +48,6 @@ const ScheduleAction = (props) => {
...
@@ -39,12 +48,6 @@ const ScheduleAction = (props) => {
id
id
},
},
callback
:
data
=>
{
callback
:
data
=>
{
function
compare
(
val1
,
val2
)
{
var
a
=
val1
.
seq
;
var
b
=
val2
.
seq
;
return
(
a
-
b
);
}
(
data
?.
targetParameters
||
[]).
sort
(
compare
);
(
data
?.
targetParameters
||
[]).
sort
(
compare
);
(
data
?.
scheduleParameters
||
[]).
sort
(
compare
);
(
data
?.
scheduleParameters
||
[]).
sort
(
compare
);
...
...
src/view/Manage/MetadataHarvester/Component/Task.jsx
View file @
bec4a91d
...
@@ -170,7 +170,7 @@ const FC = (props) => {
...
@@ -170,7 +170,7 @@ const FC = (props) => {
return
()
=>
{
return
()
=>
{
clearInterval
(
interval
);
clearInterval
(
interval
);
}
}
},
[])
},
[
env
])
const
_columns
=
useMemo
(()
=>
{
const
_columns
=
useMemo
(()
=>
{
if
(
visibleCols
)
{
if
(
visibleCols
)
{
...
@@ -191,6 +191,7 @@ const FC = (props) => {
...
@@ -191,6 +191,7 @@ const FC = (props) => {
&&
(
configState
.
datasourceId
===
undefined
||
item
.
target
?.
id
===
configState
.
datasourceId
)
&&
(
configState
.
datasourceId
===
undefined
||
item
.
target
?.
id
===
configState
.
datasourceId
)
&&
(
configState
.
targetType
===
undefined
||
item
.
target
?.
type
===
configState
.
targetType
)
&&
(
configState
.
targetType
===
undefined
||
item
.
target
?.
type
===
configState
.
targetType
)
&&
(
!
keyword
||
(
item
.
taskCode
||
''
).
indexOf
(
keyword
)
!==-
1
||
(
item
.
schema
||
''
).
indexOf
(
keyword
)
!==-
1
)
&&
(
!
keyword
||
(
item
.
taskCode
||
''
).
indexOf
(
keyword
)
!==-
1
||
(
item
.
schema
||
''
).
indexOf
(
keyword
)
!==-
1
)
&&
item
.
target
?.
namespace
===
env
?.
domainId
?.
toString
()
});
});
newTasks
?.
forEach
(
item
=>
{
newTasks
?.
forEach
(
item
=>
{
const
index
=
(
supportedTargetTypes
||
[]).
findIndex
(
_item
=>
_item
.
targetType
===
item
.
type
);
const
index
=
(
supportedTargetTypes
||
[]).
findIndex
(
_item
=>
_item
.
targetType
===
item
.
type
);
...
@@ -216,7 +217,7 @@ const FC = (props) => {
...
@@ -216,7 +217,7 @@ const FC = (props) => {
}
}
return
[]
return
[]
},
[
tasks
,
pagination
,
configState
,
supportedTargetTypes
,
sortedInfo
,
keyword
])
},
[
tasks
,
pagination
,
configState
,
supportedTargetTypes
,
sortedInfo
,
keyword
,
env
])
const
total
=
useMemo
(()
=>
{
const
total
=
useMemo
(()
=>
{
if
(
tasks
)
{
if
(
tasks
)
{
...
@@ -225,13 +226,14 @@ const FC = (props) => {
...
@@ -225,13 +226,14 @@ const FC = (props) => {
&&
(
configState
.
datasourceId
===
undefined
||
item
.
target
?.
id
===
configState
.
datasourceId
)
&&
(
configState
.
datasourceId
===
undefined
||
item
.
target
?.
id
===
configState
.
datasourceId
)
&&
(
configState
.
targetType
===
undefined
||
item
.
target
?.
type
===
configState
.
targetType
)
&&
(
configState
.
targetType
===
undefined
||
item
.
target
?.
type
===
configState
.
targetType
)
&&
(
!
keyword
||
item
.
taskCode
?.
indexOf
(
keyword
)
!==-
1
||
item
.
schema
?.
indexOf
(
keyword
)
!==-
1
)
&&
(
!
keyword
||
item
.
taskCode
?.
indexOf
(
keyword
)
!==-
1
||
item
.
schema
?.
indexOf
(
keyword
)
!==-
1
)
&&
item
.
target
?.
namespace
===
env
?.
domainId
?.
toString
()
});
});
return
(
newTasks
||
[]).
length
;
return
(
newTasks
||
[]).
length
;
}
}
return
0
;
return
0
;
},
[
tasks
,
pagination
,
configState
,
keyword
])
},
[
tasks
,
pagination
,
configState
,
keyword
,
env
])
const
getAllTasks
=
()
=>
{
const
getAllTasks
=
()
=>
{
setLoadingTasks
(
true
);
setLoadingTasks
(
true
);
...
@@ -299,12 +301,9 @@ const FC = (props) => {
...
@@ -299,12 +301,9 @@ const FC = (props) => {
setPagination
({
pageNum
:
page
,
pageSize
:
size
});
setPagination
({
pageNum
:
page
,
pageSize
:
size
});
}
}
const
onUpdateTaskCancel
=
()
=>
{
const
onUpdateTaskCancel
=
(
refresh
=
false
)
=>
{
setUpdateTaskParam
({
visible
:
false
,
action
:
undefined
,
id
:
undefined
});
setUpdateTaskParam
({
visible
:
false
,
action
:
undefined
,
id
:
undefined
});
}
refresh
&&
getAllTasks
();
const
onUpdateTaskChange
=
()
=>
{
getAllTasks
();
}
}
const
onColConfigCancel
=
(
refresh
=
false
)
=>
{
const
onColConfigCancel
=
(
refresh
=
false
)
=>
{
...
@@ -444,7 +443,7 @@ const FC = (props) => {
...
@@ -444,7 +443,7 @@ const FC = (props) => {
dataSource=
{
_tasks
||
[]
}
dataSource=
{
_tasks
||
[]
}
pagination=
{
false
}
pagination=
{
false
}
onChange=
{
onTableChange
}
onChange=
{
onTableChange
}
scroll=
{
{
y
:
'calc(100vh - 3
30
px)'
}
}
scroll=
{
{
y
:
'calc(100vh - 3
15
px)'
}
}
sticky
sticky
/>
/>
<
Pagination
<
Pagination
...
@@ -466,7 +465,6 @@ const FC = (props) => {
...
@@ -466,7 +465,6 @@ const FC = (props) => {
action=
{
updateTaskParam
.
action
}
action=
{
updateTaskParam
.
action
}
id=
{
updateTaskParam
.
id
}
id=
{
updateTaskParam
.
id
}
onCancel=
{
onUpdateTaskCancel
}
onCancel=
{
onUpdateTaskCancel
}
onChange=
{
onUpdateTaskChange
}
/>
/>
<
ColConfig
<
ColConfig
...
@@ -481,8 +479,6 @@ const FC = (props) => {
...
@@ -481,8 +479,6 @@ const FC = (props) => {
export
default
FC
;
export
default
FC
;
export
const
reducer
=
(
prevState
,
action
)
=>
{
export
const
reducer
=
(
prevState
,
action
)
=>
{
const
scope
=
undefined
,
targetType
=
undefined
,
datasourceId
=
undefined
;
if
(
action
.
type
===
'selectScope'
)
{
if
(
action
.
type
===
'selectScope'
)
{
const
[
scope
]
=
action
.
payload
const
[
scope
]
=
action
.
payload
return
{
...
prevState
,
scope
}
return
{
...
prevState
,
scope
}
...
@@ -493,7 +489,7 @@ export const reducer = (prevState, action) => {
...
@@ -493,7 +489,7 @@ export const reducer = (prevState, action) => {
const
[
datasourceId
]
=
action
.
payload
const
[
datasourceId
]
=
action
.
payload
return
{
...
prevState
,
datasourceId
}
return
{
...
prevState
,
datasourceId
}
}
else
if
(
action
.
type
===
'init'
)
{
}
else
if
(
action
.
type
===
'init'
)
{
return
{
...
prevState
,
scope
,
targetType
,
datasourceI
d
}
return
{
...
prevState
,
scope
:
undefined
,
targetType
:
undefined
,
datasourceId
:
undefine
d
}
}
}
return
prevState
return
prevState
...
@@ -531,10 +527,10 @@ export function Config({ onState, autoSelect, setTargetTypes }) {
...
@@ -531,10 +527,10 @@ export function Config({ onState, autoSelect, setTargetTypes }) {
setTreeData
(
env
.
children
);
setTreeData
(
env
.
children
);
setTreeExpandKeys
(
newExpandKeys
);
setTreeExpandKeys
(
newExpandKeys
);
dispatchState
(
'init'
);
dispatchState
(
{
type
:
'init'
}
);
}
else
{
}
else
{
setTreeData
([]);
setTreeData
([]);
dispatchState
(
'init'
);
dispatchState
(
{
type
:
'init'
}
);
}
}
},
[
env
])
},
[
env
])
...
@@ -544,7 +540,7 @@ export function Config({ onState, autoSelect, setTargetTypes }) {
...
@@ -544,7 +540,7 @@ export function Config({ onState, autoSelect, setTargetTypes }) {
useEffect
(()
=>
{
useEffect
(()
=>
{
getDatasources
();
getDatasources
();
},
[
scope
])
},
[
scope
,
env
])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
autoSelect
&&
(
datasources
||
[]).
length
>
0
)
{
if
(
autoSelect
&&
(
datasources
||
[]).
length
>
0
)
{
...
...
src/view/Manage/MetadataHarvester/Component/TaskReport.jsx
View file @
bec4a91d
...
@@ -79,10 +79,13 @@ const FC = (props) => {
...
@@ -79,10 +79,13 @@ const FC = (props) => {
},
[
reportData
])
},
[
reportData
])
const
taskCodes
=
useMemo
(()
=>
{
const
taskCodes
=
useMemo
(()
=>
{
return
tasks
?.
filter
(
item
=>
item
.
taskCode
).
map
(
item
=>
item
.
taskCode
)
return
tasks
?.
filter
(
item
=>
item
.
ta
rget
?.
namespace
===
env
?.
domainId
?.
toString
()
&&
item
.
ta
skCode
).
map
(
item
=>
item
.
taskCode
)
},
[
tasks
])
},
[
tasks
,
env
])
useEffect
(()
=>
{
useEffect
(()
=>
{
setTaskCode
(
undefined
);
setDatasourceName
(
undefined
);
setReportState
(
undefined
);
getAllTasks
();
getAllTasks
();
getDatasources
();
getDatasources
();
},
[
env
])
},
[
env
])
...
@@ -377,7 +380,7 @@ const FC = (props) => {
...
@@ -377,7 +380,7 @@ const FC = (props) => {
},
},
}
}
}
}
pagination=
{
false
}
pagination=
{
false
}
scroll=
{
{
y
:
'calc(100vh - 4
15
px)'
}
}
scroll=
{
{
y
:
'calc(100vh - 4
00
px)'
}
}
sticky
sticky
/>
/>
<
Pagination
<
Pagination
...
...
src/view/Manage/MetadataHarvester/Component/UpdateTask.jsx
View file @
bec4a91d
This diff is collapsed.
Click to expand it.
src/view/Manage/MetadataHarvester/index.less
View file @
bec4a91d
.metadata-harvester {
.metadata-harvester {
height: calc(100vh - 124px);
height: calc(100vh - 124px);
padding: 20px;
padding:
5px 20px
20px;
background: #fff;
background: #fff;
overflow: hidden;
overflow: hidden;
}
}
\ No newline at end of file
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