Skip to content

Commit a69ce95

Browse files
config: fix contextual navigation and rendering
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 13ca085 commit a69ce95

File tree

6 files changed

+60
-60
lines changed

6 files changed

+60
-60
lines changed

ui/src/components/view/InfoCard.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,10 @@
308308

309309
<div class="account-center-tags" v-if="$route.meta.related">
310310
<span v-for="item in $route.meta.related" :key="item.path">
311-
<router-link :to="{ path: '/' + item.name + '?' + item.param + '=' + (item.param === 'account' ? resource.name + '&domainid=' + resource.domainid : resource.id) }">
312-
<a-button style="margin-right: 10px">
311+
<router-link
312+
v-if="$router.resolve('/' + item.name).route.name !== '404'"
313+
:to="{ path: '/' + item.name + '?' + item.param + '=' + (item.param === 'account' ? resource.name + '&domainid=' + resource.domainid : resource.id) }">
314+
<a-button style="margin-right: 10px" :icon="$router.resolve('/' + item.name).route.meta.icon" >
313315
View {{ $t(item.title) }}
314316
</a-button>
315317
</router-link>

ui/src/components/view/ListView.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,29 @@
3333
</span>
3434
</template>
3535

36-
<a slot="name" slot-scope="text, record" href="javascript:;" style="display: inline-flex">
36+
<a slot="name" slot-scope="text, record" href="javascript:;">
37+
<div>
3738
<span v-if="$route.path.startsWith('/project')" style="margin-right: 5px">
3839
<a-button type="dashed" size="small" shape="circle" icon="login" @click="changeProject(record)" />
3940
</span>
4041
<console :resource="record" size="small" />
4142
<router-link :to="{ path: $route.path + '/' + record.id }" v-if="record.id">{{ text }}</router-link>
4243
<router-link :to="{ path: $route.path + '/' + record.name }" v-else>{{ text }}</router-link>
44+
</div>
45+
<div v-if="$route.meta.related" style="padding-top: 5px">
46+
<span v-for="item in $route.meta.related" :key="item.path">
47+
<router-link
48+
v-if="$router.resolve('/' + item.name).route.name !== '404'"
49+
:to="{ path: '/' + item.name + '?' + item.param + '=' + (item.param === 'account' ? record.name + '&domainid=' + record.domainid : record.id) }">
50+
<a-tooltip placement="bottom">
51+
<template slot="title">
52+
View {{ $t(item.title) }}
53+
</template>
54+
<a-button size="small" shape="round" :icon="$router.resolve('/' + item.name).route.meta.icon" />
55+
</a-tooltip>
56+
</router-link>
57+
</span>
58+
</div>
4359
</a>
4460
<a slot="displayname" slot-scope="text, record" href="javascript:;">
4561
<router-link :to="{ path: $route.path + '/' + record.id }">{{ text }}</router-link>

ui/src/components/widgets/Breadcrumb.vue

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@
1818
<template>
1919
<a-breadcrumb class="breadcrumb">
2020
<a-breadcrumb-item v-for="(item, index) in breadList" :key="index">
21-
<a
22-
v-if="item.meta.docHelp"
23-
style="margin-right: 5px"
24-
:href="docBase + '/' + item.meta.docHelp"
25-
target="_blank">
26-
<a-icon type="question-circle-o"></a-icon>
27-
</a>
2821
<router-link
2922
v-if="item && item.name"
3023
:to="{ path: item.path === '' ? '/' : item.path }"
@@ -40,18 +33,15 @@
4033
</span>
4134
<a-tooltip v-if="index === (breadList.length - 1)" placement="bottom">
4235
<template slot="title">
43-
{{ "Refresh" }}
36+
{{ "Open Documentation" }}
4437
</template>
45-
<a-button
46-
shape="circle"
47-
style="margin-left: 8px"
48-
@click="$emit('refresh')" >
49-
<a-icon
50-
type="reload"
51-
style="margin-left: 0px"
52-
@click="$emit('refresh')"
53-
/>
54-
</a-button>
38+
<a
39+
v-if="item.meta.docHelp"
40+
style="margin-right: 5px"
41+
:href="docBase + '/' + $route.meta.docHelp"
42+
target="_blank">
43+
<a-icon type="question-circle-o"></a-icon>
44+
</a>
5545
</a-tooltip>
5646
</a-breadcrumb-item>
5747
</a-breadcrumb>

