Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_web
This commit is contained in:
commit
2b4ccc1e5e
|
@ -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/`);
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
@ -2,87 +2,66 @@
|
|||
<el-container>
|
||||
<el-main>
|
||||
<el-row :gutter="4">
|
||||
<el-col :md="8" :sm="24">
|
||||
<el-col :md="5" :sm="24">
|
||||
<el-card header="CPU" v-loading="loading">
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="物理核心数">{{
|
||||
cpuData.count
|
||||
}}</el-descriptions-item>
|
||||
cpuData.count
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="逻辑核心数">{{
|
||||
cpuData.lcount
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="当前使用率"
|
||||
>{{ cpuData.percent }}%</el-descriptions-item
|
||||
>
|
||||
cpuData.lcount
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="当前使用率">{{ cpuData.percent }}%</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :md="8" :sm="24">
|
||||
<el-col :md="5" :sm="24">
|
||||
<el-card header="内存" v-loading="loading">
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="总内存"
|
||||
>{{ 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.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>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :md="8" :sm="24">
|
||||
<el-col :md="5" :sm="24">
|
||||
<el-card header="硬盘" v-loading="loading">
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="总大小"
|
||||
>{{ 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="总大小">{{ 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>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :md="9" :sm="24">
|
||||
<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-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>
|
||||
<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>
|
||||
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue