feat: make parent link clickable

This commit is contained in:
Peace 2023-01-28 14:53:40 +01:00
parent d48eb24046
commit 661fa87134
No known key found for this signature in database
GPG Key ID: 0EF6B46E172B739F

View File

@ -1,7 +1,7 @@
<template>
<transition name="slide-fade" appear>
<div v-if="monitor">
<span> {{ group }}</span>
<router-link v-if="group !== ''" :to="monitorURL(monitor.parent)"> {{ group }}</router-link>
<h1> {{ monitor.name }}</h1>
<div class="tags">
<Tag v-for="tag in monitor.tags" :key="tag.id" :item="tag" :size="'sm'" />
@ -190,6 +190,7 @@ import Pagination from "v-pagination-3";
const PingChart = defineAsyncComponent(() => import("../components/PingChart.vue"));
import Tag from "../components/Tag.vue";
import CertificateInfo from "../components/CertificateInfo.vue";
import { getMonitorRelativeURL } from "../util.ts";
export default {
components: {
@ -386,6 +387,15 @@ export default {
return this.$t(translationPrefix + "Ping");
},
/**
* Get URL of monitor
* @param {number} id ID of monitor
* @returns {string} Relative URL of monitor
*/
monitorURL(id) {
return getMonitorRelativeURL(id);
},
},
};
</script>