mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 13:11:43 +00:00
50 lines
713 B
Vue
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>
|