mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 21:21:44 +00:00
33 lines
528 B
Vue
33 lines
528 B
Vue
<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>
|