Francesco Torchia 4626d56acd
Lint fixes
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-11-12 11:50:20 +01:00

50 lines
713 B
Vue

<script>
import { HCI } from '../types';
export default {
props: {
value: {
type: String,
default: ''
},
row: {
type: Object,
default: () => {
return {};
}
}
},
data() {
const vmList = this.$store.getters['harvester/all'](HCI.VM) || [];
return { vmList };
},
computed: {
vm() {
const vm = this.vmList.find( (V) => V.id === `${ this.row.metadata.namespace }/${ this.value }`);
return vm;
},
to() {
return this.vm?.detailLocation;
},
}
};
</script>
<template>
<router-link
v-if="to"
:to="to"
>
{{ value }}
</router-link>
<span v-else>
{{ value }}
</span>
</template>