Przeglądaj źródła

修改首页样式

yangg 8 miesięcy temu
rodzic
commit
7995358998

Plik diff jest za duży
+ 0 - 0
dist/index.html


+ 0 - 0
dist/static/css/chunk-e355d7b2.775a21e3.css → dist/static/css/chunk-4c2b6424.775a21e3.css


Plik diff jest za duży
+ 0 - 0
dist/static/css/chunk-4c5b4d86.9280a829.css


Plik diff jest za duży
+ 0 - 0
dist/static/js/app.0e11efae.js


Plik diff jest za duży
+ 1 - 1
dist/static/js/chunk-4c2b6424.fa10b857.js


Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-4c5b4d86.beb6a4a6.js


Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-6ff59d76.07eae7d9.js


+ 0 - 0
dist/static/js/chunk-cbf68ff6.82b0e925.js → dist/static/js/chunk-cbf68ff6.53b06e0d.js


Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-d2ba16aa.ce2fc027.js


+ 2 - 2
src/views/dashboard/admin/components/LineChart.vue

@@ -263,7 +263,7 @@ export default {
         // 创建第一条线(expected)
         this.series1 = this.chart.series.push(
           am5xy.SmoothedXLineSeries.new(root, {
-            name: "GPU",
+            name: "CPU",
             xAxis: this.xAxis,
             yAxis: yAxis,
             valueYField: "value",
@@ -280,7 +280,7 @@ export default {
         // 创建第二条线(actual)
         this.series2 = this.chart.series.push(
           am5xy.SmoothedXLineSeries.new(root, {
-            name: "CPU",
+            name: "GPU",
             xAxis: this.xAxis,
             yAxis: yAxis,
             valueYField: "value",

+ 2 - 2
src/views/dashboard/admin/components/instruChart.vue

@@ -319,9 +319,9 @@
           // Create center label
           this.centerLabel = am5.Label.new(this.root, {
             textAlign: "center",
-            centerY: am5.p45,
+            centerY: am5.p50,
             centerX: am5.p50,
-            y: am5.percent(-35), // 负值会使文字向上移动
+          /*   y: am5.percent(-35), // 负值会使文字向上移动 */
             text: "[fontSize:24px]0%[/]\n[fontSize:14px]Compiled Ticket[/]",
           });
   

+ 31 - 21
src/views/dashboard/admin/index.vue

@@ -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() {

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików