ssh: handle ssh details view

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2019-10-16 12:07:33 +05:30
parent 4aac250928
commit 7dad796113
3 changed files with 5 additions and 5 deletions

View File

@ -70,7 +70,7 @@
<div class="resource-detail-item" v-if="resource.keypair">
<a-icon type="key" />
<router-link :to="{ path: '/ssh/?name=' + resource.keypair }">{{ resource.keypair }}</router-link>
<router-link :to="{ path: '/ssh/' + resource.keypair }">{{ resource.keypair }}</router-link>
</div>
<div class="resource-detail-item" v-if="resource.group">
<a-icon type="gold" />{{ resource.group }}

View File

@ -18,7 +18,7 @@
<a slot="name" slot-scope="text, record" href="javascript:;">
<router-link :to="{ path: $route.path + '/' + record.id }" v-if="record.id">{{ text }}</router-link>
<router-link :to="{ path: $route.path + '/?name=' + record.name }" v-else>{{ text }}</router-link>
<router-link :to="{ path: $route.path + '/' + record.name }" v-else>{{ text }}</router-link>
</a>
<a slot="displayname" slot-scope="text, record" href="javascript:;">
<router-link :to="{ path: $route.path + '/' + record.id }">{{ text }}</router-link>

View File

@ -329,6 +329,9 @@ export default {
this.loading = true
if (this.$route.params && this.$route.params.id) {
params['id'] = this.$route.params.id
if (this.$route.path.startsWith('/ssh/')) {
params['name'] = this.$route.params.id
}
}
params['page'] = this.page
params['pagesize'] = this.pageSize
@ -358,9 +361,6 @@ export default {
}
if (this.items.length > 0) {
this.resource = this.items[0]
if (this.items && this.items.length === 1 && Object.keys(this.$route.query).length > 0) {
this.dataView = true
}
} else {
this.resource = {}
}