ui/src/config/router.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export function generateRouterMap (section) {
7474
name: child.name,
7575
keepAlive: true,
7676
icon: child.icon,
77+
docHelp: child.docHelp,
7778
hidden: child.hidden,
7879
permission: child.permission,
7980
resourceType: child.resourceType,
@@ -190,21 +191,21 @@ export const asyncRouterMap = [
190191
children: [
191192
{
192193
path: '/exception/403',
193-
name: 'Exception403',
194+
name: '403',
194195
hidden: true,
195196
component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/403'),
196197
meta: { title: '403' }
197198
},
198199
{
199200
path: '/exception/404',
200-
name: 'Exception404',
201+
name: '404',
201202
hidden: true,
202203
component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404'),
203204
meta: { title: '404' }
204205
},
205206
{
206207
path: '/exception/500',
207-
name: 'Exception500',
208+
name: '500',
208209
hidden: true,
209210
component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/500'),
210211
meta: { title: '500' }

ui/src/config/section/network.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ export default {
3232
name: 'publicip',
3333
title: 'IP Addresses',
3434
param: 'associatednetworkid'
35+
}, {
36+
name: 'router',
37+
title: 'Routers',
38+
param: 'networkid'
3539
}, {
3640
name: 'vm',
3741
title: 'Instances',

ui/src/views/AutogenView.vue

Lines changed: 23 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,53 +19,34 @@
1919
<div>
2020
<a-card class="mobile-breadcrumb">
2121
<a-row>
22-
<a-col :span="24" style="display: inline-flex">
23-
<breadcrumb style="margin-right: 10px; width: 100%" @refresh="fetchData()" />
24-
<span
25-
v-for="(action, actionIndex) in actions"
26-
:key="actionIndex">
27-
<a-tooltip
28-
placement="bottom"
29-
v-if="action.api in $store.getters.apis &&
30-
((!dataView && (action.listView || action.groupAction && selectedRowKeys.length > 0)) ||
31-
(dataView && action.dataView && ('show' in action ? action.show(resource) : true)))">
22+
<a-col :span="14">
23+
<breadcrumb style="padding-top: 6px" />
24+
</a-col>
25+
<a-col :span="10">
26+
<span style="float: right">
27+
<a-tooltip placement="bottom">
3228
<template slot="title">
33-
{{ $t(action.label) }}
29+
{{ "Refresh" }}
3430
</template>
3531
<a-button
36-
:icon="action.icon"
37-
:type="action.icon === 'delete' ? 'danger' : (action.icon === 'plus' ? 'primary' : 'default')"
32+
:loading="loading"
3833
shape="circle"
34+
type="dashed"
35+
icon="reload"
3936
style="margin-right: 5px"
40-
@click="execAction(action)"
41-
>
42-
</a-button>
37+
@click="fetchData()" />
4338
</a-tooltip>
44-
</span>
45-
46-
<a-input-search
47-
style="width: 100%; padding-left: 5px"
48-
size="default"
49-
placeholder="Search"
50-
v-model="searchQuery"
51-
v-if="!dataView"
52-
@search="onSearch"
53-
>
54-
</a-input-search>
55-
</a-col>
56-
<a-col :span="24" v-if="false">
57-
<span
58-
v-for="(action, actionIndex) in actions"
59-
:key="actionIndex">
6039
<a-tooltip
61-
placement="bottom"
62-
v-if="action.api in $store.getters.apis &&
63-
((!dataView && (action.listView || action.groupAction && selectedRowKeys.length > 0)) ||
64-
(dataView && action.dataView && ('show' in action ? action.show(resource) : true)))">
40+
v-for="(action, actionIndex) in actions"
41+
:key="actionIndex"
42+
placement="bottom">
6543
<template slot="title">
6644
{{ $t(action.label) }}
6745
</template>
6846
<a-button
47+
v-if="action.api in $store.getters.apis &&
48+
((!dataView && (action.listView || action.groupAction && selectedRowKeys.length > 0)) ||
49+
(dataView && action.dataView && ('show' in action ? action.show(resource) : true)))"
6950
:icon="action.icon"
7051
:type="action.icon === 'delete' ? 'danger' : (action.icon === 'plus' ? 'primary' : 'default')"
7152
shape="circle"
@@ -74,6 +55,12 @@
7455
>
7556
</a-button>
7657
</a-tooltip>
58+
<a-input-search
59+
style="width: unset"
60+
placeholder="Search"
61+
v-model="searchQuery"
62+
v-if="!dataView"
63+
@search="onSearch" />
7764
</span>
7865
</a-col>
7966
</a-row>

0 commit comments

Comments
 (0)