diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json
index 39e12a9517e..05850327d6a 100644
--- a/ui/public/locales/en.json
+++ b/ui/public/locales/en.json
@@ -579,6 +579,7 @@
"label.creating.iprange": "Creating IP ranges",
"label.credit": "Credit",
"label.cron": "Cron expression",
+"label.cron.mode": "Cron mode",
"label.crosszones": "Cross zones",
"label.currency": "Currency",
"label.current": "Current",
diff --git a/ui/src/views/compute/InstanceSchedules.vue b/ui/src/views/compute/InstanceSchedules.vue
index 41694adce33..67e1f6ed749 100644
--- a/ui/src/views/compute/InstanceSchedules.vue
+++ b/ui/src/views/compute/InstanceSchedules.vue
@@ -22,8 +22,9 @@
style="width: 100%; margin-bottom: 10px"
@click="showAddModal"
:loading="loading"
- :disabled="!('createVMSchedule' in $store.getters.apis)">
- {{ $t('label.schedule.add') }}
+ :disabled="!('createVMSchedule' in $store.getters.apis)"
+ >
+ {{ $t('label.schedule.add') }}
+ @refresh="this.fetchData"
+ />
+ showQuickJumper
+ >
{{ props.value }} / {{ $t('label.page') }}
@@ -60,66 +63,68 @@
:title="$t('label.schedule')"
:maskClosable="false"
:closable="true"
- :footer="null"
- @cancel="closeModal">
+ @cancel="closeModal"
+ @ok="submitForm"
+ >
-
+ v-ctrl-enter="submitForm"
+ >
+
-
+
+ v-focus="true"
+ />
-
+
-
+
-
+ :disabled="isEdit"
+ >
+
{{ $t(action.label) }}
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+ :loading="fetching"
+ >
+
{{ opt.name || opt.description }}
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
@@ -191,7 +261,12 @@ import { mixinForm } from '@/utils/mixin'
import { timeZone } from '@/utils/timezone'
import debounce from 'lodash/debounce'
import cronstrue from 'cronstrue/i18n'
-import moment from 'moment-timezone'
+import dayjs from 'dayjs'
+import utc from 'dayjs/plugin/utc'
+import timezone from 'dayjs/plugin/timezone'
+
+dayjs.extend(utc)
+dayjs.extend(timezone)
export default {
name: 'InstanceSchedules',
@@ -323,8 +398,8 @@ export default {
this.isEdit = true
Object.assign(this.form, schedule)
// Some weird issue when we directly pass in the moment with tz object
- this.form.startDate = moment(moment(schedule.startdate).tz(schedule.timezone).format(this.pattern))
- this.form.endDate = schedule.enddate ? moment(moment(schedule.enddate).tz(schedule.timezone).format(this.pattern)) : ''
+ this.form.startDate = dayjs(schedule.startdate).tz(schedule.timezone)
+ this.form.endDate = schedule.enddate ? dayjs(dayjs(schedule.enddate).tz(schedule.timezone)) : null
this.showAddModal()
},
showAddModal () {
@@ -431,7 +506,7 @@ export default {
this.updateColumns()
},
generateHumanReadableSchedule (schedule) {
- return cronstrue.toString(schedule, { locale: this.$i18n.locale, throwExceptionOnParseError: false })
+ return cronstrue.toString(schedule, { locale: this.$i18n.locale, throwExceptionOnParseError: false, verbose: true })
},
updateColumns () {
this.columns = []