feat: base 添加celery和redis的状态信息
This commit is contained in:
parent
b0a0529abd
commit
c3898769e5
|
@ -56,5 +56,21 @@ export default {
|
||||||
return await http.get(`${config.API_URL}/monitor/server/`);
|
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/`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-main>
|
<el-main>
|
||||||
<el-row :gutter="4">
|
<el-row :gutter="4">
|
||||||
<el-col :md="8" :sm="24">
|
<el-col :md="5" :sm="24">
|
||||||
<el-card header="CPU" v-loading="loading">
|
<el-card header="CPU" v-loading="loading">
|
||||||
<el-descriptions :column="1" border>
|
<el-descriptions :column="1" border>
|
||||||
<el-descriptions-item label="物理核心数">{{
|
<el-descriptions-item label="物理核心数">{{
|
||||||
|
@ -11,70 +11,49 @@
|
||||||
<el-descriptions-item label="逻辑核心数">{{
|
<el-descriptions-item label="逻辑核心数">{{
|
||||||
cpuData.lcount
|
cpuData.lcount
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="当前使用率"
|
<el-descriptions-item label="当前使用率">{{ cpuData.percent }}%</el-descriptions-item>
|
||||||
>{{ cpuData.percent }}%</el-descriptions-item
|
|
||||||
>
|
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="8" :sm="24">
|
<el-col :md="5" :sm="24">
|
||||||
<el-card header="内存" v-loading="loading">
|
<el-card header="内存" v-loading="loading">
|
||||||
<el-descriptions :column="1" border>
|
<el-descriptions :column="1" border>
|
||||||
<el-descriptions-item label="总内存"
|
<el-descriptions-item label="总内存">{{ memoryData.total }}GB</el-descriptions-item>
|
||||||
>{{ memoryData.total }}GB</el-descriptions-item
|
<el-descriptions-item label="已用内存">{{ memoryData.used }}GB</el-descriptions-item>
|
||||||
>
|
<el-descriptions-item label="当前使用率">{{ memoryData.percent }}%</el-descriptions-item>
|
||||||
<el-descriptions-item label="已用内存"
|
|
||||||
>{{ memoryData.used }}GB</el-descriptions-item
|
|
||||||
>
|
|
||||||
<el-descriptions-item label="当前使用率"
|
|
||||||
>{{ memoryData.percent }}%</el-descriptions-item
|
|
||||||
>
|
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="8" :sm="24">
|
<el-col :md="5" :sm="24">
|
||||||
<el-card header="硬盘" v-loading="loading">
|
<el-card header="硬盘" v-loading="loading">
|
||||||
<el-descriptions :column="1" border>
|
<el-descriptions :column="1" border>
|
||||||
<el-descriptions-item label="总大小"
|
<el-descriptions-item label="总大小">{{ diskData.total }}GB</el-descriptions-item>
|
||||||
>{{ diskData.total }}GB</el-descriptions-item
|
<el-descriptions-item label="已用大小">{{ diskData.used }}GB</el-descriptions-item>
|
||||||
>
|
<el-descriptions-item label="当前使用率">{{ diskData.percent }}%</el-descriptions-item>
|
||||||
<el-descriptions-item label="已用大小"
|
</el-descriptions>
|
||||||
>{{ diskData.used }}GB</el-descriptions-item
|
</el-card>
|
||||||
>
|
</el-col>
|
||||||
<el-descriptions-item label="当前使用率"
|
<el-col :md="9" :sm="24">
|
||||||
>{{ diskData.percent }}%</el-descriptions-item
|
<el-card header="Celery&Redis" v-loading="loading">
|
||||||
>
|
<el-descriptions :column="2" border>
|
||||||
|
<el-descriptions-item label="注册任务数">{{ celeryData.count_registered_task }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="Redis内存使用">{{ redisData.used_memory_human }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="正执行数">{{ celeryData.count_active_task }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="Redis峰值使用">{{ redisData.used_memory_peak_human }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="计划执行数">{{ celeryData.count_scheduled_task }}</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-card>
|
<el-card>
|
||||||
<scTable
|
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe highlightCurrentRow hidePagination
|
||||||
ref="table"
|
@resetQuery="resetQuery">
|
||||||
: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="#" type="index" width="50"></el-table-column>
|
||||||
<el-table-column
|
<el-table-column label="文件地址" prop="filepath" min-width="200"></el-table-column>
|
||||||
label="文件地址"
|
<el-table-column label="大小(MB)" prop="size" min-width="150"></el-table-column>
|
||||||
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">
|
<el-table-column label="操作" align="center" width="80">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-popconfirm
|
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
|
||||||
title="确定删除吗?"
|
|
||||||
@confirm="table_del(scope.row, scope.$index)"
|
|
||||||
>
|
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button type="danger" size="small">删除</el-button>
|
<el-button type="danger" size="small">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
@ -94,14 +73,28 @@ export default {
|
||||||
cpuData: {},
|
cpuData: {},
|
||||||
diskData: {},
|
diskData: {},
|
||||||
memoryData: {},
|
memoryData: {},
|
||||||
|
celeryData: {},
|
||||||
|
redisData: {},
|
||||||
apiObj: this.$API.ops.dbbackup.list,
|
apiObj: this.$API.ops.dbbackup.list,
|
||||||
query: {},
|
query: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.serverInfo();
|
this.serverInfo();
|
||||||
|
this.celeryInfo();
|
||||||
|
this.redisInfo();
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
serverInfo() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.$API.ops.server.info
|
this.$API.ops.server.info
|
||||||
|
|
Loading…
Reference in New Issue