diff --git a/nezha-fronted/src/assets/css/components/common/rightBox/backupsBox.scss b/nezha-fronted/src/assets/css/components/common/rightBox/backupsBox.scss index 19bbc09f6..2b407dd54 100644 --- a/nezha-fronted/src/assets/css/components/common/rightBox/backupsBox.scss +++ b/nezha-fronted/src/assets/css/components/common/rightBox/backupsBox.scss @@ -35,6 +35,16 @@ } } } + .check-month_box{ + .el-form-item__content{ + .el-checkbox-button{ + width: calc(100% / 7); + .el-checkbox-button__inner{ + width: 100%; + } + } + } + } .start_at{ .el-form-item__content{ .el-date-editor--date{ diff --git a/nezha-fronted/src/components/common/table/settings/backupsTable.vue b/nezha-fronted/src/components/common/table/settings/backupsTable.vue index 5967d3fba..0f913c4bd 100644 --- a/nezha-fronted/src/components/common/table/settings/backupsTable.vue +++ b/nezha-fronted/src/components/common/table/settings/backupsTable.vue @@ -126,42 +126,48 @@ export default { mounted () { this.getTableData() - this.monitoring() }, methods: { - monitoring () { - this.$on('getData', (res) => { - console.log('getdata') - this.getTableData() - this.$forceUpdate(); - // window.location.reload() - }) - }, - async getTableData () { - await 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 - this.switchStatus = res.data.state === 1 - for (const i in res.data.schedule) { - this.tableData[0].schedule[i] = res.data.schedule[i] - } - } + async getTableData (item) { + if(!item){ + await 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 + this.switchStatus = res.data.state === 1 + for (const i in res.data.schedule) { + this.tableData[0].schedule[i] = res.data.schedule[i] + } + } + } + }) + await post('/sys/backup/list').then((res) => { + if (res.code === 200) { + if (res.data) { + for (const i in res.data) { + this.tableData2[i].fileName = res.data[i].fileName + this.tableData2[i].size = bus.getNumStr(res.data[i].size) + this.tableData2[i].time = res.data[i].time + } + } + } + }) + }else{ + await 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 + this.switchStatus = res.data.state === 1 + for (const i in res.data.schedule) { + this.tableData[0].schedule[i] = res.data.schedule[i] + } + } + } + }) } - }) - await post('/sys/backup/list').then((res) => { - if (res.code === 200) { - if (res.data) { - for (const i in res.data) { - this.tableData2[i].fileName = res.data[i].fileName - this.tableData2[i].size = bus.getNumStr(res.data[i].size) - this.tableData2[i].time = res.data[i].time - } - } - } - }) }, backupNow (item) { post('/sys/backup').then((res) => { diff --git a/nezha-fronted/src/components/page/config/backups.vue b/nezha-fronted/src/components/page/config/backups.vue index e148e6699..469050f08 100644 --- a/nezha-fronted/src/components/page/config/backups.vue +++ b/nezha-fronted/src/components/page/config/backups.vue @@ -11,7 +11,7 @@ >