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
b6817737
Commit
b6817737
authored
Sep 10, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取cluster
parent
6ddbb1b4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
7 deletions
+35
-7
docker.js
src/api/docker.js
+8
-0
envDetail.vue
src/views/docker/envDetail.vue
+7
-1
runingEnvDev.vue
src/views/docker/runingEnvDev.vue
+11
-3
runingEnvTest.vue
src/views/docker/runingEnvTest.vue
+9
-3
No files found.
src/api/docker.js
View file @
b6817737
...
...
@@ -64,6 +64,14 @@ export function getGroup(query) {
})
}
export
function
getCluster
(
query
)
{
return
request
({
url
:
'
/k8s/cluster
'
,
method
:
'
get
'
,
params
:
query
})
}
export
function
fetchKubernetesList
()
{
return
request
({
url
:
'
/k8s/namespace
'
,
...
...
src/views/docker/envDetail.vue
View file @
b6817737
...
...
@@ -765,7 +765,13 @@ export default {
},
linkShell
(
scopeData
)
{
window
.
open
(
`http://172.30.220.24:9600/static/terminal.html?namespace=
${
this
.
namespace
}
&pod=
${
scopeData
.
podName
}
`
,
'
_blank
'
)
if
(
this
.
$store
.
getters
.
cluster
===
'
qa
'
)
{
window
.
open
(
`http://172.30.220.24:9600/static/terminal.html?namespace=
${
this
.
namespace
}
&pod=
${
scopeData
.
podName
}
`
,
'
_blank
'
)
}
if
(
this
.
$store
.
getters
.
cluster
===
'
qke
'
)
{
window
.
open
(
`http://172.30.220.24:9601/static/terminal.html?namespace=
${
this
.
namespace
}
&pod=
${
scopeData
.
podName
}
`
,
'
_blank
'
)
}
// fetchServiceInstance({ serviceName: scopeData.serviceName, namespace: scopeData.namespace }).then(res => {
// const podName = res.data.instances[0].name
...
...
src/views/docker/runingEnvDev.vue
View file @
b6817737
...
...
@@ -5,8 +5,7 @@
<svg-icon
icon-class=
"list"
/>
运行环境列表
<el-select
v-model=
"cluster"
placeholder=
"请选择集群名称"
@
change=
"changeCluster"
>
<el-option
label=
"qa"
value=
"qa"
/>
<el-option
label=
"dev-ops"
value=
"dev-ops"
/>
<el-option
v-for=
"item in clusterArray"
:value=
"item"
:label=
"item"
:key=
"item"
/>
</el-select>
</p>
<el-table
...
...
@@ -52,18 +51,20 @@
</div>
</template>
<
script
>
import
{
fetchKubernetesList
}
from
'
@/api/docker
'
import
{
fetchKubernetesList
,
getCluster
}
from
'
@/api/docker
'
export
default
{
data
()
{
return
{
name
:
'
hello
'
,
tableData
:
[],
clusterArray
:
[],
cluster
:
this
.
$store
.
getters
.
cluster
}
},
created
()
{
this
.
fetchK8sList
()
this
.
getCluster
()
},
methods
:
{
syncMySQL
(
namespace
)
{
...
...
@@ -92,6 +93,13 @@ export default {
this
.
tableData
=
res
.
data
.
namespaces
})
},
getCluster
()
{
getCluster
().
then
(
res
=>
{
this
.
clusterArray
=
res
.
data
})
},
indexMethod
(
index
)
{
return
index
+
1
},
...
...
src/views/docker/runingEnvTest.vue
View file @
b6817737
...
...
@@ -5,8 +5,7 @@
<svg-icon
icon-class=
"list"
/>
运行环境列表
<el-select
v-model=
"cluster"
placeholder=
"请选择集群名称"
@
change=
"changeCluster"
>
<el-option
label=
"qa"
value=
"qa"
/>
<el-option
label=
"dev-ops"
value=
"dev-ops"
/>
<el-option
v-for=
"item in clusterArray"
:value=
"item"
:label=
"item"
:key=
"item"
/>
</el-select>
</p>
<el-table
...
...
@@ -52,18 +51,20 @@
</div>
</template>
<
script
>
import
{
fetchKubernetesList
}
from
'
@/api/docker
'
import
{
fetchKubernetesList
,
getCluster
}
from
'
@/api/docker
'
export
default
{
data
()
{
return
{
name
:
'
hello
'
,
clusterArray
:
[],
tableData
:
[],
cluster
:
this
.
$store
.
getters
.
cluster
}
},
created
()
{
this
.
fetchK8sList
()
this
.
getCluster
()
},
methods
:
{
syncMySQL
(
namespace
)
{
...
...
@@ -87,6 +88,11 @@ export default {
this
.
tableData
=
res
.
data
.
namespaces
})
},
getCluster
()
{
getCluster
().
then
(
res
=>
{
this
.
clusterArray
=
res
.
data
})
},
indexMethod
(
index
)
{
return
index
+
1
},
...
...
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