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
9ead530c
Commit
9ead530c
authored
Apr 28, 2019
by
xuezj
Browse files
Options
Browse Files
Download
Plain Diff
增加获取base和应用的仓库信息接口
parents
79912660
5bb6b680
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
133 additions
and
7 deletions
+133
-7
docker.js
src/api/docker.js
+1
-1
docker.js
src/router/modules/docker.js
+1
-1
user.js
src/store/modules/user.js
+2
-1
createEnv.vue
src/views/docker/createEnv.vue
+3
-2
deployEnv.vue
src/views/docker/deployEnv.vue
+122
-0
envDetail.vue
src/views/docker/envDetail.vue
+1
-1
envTemplate.vue
src/views/docker/envTemplate.vue
+3
-1
No files found.
src/api/docker.js
View file @
9ead530c
...
...
@@ -128,7 +128,7 @@ export function fetchServiceInstance(data) {
export
function
flushRedis
(
query
)
{
return
request
({
url
:
'
/docker/flush_redis
'
,
url
:
'
/docker/flush_redis
_tke
'
,
method
:
'
get
'
,
params
:
query
})
...
...
src/router/modules/docker.js
View file @
9ead530c
...
...
@@ -27,7 +27,7 @@ const dockersRouter = {
path
:
'
createEnv
'
,
component
:
()
=>
import
(
'
@/views/docker/createEnv
'
),
name
:
'
CreateEnv
'
,
meta
:
{
title
:
'
createEnv
'
,
noCache
:
true
}
meta
:
{
title
:
'
createEnv
'
,
noCache
:
true
,
roles
:
[
'
admin
'
]
}
},
{
path
:
'
envTemplate
'
,
...
...
src/store/modules/user.js
View file @
9ead530c
...
...
@@ -67,7 +67,8 @@ const user = {
// reject('Verification failed, please login again.')
// }
const
data
=
response
.
data
data
.
roles
=
[
'
admin
'
]
// data.roles = ['admin']
data
.
roles
=
data
.
role
if
(
data
.
roles
&&
data
.
roles
.
length
>
0
)
{
// 验证返回的roles是否是一个非空数组
commit
(
'
SET_ROLES
'
,
data
.
roles
)
...
...
src/views/docker/createEnv.vue
View file @
9ead530c
...
...
@@ -33,15 +33,16 @@
</el-card>
</el-form-item>
</el-form>
<el-button
style=
"margin-right:40px;margin-bottom:40px;float:right"
type=
"primary"
@
click=
"createData()"
>
{{
$t
(
'
table.confirm
'
)
}}
</el-button>
<el-button
v-permission=
"['admin']"
style=
"margin-right:40px;margin-bottom:40px;float:right"
type=
"primary"
@
click=
"createData()"
>
{{
$t
(
'
table.confirm
'
)
}}
</el-button>
</div>
</
template
>
<
script
>
import
{
getBaseRepos
,
getAllEnvTemplate
,
createEnv
}
from
'
@/api/docker
'
import
permission
from
'
@/directive/permission/index.js
'
// 权限判断指令
export
default
{
directives
:
{
permission
},
filters
:
{
upper
:
function
(
value
)
{
if
(
!
value
)
return
''
...
...
src/views/docker/deployEnv.vue
0 → 100644
View file @
9ead530c
<
template
>
<div
class=
"app-container"
>
<el-form
ref=
"dataForm"
label-position=
"left"
label-width=
"130px"
style=
"width: 95%; margin-left:20px;"
>
<el-form-item
label=
"Namespace名称"
>
<el-input
v-model=
"namespace"
:disabled=
"true"
/>
</el-form-item>
<el-form-item
label=
"选择模板"
>
<el-select
v-model=
"currentTemplate"
value-key=
"preset_name"
style=
"width:100%"
@
change=
"useTemplate"
>
<el-option
v-for=
"item in templates"
:value=
"item.name"
:key=
"item.name"
/>
</el-select>
</el-form-item>
<el-form-item
v-for=
"(ns, index) in repoNamespaces"
:label=
"ns.type | upper"
:key=
"index"
>
<el-card>
<el-button
v-for=
"item in ns.repos"
:key=
"item.domain"
:type=
"dependant[ns.type] && dependant[ns.type].find(sys => sys.appname === item.appname) ? 'success' : ''"
style=
"margin:3px"
@
click=
"selectSystem(item, ns.type)"
>
{{
item
.
appname
}}
</el-button>
</el-card>
</el-form-item>
</el-form>
<el-button
style=
"margin-right:40px;margin-bottom:40px;float:right"
type=
"primary"
@
click=
"createData()"
>
{{
$t
(
'
table.confirm
'
)
}}
</el-button>
<el-button
style=
"margin-right:40px;margin-bottom:40px;float:right"
@
click=
"goBack()"
>
{{
$t
(
'
table.cancel
'
)
}}
</el-button>
</div>
</
template
>
<
script
>
import
{
getAppRepos
,
getAllEnvTemplate
,
createEnv
}
from
'
@/api/docker
'
export
default
{
filters
:
{
upper
:
function
(
value
)
{
if
(
!
value
)
return
''
value
=
value
.
toString
()
return
value
[
0
].
toUpperCase
()
+
value
.
slice
(
1
)
}
},
data
()
{
return
{
namespace
:
''
,
dependant
:
{},
repoNamespaces
:
[],
currentTemplate
:
''
,
templates
:
{}
}
},
created
()
{
this
.
namespace
=
this
.
$route
.
params
.
name
this
.
getAllRepos
()
this
.
getAllEnvTemplate
()
},
methods
:
{
goBack
()
{
this
.
$router
.
go
(
-
1
)
},
getAllRepos
()
{
getAppRepos
().
then
(
res
=>
{
this
.
repoNamespaces
=
res
.
data
})
},
getAllEnvTemplate
()
{
getAllEnvTemplate
().
then
(
res
=>
{
this
.
templates
=
res
.
data
})
},
selectSystem
(
item
,
type
)
{
if
(
!
this
.
dependant
[
type
])
this
.
$set
(
this
.
dependant
,
type
,
[])
const
index
=
this
.
dependant
[
type
].
findIndex
(
sys
=>
sys
.
appname
===
item
.
appname
)
if
(
index
===
-
1
)
{
this
.
dependant
[
type
].
push
(
item
)
}
else
{
this
.
dependant
[
type
].
splice
(
index
,
1
)
}
},
useTemplate
()
{
const
vm
=
this
const
t
=
this
.
templates
.
find
(
item
=>
item
.
name
===
this
.
currentTemplate
)
// 清空所有选择
vm
.
$set
(
this
,
'
dependant
'
,
{})
// 遍历设置
const
keys
=
Object
.
keys
(
t
)
keys
.
forEach
(
key
=>
{
if
(
key
!==
'
name
'
&&
key
!==
'
_id
'
)
{
t
[
key
].
forEach
(
repo
=>
{
vm
.
selectSystem
(
repo
,
key
)
})
}
})
},
createData
()
{
const
param
=
{
namespace
:
this
.
namespace
,
dependant
:
this
.
dependant
}
createEnv
(
param
).
then
(
res
=>
{
this
.
$router
.
push
({
path
:
`/dockers/runingEnv/
${
this
.
namespace
}
`
})
})
this
.
$message
({
message
:
'
正在部署,请稍候
'
,
type
:
'
success
'
,
duration
:
2000
})
}
}
}
</
script
>
src/views/docker/envDetail.vue
View file @
9ead530c
...
...
@@ -480,7 +480,7 @@ export default {
clearRedis
()
{
flushRedis
({
namespace
:
this
.
namespace
}).
then
(
res
=>
{
this
.
$message
({
message
:
'
清理redis缓存成功
'
,
message
:
res
.
data
.
msg
||
'
清理redis缓存成功
'
,
type
:
'
success
'
})
})
...
...
src/views/docker/envTemplate.vue
View file @
9ead530c
...
...
@@ -22,14 +22,16 @@
</el-card>
</el-form-item>
</el-form>
<el-button
style=
"margin-right:40px;margin-bottom:40px;float:right"
type=
"primary"
@
click=
"createData()"
>
{{
$t
(
'
table.confirm
'
)
}}
</el-button>
<el-button
v-permission=
"['admin']"
style=
"margin-right:40px;margin-bottom:40px;float:right"
type=
"primary"
@
click=
"createData()"
>
{{
$t
(
'
table.confirm
'
)
}}
</el-button>
</div>
</
template
>
<
script
>
import
{
getAllRepos
,
getAllEnvTemplate
,
createEnvTemplate
}
from
'
@/api/docker
'
import
permission
from
'
@/directive/permission/index.js
'
// 权限判断指令
export
default
{
directives
:
{
permission
},
filters
:
{
upper
:
function
(
value
)
{
...
...
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