diff --git a/src/api/model/ops.js b/src/api/model/ops.js index e0f18460..acb77651 100644 --- a/src/api/model/ops.js +++ b/src/api/model/ops.js @@ -56,5 +56,21 @@ export default { return await http.get(`${config.API_URL}/monitor/server/`); } } - } + }, + celery: { + info: { + name: "celery状态", + req: async function(name){ + return await http.get(`${config.API_URL}/monitor/celery/`); + } + } + }, + redis: { + info: { + name: "redis状态", + req: async function(name){ + return await http.get(`${config.API_URL}/monitor/redis/`); + } + } + }, } diff --git a/src/views/ops/server.vue b/src/views/ops/server.vue index 0ae1334a..81c5e724 100644 --- a/src/views/ops/server.vue +++ b/src/views/ops/server.vue @@ -2,87 +2,66 @@ - + {{ - cpuData.count - }} + cpuData.count + }} {{ - cpuData.lcount - }} - {{ cpuData.percent }}% + cpuData.lcount + }} + {{ cpuData.percent }}% - + - {{ memoryData.total }}GB - {{ memoryData.used }}GB - {{ memoryData.percent }}% + {{ memoryData.total }}GB + {{ memoryData.used }}GB + {{ memoryData.percent }}% - + - {{ diskData.total }}GB - {{ diskData.used }}GB - {{ diskData.percent }}% + {{ diskData.total }}GB + {{ diskData.used }}GB + {{ diskData.percent }}% + + + + + + + {{ celeryData.count_registered_task }} + {{ redisData.used_memory_human }} + {{ celeryData.count_active_task }} + {{ redisData.used_memory_peak_human }} + {{ celeryData.count_scheduled_task }} - - - - - - - - - + + + + + + + + + @@ -94,14 +73,28 @@ export default { cpuData: {}, diskData: {}, memoryData: {}, + celeryData: {}, + redisData: {}, apiObj: this.$API.ops.dbbackup.list, query: {}, }; }, mounted() { this.serverInfo(); + this.celeryInfo(); + this.redisInfo(); }, methods: { + celeryInfo() { + this.$API.ops.celery.info.req().then(res => { + this.celeryData = res; + }) + }, + redisInfo() { + this.$API.ops.redis.info.req().then(res => { + this.redisData = res; + }) + }, serverInfo() { this.loading = true; this.$API.ops.server.info @@ -117,12 +110,12 @@ export default { }); }, resetQuery() { - this.query = {}; - }, - //删除 + this.query = {}; + }, + //删除 async table_del(row) { this.$API.ops.dbbackup.deletes - .req({filepaths: [row.filepath]}) + .req({ filepaths: [row.filepath] }) .then((res) => { this.$message.success("删除成功"); this.$refs.table.refresh();