Skip to content

Commit

Permalink
Add a link to service on router detail view
Browse files Browse the repository at this point in the history
  • Loading branch information
Tchoupinax committed Mar 7, 2022
1 parent 63bb770 commit 401c171
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion webui/src/pages/_commons/RouterDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
</div>
</div>

<div v-if="routerByName.item.service" class="col-12 col-md-3 q-mb-lg path-block">
<div v-if="routerByName.item.service"
class="service col-12 col-md-3 q-mb-lg path-block"
@click="$router.push({ path: `/${protocol}/services/${getServiceId(routerByName.item)}`})">
<div class="row no-wrap items-center q-mb-lg app-title">
<q-icon name="eva-flash"></q-icon>
<div class="app-title-label">Service</div>
Expand Down Expand Up @@ -270,6 +272,14 @@ export default {
.catch(error => {
console.log('Error -> routers/byName', error)
})
},
getServiceId (data) {
const words = data.service.split('@')
if (words.length === 2) {
return data.service
}
return `${data.service}@${data.provider}`
}
},
created () {
Expand Down Expand Up @@ -297,6 +307,10 @@ export default {
margin-left: 20px;
color: #b2b2b2;
}
&.service {
cursor: pointer;
}
}
</style>

0 comments on commit 401c171

Please sign in to comment.