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
3c598fe3
Commit
3c598fe3
authored
Oct 12, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源目录同步schema
parent
9fb407f4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
111 additions
and
1 deletion
+111
-1
assetmanage.js
src/model/assetmanage.js
+26
-0
dataassetmanager.js
src/service/dataassetmanager.js
+9
-0
metadata.js
src/service/metadata.js
+18
-1
index.js
src/util/index.js
+9
-0
update-node-help.jsx
src/view/Manage/AssetResourceManage/update-node-help.jsx
+49
-0
update-node.jsx
src/view/Manage/AssetResourceManage/update-node.jsx
+0
-0
No files found.
src/model/assetmanage.js
View file @
3c598fe3
import
*
as
service
from
'../service/dataassetmanager'
;
import
*
as
metadataService
from
'../service/metadata'
;
import
{
call
}
from
'redux-saga/effects'
;
export
function
*
importElement
(
payload
)
{
...
...
@@ -239,4 +240,28 @@ export function* getPreviewRangeByDirId(payload) {
export
function
*
resourceAddOrUpdateDirectory
(
payload
)
{
return
yield
call
(
service
.
resourceAddOrUpdateDirectory
,
payload
)
}
export
function
*
getSystems
()
{
return
yield
call
(
metadataService
.
getSystems
)
}
export
function
*
getDatasources
(
payload
)
{
return
yield
call
(
metadataService
.
getDatasources
,
payload
)
}
export
function
*
getDatabases
(
payload
)
{
return
yield
call
(
metadataService
.
getDatabases
,
payload
)
}
export
function
*
getSchemas
(
payload
)
{
return
yield
call
(
metadataService
.
getSchemas
,
payload
)
}
export
function
*
resourceTestSyncStrategy
(
payload
)
{
return
yield
call
(
service
.
resourceTestSyncStrategy
,
payload
)
}
export
function
*
getDirectoryWithSyncStrategy
(
payload
)
{
return
yield
call
(
service
.
getDirectoryWithSyncStrategy
,
payload
)
}
\ No newline at end of file
src/service/dataassetmanager.js
View file @
3c598fe3
...
...
@@ -246,4 +246,12 @@ export function getPreviewRangeByDirId(payload) {
export
function
resourceAddOrUpdateDirectory
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/resourceApi/addOrUpdateDirectory"
,
payload
);
}
export
function
resourceTestSyncStrategy
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/resourceApi/testSyncStrategy"
,
payload
)
}
export
function
getDirectoryWithSyncStrategy
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/resourceApi/getDirectoryWithSyncStrategy"
,
payload
)
}
\ No newline at end of file
src/service/metadata.js
View file @
3c598fe3
import
{
GetJSON
}
from
"../util/axios"
import
{
GetJSON
,
PostJSON
}
from
"../util/axios"
export
function
queryDatabase
(
payload
)
{
return
GetJSON
(
"/metadatarepo/rest/tag/getDatabaseBySystemCode"
,
payload
);
...
...
@@ -18,4 +18,20 @@ export function queryAllFields(payload) {
export
function
getSystemAllGraph
(
payload
)
{
return
GetJSON
(
"/metadatarelation/getSystemAllGraph"
,
payload
);
}
export
function
getSystems
()
{
return
PostJSON
(
'/metadatarepo/rest/system/listAllSystem'
)
}
export
function
getDatasources
(
payload
)
{
return
GetJSON
(
'/metadatarepo/rest/user/getUserSystem'
,
payload
)
}
export
function
getDatabases
(
payload
)
{
return
PostJSON
(
'/metadatarepo/rest/metadata/getChildBySysAndPath'
,
payload
)
}
export
function
getSchemas
(
payload
)
{
return
GetJSON
(
'/metadatarepo/rest/query/getChildBySys'
,
payload
)
}
\ No newline at end of file
src/util/index.js
View file @
3c598fe3
...
...
@@ -494,4 +494,12 @@ export function getScrollbarWidth() {
return
scrollbarWidth
;
}
export
function
getValidString
(
strs
)
{
for
(
const
str
of
strs
)
{
if
(
typeof
str
===
'string'
&&
str
.
length
>
0
)
{
return
str
}
}
}
\ No newline at end of file
src/view/Manage/AssetResourceManage/update-node-help.jsx
0 → 100644
View file @
3c598fe3
import
produce
from
"immer"
export
function
formatTreeData
(
datasources
,
catalogMap
)
{
const
treeData
=
produce
(
datasources
,
(
draft
)
=>
{
draft
?.
forEach
((
datasource
)
=>
{
datasource
.
title
=
datasource
.
catalogName
datasource
.
value
=
`catalog-
${
datasource
.
catalogId
}
`
datasource
.
id
=
datasource
.
catalogId
datasource
.
disabled
=
true
datasource
.
children
=
produce
(
datasource
.
scopes
,
(
draftScopes
)
=>
{
draftScopes
?.
forEach
((
scope
)
=>
{
scope
.
title
=
scope
.
scopeName
scope
.
value
=
scope
.
scopeId
scope
.
id
=
scope
.
scopeId
scope
.
catalogId
=
datasource
.
value
})
})
})
})
const
getMap
=
(
children
)
=>
{
return
children
?.
forEach
((
child
)
=>
{
getMap
(
child
.
children
)
catalogMap
[
child
.
value
]
=
child
})
}
getMap
(
treeData
)
return
treeData
}
export
const
envReducer
=
(
prevState
,
action
)
=>
{
if
(
action
.
type
===
'selectEnv'
)
{
const
env
=
action
.
payload
return
{
...
prevState
,
env
,
domain
:
undefined
,
datasource
:
undefined
,
database
:
undefined
,
schema
:
undefined
}
}
if
(
action
.
type
===
'selectDatasource'
)
{
const
{
domain
,
datasource
}
=
action
.
payload
return
{
...
prevState
,
domain
,
datasource
,
database
:
undefined
,
schema
:
undefined
}
}
else
if
(
action
.
type
===
'selectDatabase'
)
{
const
database
=
action
.
payload
return
{
...
prevState
,
database
,
schema
:
undefined
}
}
else
if
(
action
.
type
===
'selectSchema'
)
{
const
schema
=
action
.
payload
return
{
...
prevState
,
schema
}
}
return
prevState
}
\ No newline at end of file
src/view/Manage/AssetResourceManage/update-node.jsx
View file @
3c598fe3
This diff is collapsed.
Click to expand it.
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