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
4e40346b
Commit
4e40346b
authored
Jun 11, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务详情页面请求的接口更新为原生api
parent
520365cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
23 deletions
+33
-23
index.js
src/filters/index.js
+5
-0
envDetail.vue
src/views/docker/envDetail.vue
+28
-23
No files found.
src/filters/index.js
View file @
4e40346b
...
@@ -47,10 +47,15 @@ export function formatStatus(tsatus) {
...
@@ -47,10 +47,15 @@ export function formatStatus(tsatus) {
return
'
正常
'
return
'
正常
'
case
'
Abnormal
'
:
case
'
Abnormal
'
:
return
'
服务启动中
'
return
'
服务启动中
'
case
'
Pending
'
:
case
'
Waiting
'
:
case
'
Waiting
'
:
return
'
服务等待中
'
return
'
服务等待中
'
case
'
Paused
'
:
case
'
Paused
'
:
return
'
更新暂停中
'
return
'
更新暂停中
'
case
'
PodScheduling
'
:
return
'
Pod调度中
'
case
'
Initializing
'
:
return
'
初始化中
'
case
'
Updating
'
:
case
'
Updating
'
:
return
'
服务更新中
'
return
'
服务更新中
'
case
'
RollingBack
'
:
case
'
RollingBack
'
:
...
...
src/views/docker/envDetail.vue
View file @
4e40346b
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
label=
"服务端口"
label=
"服务端口"
width=
"300px"
>
width=
"300px"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<span
v-for=
"item in scope.row.portMappings"
:key=
"item.
containerPort"
class=
"port"
>
{{
item
.
nodePort
}}
->
{{
item
.
containerP
ort
}}
</span>
<span
v-for=
"item in scope.row.portMappings"
:key=
"item.
port"
class=
"port"
>
{{
item
.
nodePort
}}
->
{{
item
.
p
ort
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
...
@@ -113,7 +113,7 @@
...
@@ -113,7 +113,7 @@
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
prop=
"createdAt"
prop=
"createdAt"
width=
"1
0
0"
width=
"1
8
0"
label=
"创建时间"
label=
"创建时间"
/>
/>
<el-table-column
<el-table-column
...
@@ -298,7 +298,7 @@ import {
...
@@ -298,7 +298,7 @@ import {
CreateCluService
,
CreateCluService
,
fetchServiceDetails
,
fetchServiceDetails
,
modifyCluService
,
modifyCluService
,
fetchServiceInstance
,
//
fetchServiceInstance,
deleteClusterService
,
deleteClusterService
,
redeployClusterService
,
redeployClusterService
,
flushRedis
,
flushRedis
,
...
@@ -423,15 +423,17 @@ export default {
...
@@ -423,15 +423,17 @@ export default {
})
})
},
},
handleDetail
(
data
)
{
handleDetail
(
data
)
{
ingressHost
({
namespace
:
data
.
namespace
,
serviceName
:
data
.
serviceName
}).
then
(
res
=>
{
window
.
open
(
`http://
${
data
.
host
}
/`
,
'
_blank
'
)
const
url
=
res
.
data
.
body
.
spec
.
rules
[
0
].
host
window
.
open
(
`http://
${
url
}
/`
,
'
_blank
'
)
// ingressHost({ namespace: data.namespace, serviceName: data.serviceName }).then(res => {
})
// const url = res.data.body.spec.rules[0].host
// window.open(`http://${url}/`, '_blank')
// })
},
},
getServiceDetails
(
value
)
{
getServiceDetails
(
value
)
{
fetchServiceDetails
({
serviceName
:
value
.
serviceName
,
namespace
:
value
.
namespace
}).
then
(
res
=>
{
fetchServiceDetails
({
serviceName
:
value
.
serviceName
,
namespace
:
this
.
namespace
}).
then
(
res
=>
{
this
.
centerDialogVisible
=
true
this
.
centerDialogVisible
=
true
this
.
value
=
res
.
data
.
service
this
.
value
=
res
.
data
})
})
},
},
submitHost
(
formName
)
{
submitHost
(
formName
)
{
...
@@ -459,8 +461,9 @@ export default {
...
@@ -459,8 +461,9 @@ export default {
this
.
tagName
=
''
this
.
tagName
=
''
this
.
updateDialog
=
true
this
.
updateDialog
=
true
this
.
serviceName
=
value
.
serviceName
this
.
serviceName
=
value
.
serviceName
this
.
type
=
value
.
labels
.
type
this
.
tagOptions
=
[]
this
.
tagOptions
=
[]
fetchTaglist
({
reponame
:
'
qa-
'
+
value
.
userL
abels
.
type
+
'
/
'
+
this
.
serviceName
}).
then
(
res
=>
{
fetchTaglist
({
reponame
:
'
qa-
'
+
value
.
l
abels
.
type
+
'
/
'
+
this
.
serviceName
}).
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
...
@@ -469,7 +472,7 @@ export default {
...
@@ -469,7 +472,7 @@ export default {
},
},
updateClusterService
()
{
updateClusterService
()
{
const
self
=
this
const
self
=
this
modifyCluService
({
serviceName
:
this
.
serviceName
,
image
:
this
.
tagName
,
namespace
:
this
.
namespace
}).
then
(
res
=>
{
modifyCluService
({
serviceName
:
this
.
serviceName
,
image
:
this
.
tagName
,
namespace
:
this
.
namespace
,
type
:
this
.
type
}).
then
(
res
=>
{
this
.
$message
({
this
.
$message
({
message
:
'
更新成功
'
,
message
:
'
更新成功
'
,
type
:
'
success
'
,
type
:
'
success
'
,
...
@@ -482,7 +485,7 @@ export default {
...
@@ -482,7 +485,7 @@ export default {
})
})
},
},
restartService
(
data
)
{
restartService
(
data
)
{
redeployClusterService
({
namespace
:
data
.
namespace
,
serviceName
:
data
.
service
Name
}).
then
(
res
=>
{
redeployClusterService
({
namespace
:
this
.
namespace
,
podName
:
data
.
pod
Name
}).
then
(
res
=>
{
this
.
$message
({
this
.
$message
({
type
:
'
success
'
,
type
:
'
success
'
,
message
:
'
服务重部署成功!
'
message
:
'
服务重部署成功!
'
...
@@ -512,7 +515,7 @@ export default {
...
@@ -512,7 +515,7 @@ export default {
this
.
dialogHost
=
true
this
.
dialogHost
=
true
this
.
form
.
host
=
''
this
.
form
.
host
=
''
this
.
ingressName
=
data
.
serviceName
this
.
ingressName
=
data
.
serviceName
ingressHost
({
namespace
:
data
.
namespace
,
serviceName
:
data
.
serviceName
}).
then
(
res
=>
{
ingressHost
({
namespace
:
this
.
namespace
,
serviceName
:
data
.
serviceName
}).
then
(
res
=>
{
this
.
form
.
host
=
res
.
data
.
body
.
spec
.
rules
[
0
].
host
this
.
form
.
host
=
res
.
data
.
body
.
spec
.
rules
[
0
].
host
})
})
},
},
...
@@ -526,7 +529,7 @@ export default {
...
@@ -526,7 +529,7 @@ export default {
type
:
'
warning
'
type
:
'
warning
'
}
}
).
then
(()
=>
{
).
then
(()
=>
{
deleteClusterService
({
serviceName
:
data
.
serviceName
,
namespace
:
data
.
namespace
,
type
:
data
.
userLabels
.
typ
e
})
deleteClusterService
({
namespace
:
this
.
namespace
,
serviceName
:
data
.
serviceName
,
podName
:
data
.
podNam
e
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
this
.
$message
({
this
.
$message
({
type
:
'
success
'
,
type
:
'
success
'
,
...
@@ -538,24 +541,26 @@ export default {
...
@@ -538,24 +541,26 @@ export default {
})
})
})
})
},
},
linkShell
(
scopeData
)
{
linkShell
(
scopeData
)
{
fetchServiceInstance
({
serviceName
:
scopeData
.
serviceName
,
namespace
:
scopeData
.
namespace
}).
then
(
res
=>
{
window
.
open
(
`http://172.30.220.24:9600/static/terminal.html?namespace=
${
this
.
namespace
}
&pod=
${
scopeData
.
podName
}
`
,
'
_blank
'
)
const
podName
=
res
.
data
.
instances
[
0
].
name
window
.
open
(
`http://172.30.220.24:9600/static/terminal.html?namespace=
${
scopeData
.
namespace
}
&pod=
${
podName
}
`
,
'
_blank
'
)
// fetchServiceInstance({ serviceName: scopeData.serviceName, namespace: scopeData.namespace }).then(res => {
})
// const podName = res.data.instances[0].name
// window.open(`http://172.30.220.24:9600/static/terminal.html?namespace=${scopeData.namespace}&pod=${podName}`, '_blank')
// })
},
},
linkLog
(
scopeData
)
{
linkLog
(
scopeData
)
{
let
path
=
''
let
path
=
''
if
(
scopeData
.
userL
abels
.
type
===
'
ui
'
)
{
if
(
scopeData
.
l
abels
.
type
===
'
ui
'
)
{
path
=
'
/usr/local/openresty/nginx/logs/access.log /usr/local/openresty/nginx/logs/error.log
'
path
=
'
/usr/local/openresty/nginx/logs/access.log /usr/local/openresty/nginx/logs/error.log
'
}
else
{
}
else
{
path
=
`/home/quant_group/logs/
${
scopeData
.
serviceName
}
.log`
path
=
`/home/quant_group/logs/
${
scopeData
.
serviceName
}
.log`
}
}
fetchServiceInstance
({
serviceName
:
scopeData
.
serviceName
,
namespace
:
scopeData
.
namespace
}).
then
(
res
=>
{
window
.
open
(
`http://172.30.220.24:9600/static/logs.html?namespace=
${
this
.
namespace
}
&pod=
${
scopeData
.
podName
}
&paths=
${
path
}
`
,
'
_blank
'
)
const
podName
=
res
.
data
.
instances
[
0
].
name
window
.
open
(
`http://172.30.220.24:9600/static/logs.html?namespace=
${
scopeData
.
namespace
}
&pod=
${
podName
}
&paths=
${
path
}
`
,
'
_blank
'
)
})
},
},
array2Object
(
original
)
{
// 将数组转成对象存储
array2Object
(
original
)
{
// 将数组转成对象存储
this
.
FormatTabledata
=
{}
this
.
FormatTabledata
=
{}
original
.
forEach
((
item
,
index
)
=>
{
original
.
forEach
((
item
,
index
)
=>
{
...
...
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