2022-04-08 14:09:56 +08:00
|
|
|
<template>
|
2022-05-26 16:32:20 +08:00
|
|
|
<div class="system backup">
|
2022-04-08 18:02:57 +08:00
|
|
|
<div class="system-config-form system-config-backup">
|
2022-04-12 15:03:33 +08:00
|
|
|
<div class="system-title">{{ $t("backup.configurations") }}</div>
|
2022-04-08 14:09:56 +08:00
|
|
|
<nz-data-list
|
|
|
|
|
ref="dataList"
|
|
|
|
|
id="modelTable"
|
|
|
|
|
:data="tableData"
|
|
|
|
|
border
|
|
|
|
|
from="backups"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot="slotProps">
|
|
|
|
|
<backups-table
|
2022-04-12 15:03:33 +08:00
|
|
|
ref="backupsTable1"
|
2022-04-08 14:09:56 +08:00
|
|
|
:custom-table-title="customTableTitle"
|
|
|
|
|
:is-configurations="true"
|
2022-04-11 16:01:36 +08:00
|
|
|
:table-data="tableData"
|
2022-04-12 14:34:55 +08:00
|
|
|
@edit="edit"
|
2022-04-08 14:09:56 +08:00
|
|
|
>
|
|
|
|
|
</backups-table>
|
|
|
|
|
</template>
|
|
|
|
|
</nz-data-list>
|
|
|
|
|
</div>
|
|
|
|
|
|
2022-04-08 18:02:57 +08:00
|
|
|
<div class="system-config-form system-config-backup">
|
2022-04-12 15:03:33 +08:00
|
|
|
<div class="system-title">{{ $t("backup.recent") }}</div>
|
2022-04-08 14:09:56 +08:00
|
|
|
<nz-data-list
|
|
|
|
|
ref="dataList"
|
|
|
|
|
id="modelTable"
|
|
|
|
|
:data="tableData2"
|
|
|
|
|
border
|
|
|
|
|
from="backups"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot="slotProps">
|
|
|
|
|
<backups-table
|
2022-04-12 15:03:33 +08:00
|
|
|
ref="backupsTable2"
|
2022-04-08 14:09:56 +08:00
|
|
|
:custom-table-title="customTableTitle2"
|
|
|
|
|
:is-configurations="false"
|
2022-04-11 16:01:36 +08:00
|
|
|
key="backups2"
|
|
|
|
|
:table-data2="tableData2"
|
2022-04-12 14:34:55 +08:00
|
|
|
@getTableData="getTableData"
|
2022-04-08 14:09:56 +08:00
|
|
|
>
|
|
|
|
|
</backups-table>
|
|
|
|
|
</template>
|
|
|
|
|
</nz-data-list>
|
|
|
|
|
</div>
|
|
|
|
|
<transition name="right-box">
|
2022-04-12 15:03:33 +08:00
|
|
|
<backups-box
|
|
|
|
|
v-if="rightBoxshow"
|
|
|
|
|
:obj="object"
|
|
|
|
|
@close="closeRightBox"
|
|
|
|
|
class="backup_box"
|
|
|
|
|
></backups-box>
|
2022-04-08 14:09:56 +08:00
|
|
|
</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'
|
2022-06-10 10:48:48 +08:00
|
|
|
import bus from '@/libs/bus'
|
2022-04-08 14:09:56 +08:00
|
|
|
|
|
|
|
|
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
|
|
|
|
2022-04-12 14:34:55 +08:00
|
|
|
url: '/sys/backup',
|
2022-04-08 14:09:56 +08:00
|
|
|
customTableTitle: [
|
2022-05-30 09:18:13 +08:00
|
|
|
{ label: this.$t('backup.schedule'), prop: 'schedule' },
|
|
|
|
|
{ label: this.$t('backup.backupRetention'), prop: 'retention' },
|
2022-06-16 15:58:17 +08:00
|
|
|
{ label: this.$t('asset.talon.enable'), prop: 'state' }
|
2022-04-08 14:09:56 +08:00
|
|
|
],
|
|
|
|
|
customTableTitle2: [
|
2022-06-16 15:58:17 +08:00
|
|
|
{ label: this.$t('config.assetLabel.date'), prop: 'time', minwidth: 228 },
|
2022-05-30 09:18:13 +08:00
|
|
|
{ label: this.$t('backup.File'), prop: 'fileName', minwidth: 363 },
|
|
|
|
|
{ label: this.$t('backup.size'), prop: 'size', minwidth: 306 },
|
2022-06-16 15:58:17 +08:00
|
|
|
{ label: this.$t('overall.remark'), prop: 'Description', minwidth: 569 }
|
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 18:51:13 +08:00
|
|
|
list: {
|
2022-04-11 12:29:50 +08:00
|
|
|
|
2022-04-08 18:51:13 +08:00
|
|
|
}
|
2022-04-08 15:05:10 +08:00
|
|
|
}
|
2022-04-08 14:09:56 +08:00
|
|
|
],
|
2022-04-08 15:05:10 +08:00
|
|
|
rightBoxshow: false,
|
|
|
|
|
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-11 16:01:36 +08:00
|
|
|
mounted () {
|
2022-04-11 17:24:10 +08:00
|
|
|
this.getTableData()
|
2022-06-10 10:48:48 +08:00
|
|
|
bus.$on('backupNow', () => {
|
|
|
|
|
this.getTableData()
|
|
|
|
|
})
|
2022-04-11 16:01:36 +08:00
|
|
|
},
|
2022-04-08 14:09:56 +08:00
|
|
|
|
|
|
|
|
methods: {
|
2022-04-11 17:24:10 +08:00
|
|
|
|
|
|
|
|
getTableData (item) {
|
|
|
|
|
if (!item) {
|
|
|
|
|
this.$get('/sys/backup').then((res) => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
if (res.data) {
|
|
|
|
|
this.tableData[0].retention = res.data.retention
|
|
|
|
|
this.tableData[0].state = res.data.state == 1
|
|
|
|
|
for (const i in res.data.schedule) {
|
|
|
|
|
this.tableData[0].schedule[i] = res.data.schedule[i]
|
2022-04-11 16:01:36 +08:00
|
|
|
}
|
2022-04-11 17:24:10 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
2022-06-10 10:48:48 +08:00
|
|
|
this.$get('/sys/backup/list').then((res) => {
|
2022-04-11 17:24:10 +08:00
|
|
|
if (res.code === 200) {
|
|
|
|
|
if (res.data) {
|
|
|
|
|
this.tableData2 = res.data
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else if (item == 'backup') {
|
|
|
|
|
this.$get('/sys/backup').then((res) => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
if (res.data) {
|
|
|
|
|
this.tableData[0].retention = res.data.retention
|
|
|
|
|
this.tableData[0].state = res.data.state == 1
|
|
|
|
|
for (const i in res.data.schedule) {
|
|
|
|
|
this.tableData[0].schedule[i] = res.data.schedule[i]
|
2022-04-11 16:01:36 +08:00
|
|
|
}
|
2022-04-11 17:24:10 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
2022-04-12 15:03:33 +08:00
|
|
|
|
2022-06-10 10:48:48 +08:00
|
|
|
this.$get('/sys/backup/list').then((res) => {
|
2022-04-12 15:03:33 +08:00
|
|
|
if (res.code === 200) {
|
|
|
|
|
if (res.data) {
|
|
|
|
|
this.tableData2 = res.data
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
2022-04-11 17:24:10 +08:00
|
|
|
} else if (item == 'recent') {
|
2022-06-10 10:48:48 +08:00
|
|
|
this.$get('/sys/backup/list').then((res) => {
|
2022-04-11 17:24:10 +08:00
|
|
|
if (res.code === 200) {
|
|
|
|
|
if (res.data) {
|
|
|
|
|
this.tableData2 = res.data
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
2022-04-11 16:01:36 +08:00
|
|
|
},
|
2022-04-08 15:05:10 +08:00
|
|
|
edit (row) {
|
2022-04-11 17:24:10 +08:00
|
|
|
this.object = {
|
|
|
|
|
...row,
|
|
|
|
|
checkDay: '',
|
|
|
|
|
checkDays: '',
|
|
|
|
|
datepicker: ''
|
2022-04-08 18:51:13 +08:00
|
|
|
}
|
2022-04-08 18:02:57 +08:00
|
|
|
this.object.name = this.$t('backup.edit')
|
2022-04-08 15:05:10 +08:00
|
|
|
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-11 16:01:36 +08:00
|
|
|
this.getTableData('backup')
|
2022-04-08 14:09:56 +08:00
|
|
|
}
|
2022-04-08 15:05:10 +08:00
|
|
|
this.rightBoxshow = false
|
2022-04-11 17:24:10 +08:00
|
|
|
}
|
2022-04-08 14:09:56 +08:00
|
|
|
},
|
|
|
|
|
|
2022-04-08 15:05:10 +08:00
|
|
|
watch: {}
|
|
|
|
|
}
|
|
|
|
|
</script>
|