|
@@ -4,15 +4,15 @@
|
|
|
|
|
|
<!-- <panel-group @handleSetLineChartData="handleSetLineChartData" />-->
|
|
|
<el-row :gutter="20">
|
|
|
- <!-- <el-col :span="8">
|
|
|
+ <el-col :span="8">
|
|
|
<el-card class="box-card">
|
|
|
<div slot="header" class="clearfixs">
|
|
|
- <span></span>
|
|
|
+ <span>cpu使用率</span>
|
|
|
</div>
|
|
|
- <instruChart style="height: 150px" :percentage="currentPercentage"/>
|
|
|
+ <instruChart style="height: 350px" :percentage="currentPercentage" />
|
|
|
</el-card>
|
|
|
- </el-col> -->
|
|
|
- <el-col style="margin-bottom: 20px;" :span="24">
|
|
|
+ </el-col>
|
|
|
+ <el-col style="margin-bottom: 20px" :span="16">
|
|
|
<el-card class="box-card">
|
|
|
<div slot="header" class="clearfixs">
|
|
|
<span>GPU使用率</span>
|
|
@@ -88,9 +88,14 @@ import TodoList from "./components/TodoList";
|
|
|
import BoxCard from "./components/BoxCard";
|
|
|
import TagCloud from "./components/tagCloud.vue";
|
|
|
import RecentFile from "./components/recentFile.vue";
|
|
|
-import instruChart from "./components/instruChart.vue"
|
|
|
-import { listBuckets, structure_count,GET_Rbq } from "@/api/knowledge";
|
|
|
-import { mapState } from 'vuex';
|
|
|
+import instruChart from "./components/instruChart.vue";
|
|
|
+import {
|
|
|
+ listBuckets,
|
|
|
+ structure_count,
|
|
|
+ GET_Rbq,
|
|
|
+ gpu_info,
|
|
|
+} from "@/api/knowledge";
|
|
|
+import { mapState } from "vuex";
|
|
|
|
|
|
const lineChartData = {
|
|
|
newVisitis: {
|
|
@@ -125,7 +130,7 @@ export default {
|
|
|
BoxCard,
|
|
|
TagCloud,
|
|
|
RecentFile,
|
|
|
- instruChart
|
|
|
+ instruChart,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -149,11 +154,11 @@ export default {
|
|
|
kenList: [],
|
|
|
kenValue: null,
|
|
|
kenVal: {},
|
|
|
- currentPercentage:11,
|
|
|
+ currentPercentage: 11,
|
|
|
refreshInterval: null,
|
|
|
isOnDashboard: false,
|
|
|
chartData: [
|
|
|
- /* { date: "00:00", value: 12 },
|
|
|
+ /* { date: "00:00", value: 12 },
|
|
|
{ date: "01:00", value: 14 },
|
|
|
{ date: "02:00", value: 8 },
|
|
|
{ date: "03:00", value: 15 },
|
|
@@ -175,26 +180,26 @@ export default {
|
|
|
{ date: "19:00", value: 8 },
|
|
|
{ date: "20:00", value: 10 },
|
|
|
{ date: "21:00", value: 11 } */
|
|
|
- ]
|
|
|
+ ],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState({
|
|
|
- route: state => state.tagsView.visitedViews
|
|
|
- })
|
|
|
+ route: (state) => state.tagsView.visitedViews,
|
|
|
+ }),
|
|
|
},
|
|
|
watch: {
|
|
|
$route: {
|
|
|
immediate: true,
|
|
|
handler(newRoute) {
|
|
|
- this.isOnDashboard = newRoute.path === '/dashboard';
|
|
|
+ this.isOnDashboard = newRoute.path === "/dashboard";
|
|
|
this.handleRouteChange();
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.init();
|
|
|
- /* this.startRefreshInterval(); */
|
|
|
+ /* this.startRefreshInterval(); */
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
this.stopRefreshInterval();
|
|
@@ -203,7 +208,7 @@ export default {
|
|
|
handleRouteChange() {
|
|
|
if (this.isOnDashboard) {
|
|
|
this.refreshData();
|
|
|
- }
|
|
|
+ }
|
|
|
},
|
|
|
/* 选择知识库 */
|
|
|
kenChange(val) {
|
|
@@ -233,9 +238,14 @@ export default {
|
|
|
this.kenVal = this.kenList[0];
|
|
|
}
|
|
|
});
|
|
|
- GET_Rbq().then(res=>{
|
|
|
+ GET_Rbq().then((res) => {
|
|
|
console.log(res);
|
|
|
- })
|
|
|
+ });
|
|
|
+ gpu_info().then((res) => {
|
|
|
+ const total = res.data.data.cpu.memory.total;
|
|
|
+ const used = res.data.data.cpu.memory.used;
|
|
|
+ this.currentPercentage = Number((used / total).toFixed(2));
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
init() {
|