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
5f16b751
Commit
5f16b751
authored
Apr 09, 2019
by
薛智杰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'image' into 'master'
修复服务更新失败 See merge request !18
parents
e72745ef
1efe9329
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
84 deletions
+51
-84
envDetail.vue
src/views/docker/envDetail.vue
+51
-84
No files found.
src/views/docker/envDetail.vue
View file @
5f16b751
...
@@ -115,7 +115,7 @@
...
@@ -115,7 +115,7 @@
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"调试
状态
"
>
label=
"调试"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-tooltip
class=
"item"
effect=
"dark"
content=
"控制台"
placement=
"top"
>
<el-tooltip
class=
"item"
effect=
"dark"
content=
"控制台"
placement=
"top"
>
<el-button
type=
"primary"
icon=
"el-icon-tickets"
circle
@
click=
"linkShell(scope.row)"
/>
<el-button
type=
"primary"
icon=
"el-icon-tickets"
circle
@
click=
"linkShell(scope.row)"
/>
...
@@ -148,7 +148,7 @@
...
@@ -148,7 +148,7 @@
<svg-icon
icon-class=
"restart"
/>
<svg-icon
icon-class=
"restart"
/>
重置服务
重置服务
</el-dropdown-item>
</el-dropdown-item>
<el-dropdown-item
style=
"color: red"
@
click.native=
"deleteService(scope.row) "
>
<el-dropdown-item
style=
"color: red"
@
click.native=
"deleteService(scope.row
, item
) "
>
<svg-icon
icon-class=
"delete"
/>
<svg-icon
icon-class=
"delete"
/>
删除服务
删除服务
</el-dropdown-item>
</el-dropdown-item>
...
@@ -194,13 +194,13 @@
...
@@ -194,13 +194,13 @@
v-for=
"(item,index) in tagOptions"
v-for=
"(item,index) in tagOptions"
:key=
"index"
:key=
"index"
:label=
"item.tagName"
:label=
"item.tagName"
:value=
"item.tagName"
/>
:value=
"item.
repo_name + ':' +item.
tagName"
/>
</el-select>
</el-select>
</el-col>
</el-col>
</el-row>
</el-row>
<span
slot=
"footer"
class=
"dialog-footer"
>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"
C
reateClusterService"
>
确 定
</el-button>
<el-button
type=
"primary"
@
click=
"
c
reateClusterService"
>
确 定
</el-button>
</span>
</span>
</el-dialog>
</el-dialog>
<!--更新服务的弹框-->
<!--更新服务的弹框-->
...
@@ -217,7 +217,7 @@
...
@@ -217,7 +217,7 @@
<el-row
:gutter=
"20"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"14"
>
<el-col
:span=
"14"
>
<el-input
<el-input
v-model=
"
ren
ame"
v-model=
"
serviceN
ame"
:disabled=
"true"
:disabled=
"true"
placeholder=
"请输入内容"
/>
placeholder=
"请输入内容"
/>
</el-col>
</el-col>
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
v-for=
"(item,index) in tagOptions"
v-for=
"(item,index) in tagOptions"
:key=
"index"
:key=
"index"
:label=
"item.tagName"
:label=
"item.tagName"
:value=
"item.tagName"
/>
:value=
"item.
repo_name + ':' +item.
tagName"
/>
</el-select>
</el-select>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -313,7 +313,7 @@ export default {
...
@@ -313,7 +313,7 @@ export default {
region
:
''
region
:
''
},
},
updateDialog
:
false
,
updateDialog
:
false
,
ren
ame
:
''
,
serviceN
ame
:
''
,
form
:
{
form
:
{
host
:
''
host
:
''
},
},
...
@@ -360,44 +360,36 @@ export default {
...
@@ -360,44 +360,36 @@ export default {
},
},
getTag
()
{
getTag
()
{
getHostName
({
project_name
:
this
.
reponame
.
split
(
'
/
'
)[
1
]
}).
then
(
res
=>
{
getHostName
({
project_name
:
this
.
reponame
.
split
(
'
/
'
)[
1
]
}).
then
(
res
=>
{
if
(
res
.
data
.
data
)
{
if
(
res
.
data
)
{
this
.
domain
=
res
.
data
.
data
.
host_name
this
.
domain
=
res
.
data
.
host_name
}
}
})
return
fetchTaglist
({
reponame
:
this
.
reponame
})
fetchTaglist
({
reponame
:
this
.
reponame
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
data
.
tagCount
)
{
if
(
res
.
data
.
tagCount
)
{
this
.
tagOptions
=
res
.
data
.
tagInfo
this
.
tagOptions
=
res
.
data
.
tagInfo
}
}
})
})
},
},
C
reateClusterService
()
{
c
reateClusterService
()
{
const
self
=
this
const
self
=
this
const
image
=
`
${
this
.
reponame
}
:
${
this
.
tagName
}
`
this
.
type
=
this
.
label
===
'
base
'
?
this
.
reponame
.
split
(
'
/
'
)[
1
]
:
this
.
label
this
.
type
=
this
.
label
===
'
base
'
?
this
.
reponame
.
split
(
'
/
'
)[
1
]
:
this
.
label
CreateCluService
({
CreateCluService
({
serviceName
:
this
.
reponame
.
split
(
'
/
'
)[
1
],
serviceName
:
this
.
reponame
.
split
(
'
/
'
)[
1
],
namespace
:
this
.
namespace
,
namespace
:
this
.
namespace
,
image
:
imag
e
,
image
:
this
.
tagNam
e
,
label
:
this
.
label
,
label
:
this
.
label
,
type
:
this
.
type
,
type
:
this
.
type
,
domain
:
this
.
domain
.
split
(
'
.
'
)[
0
]
domain
:
this
.
domain
.
split
(
'
.
'
)[
0
]
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
data
.
code
===
'
0000
'
)
{
this
.
$message
({
this
.
$message
({
message
:
res
.
data
,
message
:
res
.
data
,
type
:
'
success
'
,
type
:
'
success
'
,
duration
:
1000
,
duration
:
1000
,
onClose
()
{
onClose
()
{
self
.
dialogVisible
=
false
self
.
dialogVisible
=
false
self
.
getServicelist
()
self
.
getServicelist
()
}
}
})
})
}
else
{
this
.
$message
({
message
:
res
.
data
.
msg
,
type
:
'
error
'
})
}
})
})
},
},
handleDetail
(
data
)
{
handleDetail
(
data
)
{
...
@@ -426,9 +418,6 @@ export default {
...
@@ -426,9 +418,6 @@ export default {
})
})
this
.
dialogHost
=
false
this
.
dialogHost
=
false
})
})
}
else
{
console
.
log
(
'
error submit!!
'
)
return
false
}
}
})
})
},
},
...
@@ -439,9 +428,9 @@ export default {
...
@@ -439,9 +428,9 @@ export default {
updateService
(
value
)
{
updateService
(
value
)
{
this
.
tagName
=
''
this
.
tagName
=
''
this
.
updateDialog
=
true
this
.
updateDialog
=
true
this
.
ren
ame
=
value
.
serviceName
this
.
serviceN
ame
=
value
.
serviceName
this
.
tagOptions
=
[]
this
.
tagOptions
=
[]
fetchTaglist
({
reponame
:
'
qa-
'
+
value
.
userLabels
.
type
+
'
/
'
+
this
.
ren
ame
}).
then
(
res
=>
{
fetchTaglist
({
reponame
:
'
qa-
'
+
value
.
userLabels
.
type
+
'
/
'
+
this
.
serviceN
ame
}).
then
(
res
=>
{
if
(
res
.
data
.
tagCount
)
{
if
(
res
.
data
.
tagCount
)
{
this
.
tagOptions
=
res
.
data
.
tagInfo
this
.
tagOptions
=
res
.
data
.
tagInfo
this
.
server
=
res
.
data
.
server
this
.
server
=
res
.
data
.
server
...
@@ -449,40 +438,25 @@ export default {
...
@@ -449,40 +438,25 @@ export default {
})
})
},
},
updateClusterService
()
{
updateClusterService
()
{
const
image
=
`
${
this
.
server
}
/
${
this
.
rename
}
:
${
this
.
tagName
}
`
const
self
=
this
const
self
=
this
modifyCluService
({
serviceName
:
this
.
rename
,
image
:
image
,
namespace
:
this
.
namespace
}).
then
(
res
=>
{
modifyCluService
({
serviceName
:
this
.
serviceName
,
image
:
this
.
tagName
,
namespace
:
this
.
namespace
}).
then
(
res
=>
{
if
(
res
.
data
.
code
===
'
0000
'
)
{
this
.
$message
({
this
.
$message
({
message
:
'
更新成功
'
,
message
:
'
更新成功
'
,
type
:
'
success
'
,
type
:
'
success
'
,
duration
:
1000
,
duration
:
1000
,
onClose
()
{
onClose
()
{
self
.
updateDialog
=
false
self
.
updateDialog
=
false
self
.
getServicelist
()
self
.
getServicelist
()
}
}
})
})
}
else
{
this
.
$message
({
message
:
res
.
data
.
msg
,
type
:
'
error
'
})
}
})
})
},
},
restartService
(
data
)
{
restartService
(
data
)
{
redeployClusterService
({
namespace
:
data
.
namespace
,
serviceName
:
data
.
serviceName
}).
then
(
res
=>
{
redeployClusterService
({
namespace
:
data
.
namespace
,
serviceName
:
data
.
serviceName
}).
then
(
res
=>
{
if
(
res
.
data
.
code
===
'
0000
'
)
{
this
.
$message
({
this
.
$message
({
type
:
'
success
'
,
type
:
'
success
'
,
message
:
'
服务重部署成功!
'
message
:
'
服务重部署成功!
'
})
})
}
else
{
this
.
$message
({
type
:
'
error
'
,
message
:
res
.
data
.
msg
})
}
})
})
},
},
syncDb
()
{
syncDb
()
{
...
@@ -510,31 +484,24 @@ export default {
...
@@ -510,31 +484,24 @@ export default {
this
.
form
.
host
=
res
.
data
.
body
.
spec
.
rules
[
0
].
host
this
.
form
.
host
=
res
.
data
.
body
.
spec
.
rules
[
0
].
host
})
})
},
},
deleteService
(
data
)
{
deleteService
(
data
,
item
)
{
this
.
$confirm
(
'
此操作将永久此服务, 是否继续?
'
,
'
提示
'
,
{
this
.
$confirm
(
confirmButtonText
:
'
确定
'
,
'
此操作将删除服务, 是否继续?
'
,
cancelButtonText
:
'
取消
'
,
'
提示
'
,
type
:
'
warning
'
{
}).
then
(()
=>
{
confirmButtonText
:
'
确定
'
,
deleteClusterService
({
serviceName
:
data
.
serviceName
,
namespace
:
data
.
namespace
}).
then
((
res
)
=>
{
cancelButtonText
:
'
取消
'
,
if
(
res
.
data
.
code
===
'
0000
'
)
{
type
:
'
warning
'
}
).
then
(()
=>
{
deleteClusterService
({
serviceName
:
data
.
serviceName
,
namespace
:
data
.
namespace
,
type
:
data
.
userLabels
.
type
})
.
then
((
res
)
=>
{
this
.
$message
({
this
.
$message
({
type
:
'
success
'
,
type
:
'
success
'
,
message
:
'
删除成功!
'
message
:
'
删除成功!
'
})
})
this
.
getServicelist
()
this
.
getServicelist
()
}
else
{
})
this
.
$message
({
type
:
'
error
'
,
message
:
res
.
data
.
msg
})
}
})
}).
catch
(()
=>
{
this
.
$message
({
type
:
'
info
'
,
message
:
'
已取消删除
'
})
})
})
},
},
linkShell
(
scopeData
)
{
linkShell
(
scopeData
)
{
...
...
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