Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qahome-diamond
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QA
qahome-diamond
Commits
650e0fc6
Commit
650e0fc6
authored
Apr 22, 2019
by
xuezj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实现db同步
parent
968bba5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
dbconfig.js
src/api/dbconfig.js
+16
-0
sync.vue
src/views/dbconfig/sync.vue
+4
-5
No files found.
src/api/dbconfig.js
View file @
650e0fc6
...
...
@@ -24,6 +24,14 @@ export function deleteConfig(query) {
})
}
export
function
getNamespaceTke
(
query
)
{
return
request
({
url
:
'
/k8s/namespace
'
,
method
:
'
get
'
,
params
:
query
})
}
export
function
getNamespace
(
query
)
{
return
request
({
url
:
'
/dbsync/get_name_space
'
,
...
...
@@ -40,6 +48,14 @@ export function getDBName(query) {
})
}
export
function
dbSyncTke
(
data
)
{
return
request
({
url
:
'
/dbsync/tke
'
,
method
:
'
post
'
,
data
})
}
export
function
dbSync
(
data
)
{
return
request
({
url
:
'
/dbsync/db_sync
'
,
...
...
src/views/dbconfig/sync.vue
View file @
650e0fc6
...
...
@@ -36,7 +36,7 @@
</
template
>
<
script
>
import
{
getNamespace
,
getDBName
,
dbSync
,
dbSyncQuery
}
from
'
@/api/dbconfig
'
import
{
getNamespace
Tke
,
getDBName
,
dbSyncTke
,
dbSyncQuery
}
from
'
@/api/dbconfig
'
import
Pagination
from
'
@/components/Pagination
'
// Secondary package based on el-pagination
import
JsonEditor
from
'
@/components/JsonEditor
'
...
...
@@ -83,8 +83,8 @@ export default {
},
methods
:
{
getNamespace
()
{
getNamespace
().
then
(
res
=>
{
this
.
namespaces
=
res
.
data
.
map
(
item
=>
item
.
name
)
getNamespace
Tke
().
then
(
res
=>
{
this
.
namespaces
=
res
.
data
&&
res
.
data
.
namespaces
.
map
(
item
=>
item
.
name
)
})
},
...
...
@@ -136,10 +136,9 @@ export default {
},
sync
()
{
console
.
log
(
1
,
this
)
this
.
$refs
[
'
dataForm
'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
dbSync
(
this
.
temp
).
then
((
res
)
=>
{
dbSync
Tke
(
this
.
temp
).
then
((
res
)
=>
{
this
.
dialogFormVisible
=
false
this
.
location
=
res
.
data
.
location
this
.
$notify
({
...
...
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