ops增加数据库列表
This commit is contained in:
parent
6f22533bd2
commit
db68c140ca
|
@ -11,6 +11,22 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
dbbackup: {
|
||||
list: {
|
||||
url: `${config.API_URL}/monitor/dbbackup/`,
|
||||
name: "数据库备份",
|
||||
req: async function(data){
|
||||
return await http.get(this.url, data);
|
||||
}
|
||||
},
|
||||
deletes: {
|
||||
url: `${config.API_URL}/monitor/dbbackup/`,
|
||||
name: "数据库备份",
|
||||
req: async function(data){
|
||||
return await http.delete(this.url, data);
|
||||
}
|
||||
}
|
||||
},
|
||||
file_logs: {
|
||||
list: {
|
||||
url: `${config.API_URL}/monitor/log/`,
|
||||
|
|
|
@ -48,6 +48,41 @@
|
|||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-card>
|
||||
<scTable
|
||||
ref="table"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
stripe
|
||||
highlightCurrentRow
|
||||
hidePagination
|
||||
@resetQuery="resetQuery"
|
||||
>
|
||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||
<el-table-column
|
||||
label="文件地址"
|
||||
prop="filepath"
|
||||
min-width="200"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="大小(MB)"
|
||||
prop="size"
|
||||
min-width="150"
|
||||
></el-table-column>
|
||||
<el-table-column label="操作" align="center" width="80">
|
||||
<template #default="scope">
|
||||
<el-popconfirm
|
||||
title="确定删除吗?"
|
||||
@confirm="table_del(scope.row, scope.$index)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="danger" size="small">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-card>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
@ -59,6 +94,8 @@ export default {
|
|||
cpuData: {},
|
||||
diskData: {},
|
||||
memoryData: {},
|
||||
apiObj: this.$API.ops.dbbackup.list,
|
||||
query: {},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -79,6 +116,22 @@ export default {
|
|||
this.loading = false;
|
||||
});
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
//删除
|
||||
async table_del(row) {
|
||||
this.$API.ops.dbbackup.deletes
|
||||
.req({filepaths: [row.filepath]})
|
||||
.then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
this.$refs.table.refresh();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue