2022-04-08 14:09:56 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="system">
|
|
|
|
|
<div class="system-config-form">
|
|
|
|
|
<div class="system-title">backup configurations</div>
|
|
|
|
|
<nz-data-list
|
|
|
|
|
ref="dataList"
|
|
|
|
|
id="modelTable"
|
|
|
|
|
:data="tableData"
|
|
|
|
|
border
|
|
|
|
|
from="backups"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot="slotProps">
|
|
|
|
|
<backups-table
|
2022-04-08 16:39:36 +08:00
|
|
|
ref="backupsTable1"
|
2022-04-08 14:09:56 +08:00
|
|
|
:custom-table-title="customTableTitle"
|
|
|
|
|
:is-configurations="true"
|
|
|
|
|
:is-state ='isState'
|
|
|
|
|
@edit="edit"
|
|
|
|
|
>
|
|
|
|
|
</backups-table>
|
|
|
|
|
</template>
|
|
|
|
|
</nz-data-list>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="system-config-form">
|
|
|
|
|
<div class="system-title">Recent backup</div>
|
|
|
|
|
<nz-data-list
|
|
|
|
|
ref="dataList"
|
|
|
|
|
id="modelTable"
|
|
|
|
|
:data="tableData2"
|
|
|
|
|
border
|
|
|
|
|
from="backups"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot="slotProps">
|
|
|
|
|
<backups-table
|
2022-04-08 16:39:36 +08:00
|
|
|
ref="backupsTable2"
|
2022-04-08 14:09:56 +08:00
|
|
|
:custom-table-title="customTableTitle2"
|
|
|
|
|
:is-configurations="false"
|
|
|
|
|
>
|
|
|
|
|
</backups-table>
|
|
|
|
|
</template>
|
|
|
|
|
</nz-data-list>
|
|
|
|
|
</div>
|
|
|
|
|
<transition name="right-box">
|
|
|
|
|
<backups-box v-if="rightBoxshow" :obj="object" @close="closeRightBox" @statechange='statechange'></backups-box>
|
|
|
|
|
</transition>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-04-08 15:05:10 +08:00
|
|
|
import nzDataList from '@/components/common/table/nzDataList'
|
|
|
|
|
import backupsTable from '@/components/common/table/settings/backupsTable'
|
2022-04-08 14:09:56 +08:00
|
|
|
import backupsBox from '@/components/common/rightBox/administration/backupsBox'
|
|
|
|
|
|
|
|
|
|
export default {
|
2022-04-08 15:05:10 +08:00
|
|
|
name: 'backups',
|
2022-04-08 14:09:56 +08:00
|
|
|
mixins: [],
|
2022-04-08 15:05:10 +08:00
|
|
|
props: [''],
|
|
|
|
|
data () {
|
2022-04-08 14:09:56 +08:00
|
|
|
return {
|
2022-04-08 15:05:10 +08:00
|
|
|
|
|
|
|
|
url: '/sys/backup/list',
|
2022-04-08 14:09:56 +08:00
|
|
|
customTableTitle: [
|
2022-04-08 15:05:10 +08:00
|
|
|
{ label: 'Frequency', prop: 'repeat' },
|
|
|
|
|
{ label: 'Backup Retention', prop: 'retention' },
|
|
|
|
|
{ label: 'Last backup at', prop: 'last' },
|
|
|
|
|
{ label: 'Enable', prop: 'state' }
|
2022-04-08 14:09:56 +08:00
|
|
|
],
|
|
|
|
|
customTableTitle2: [
|
2022-04-08 15:05:10 +08:00
|
|
|
{ label: 'Date', prop: 'time' },
|
|
|
|
|
{ label: 'File', prop: 'fileName' },
|
|
|
|
|
{ label: 'Size', prop: 'size' },
|
|
|
|
|
{ label: 'Description', prop: 'Description' }
|
2022-04-08 14:09:56 +08:00
|
|
|
],
|
|
|
|
|
tableData: [
|
|
|
|
|
{
|
2022-04-08 15:05:10 +08:00
|
|
|
retention: '',
|
|
|
|
|
state: '',
|
|
|
|
|
schedule: {}
|
|
|
|
|
}
|
2022-04-08 14:09:56 +08:00
|
|
|
],
|
|
|
|
|
tableData2: [
|
|
|
|
|
{
|
2022-04-08 15:05:10 +08:00
|
|
|
list: {}
|
|
|
|
|
}
|
2022-04-08 14:09:56 +08:00
|
|
|
],
|
2022-04-08 15:05:10 +08:00
|
|
|
rightBoxshow: false,
|
|
|
|
|
isState: '',
|
|
|
|
|
isRefresh: ''
|
|
|
|
|
}
|
2022-04-08 14:09:56 +08:00
|
|
|
},
|
|
|
|
|
|
2022-04-08 15:05:10 +08:00
|
|
|
components: { nzDataList, backupsTable, backupsBox },
|
2022-04-08 14:09:56 +08:00
|
|
|
|
|
|
|
|
computed: {},
|
|
|
|
|
|
2022-04-08 15:05:10 +08:00
|
|
|
created () {},
|
2022-04-08 14:09:56 +08:00
|
|
|
|
2022-04-08 15:05:10 +08:00
|
|
|
mounted () {},
|
2022-04-08 14:09:56 +08:00
|
|
|
|
|
|
|
|
methods: {
|
2022-04-08 15:05:10 +08:00
|
|
|
edit (row) {
|
|
|
|
|
this.object = { ...row }
|
|
|
|
|
this.object.name = 'Edit backup configurations'
|
|
|
|
|
if (this.object.schedule) {
|
|
|
|
|
for (const i in this.object.schedule) {
|
|
|
|
|
this.object[i] = this.object.schedule[i]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.rightBoxshow = true
|
|
|
|
|
},
|
|
|
|
|
closeRightBox (refresh) {
|
|
|
|
|
if (refresh) {
|
2022-04-08 16:39:36 +08:00
|
|
|
this.$refs.backupsTable1.getTableData('backupsTable1')
|
2022-04-08 14:09:56 +08:00
|
|
|
}
|
2022-04-08 15:05:10 +08:00
|
|
|
this.rightBoxshow = false
|
|
|
|
|
},
|
|
|
|
|
statechange (Boolean) {
|
|
|
|
|
this.isState = Boolean
|
|
|
|
|
}
|
2022-04-08 14:09:56 +08:00
|
|
|
},
|
|
|
|
|
|
2022-04-08 15:05:10 +08:00
|
|
|
watch: {}
|
|
|
|
|
}
|
|
|
|
|
</script>
|