mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 03:36:04 +08:00
Latest changes from Harvester master - a537c1ae38eb7030542ac371f24ae3336cd9d422
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<script>
|
||||
import { HCI } from '../types';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
data() {
|
||||
const scheduleList = this.$store.getters['harvester/all'](HCI.SCHEDULE_VM_BACKUP) || [];
|
||||
|
||||
return { scheduleList };
|
||||
},
|
||||
computed: {
|
||||
vmSchedule() {
|
||||
if (!this.value) {
|
||||
return '';
|
||||
} else {
|
||||
return this.scheduleList.find(s => s.id === this.value);
|
||||
}
|
||||
},
|
||||
to() {
|
||||
return this.vmSchedule?.detailLocation;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<router-link v-if="to" :to="to">
|
||||
{{ value }}
|
||||
</router-link>
|
||||
<span v-else-if="value">
|
||||
{{ value }}
|
||||
</span>
|
||||
<span v-else class="text-muted">
|
||||
—
|
||||
</span>
|
||||
</template>
|
||||
@@ -0,0 +1,32 @@
|
||||
<script>
|
||||
import cronstrue from 'cronstrue';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
cronTooltipHint() {
|
||||
let cronHint = '';
|
||||
|
||||
try {
|
||||
cronHint = cronstrue.toString(this.value, { verbose: true });
|
||||
} catch (e) {
|
||||
cronHint = this.t('generic.invalidCron');
|
||||
}
|
||||
|
||||
return cronHint || this.value.spec.cron;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span v-clean-tooltip="cronTooltipHint">
|
||||
{{ value }}
|
||||
</span>
|
||||
</template>
|
||||
@@ -147,7 +147,7 @@ export default {
|
||||
>
|
||||
<template #title="{formattedPercentage}">
|
||||
<span>
|
||||
{{ t('harvester.formatters.hardwareResourceGauge.allocated') }}
|
||||
{{ t('harvester.dashboard.hardwareResourceGauge.allocated') }}
|
||||
</span>
|
||||
<span class="precent-data">
|
||||
{{ t('node.detail.glance.consumptionGauge.amount', allocatedAmountTemplateValues) }}
|
||||
|
||||
Reference in New Issue
Block a user