Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ui/src/views/compute/backup/BackupSchedule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default {
default: false
},
dataSource: {
type: Object,
type: Array,
required: true
},
deleteFn: {
Expand Down Expand Up @@ -128,6 +128,7 @@ export default {
dataIndex: 'intervaltype'
},
{
key: 'time',
title: this.$t('label.time'),
dataIndex: 'schedule'
},
Expand Down
22 changes: 18 additions & 4 deletions ui/src/views/compute/backup/FormSchedule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
v-model:value="form.intervaltype"
button-style="solid"
@change="handleChangeIntervalType">
<a-radio-button value="hourly">
<a-radio-button value="hourly" :disabled="handleVisibleInterval('HOURLY')">
{{ $t('label.hourly') }}
</a-radio-button>
<a-radio-button value="daily">
<a-radio-button value="daily" :disabled="handleVisibleInterval('DAILY')">
{{ $t('label.daily') }}
</a-radio-button>
<a-radio-button value="weekly">
<a-radio-button value="weekly" :disabled="handleVisibleInterval('WEEKLY')">
{{ $t('label.weekly') }}
</a-radio-button>
<a-radio-button value="monthly">
<a-radio-button value="monthly" :disabled="handleVisibleInterval('MONTHLY')">
{{ $t('label.monthly') }}
</a-radio-button>
</a-radio-group>
Expand Down Expand Up @@ -180,6 +180,10 @@ export default {
type: Boolean,
default: false
},
dataSource: {
type: Array,
required: true
},
resource: {
type: Object,
required: true
Expand Down Expand Up @@ -287,6 +291,16 @@ export default {
break
}
},
handleVisibleInterval (intervalType) {
if (this.dataSource?.length === 0) {
return false
}
const dataSource = this.dataSource.filter(item => item.intervaltype === intervalType)
if (dataSource && dataSource.length > 0) {
return true
}
return false
},
handleSubmit (e) {
if (this.actionLoading) return
this.formRef.value.validate().then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
@cancel="closeModals">
<form-schedule
:resource="addFormResource"
:dataSource="dataSource"
:submitFn="handleAddBackupSchedule" />
</a-modal>
</div>
Expand Down Expand Up @@ -90,7 +91,8 @@ export default {
return {
backupOffering: null,
showAddBackupSchedule: false,
localBackupOfferingId: this.backupOfferingId
localBackupOfferingId: this.backupOfferingId,
dataSource: []
}
},
provide () {
Expand Down
Loading