added ESlint 语法检测

This commit is contained in:
何秀钢
2021-06-02 14:11:45 +08:00
parent 3932a8fbf3
commit 2f0465a1a1
94 changed files with 5031 additions and 4790 deletions

View File

@@ -7,23 +7,23 @@
<div>
<el-row :gutter="10">
<el-col :span="12">os:</el-col>
<el-col :span="12" v-text="state.os.goos"></el-col>
<el-col :span="12" v-text="state.os.goos" />
</el-row>
<el-row :gutter="10">
<el-col :span="12">cpu nums:</el-col>
<el-col :span="12" v-text="state.os.numCpu"></el-col>
<el-col :span="12" v-text="state.os.numCpu" />
</el-row>
<el-row :gutter="10">
<el-col :span="12">compiler:</el-col>
<el-col :span="12" v-text="state.os.compiler"></el-col>
<el-col :span="12" v-text="state.os.compiler" />
</el-row>
<el-row :gutter="10">
<el-col :span="12">go version:</el-col>
<el-col :span="12" v-text="state.os.goVersion"></el-col>
<el-col :span="12" v-text="state.os.goVersion" />
</el-row>
<el-row :gutter="10">
<el-col :span="12">goroutine nums:</el-col>
<el-col :span="12" v-text="state.os.numGoroutine"></el-col>
<el-col :span="12" v-text="state.os.numGoroutine" />
</el-row>
</div>
</el-card>
@@ -36,19 +36,19 @@
<el-col :span="12">
<el-row :gutter="10">
<el-col :span="12">total (MB)</el-col>
<el-col :span="12" v-text="state.disk.totalMb"></el-col>
<el-col :span="12" v-text="state.disk.totalMb" />
</el-row>
<el-row :gutter="10">
<el-col :span="12">used (MB)</el-col>
<el-col :span="12" v-text="state.disk.usedMb"></el-col>
<el-col :span="12" v-text="state.disk.usedMb" />
</el-row>
<el-row :gutter="10">
<el-col :span="12">total (GB)</el-col>
<el-col :span="12" v-text="state.disk.totalGb"></el-col>
<el-col :span="12" v-text="state.disk.totalGb" />
</el-row>
<el-row :gutter="10">
<el-col :span="12">used (GB)</el-col>
<el-col :span="12" v-text="state.disk.usedGb"></el-col>
<el-col :span="12" v-text="state.disk.usedGb" />
</el-row>
</el-col>
<el-col :span="12">
@@ -56,7 +56,7 @@
type="dashboard"
:percentage="state.disk.usedPercent"
:color="colors"
></el-progress>
/>
</el-col>
</el-row>
</div>
@@ -66,55 +66,55 @@
<el-row :gutter="15" class="system_state">
<el-col :span="12">
<el-card
class="card_item"
v-if="state.cpu"
class="card_item"
:body-style="{ height: '180px', 'overflow-y': 'scroll' }"
>
<div slot="header">CPU</div>
<div>
<el-row :gutter="10">
<el-col :span="12">physical number of cores:</el-col>
<el-col :span="12" v-text="state.cpu.cores"> </el-col>
<el-col :span="12" v-text="state.cpu.cores" />
</el-row>
<template v-for="(item, index) in state.cpu.cpus">
<el-row :key="index" :gutter="10">
<el-col :span="12">core {{ index }}:</el-col>
<el-col :span="12"
><el-progress
type="line"
:percentage="+item.toFixed(0)"
:color="colors"
></el-progress
></el-col>
<el-col
:span="12"
><el-progress
type="line"
:percentage="+item.toFixed(0)"
:color="colors"
/></el-col>
</el-row>
</template>
</div>
</el-card>
</el-col>
<el-col :span="12">
<el-card class="card_item" v-if="state.ram">
<el-card v-if="state.ram" class="card_item">
<div slot="header">Ram</div>
<div>
<el-row :gutter="10">
<el-col :span="12">
<el-row :gutter="10">
<el-col :span="12">total (MB)</el-col>
<el-col :span="12" v-text="state.ram.totalMb"></el-col>
<el-col :span="12" v-text="state.ram.totalMb" />
</el-row>
<el-row :gutter="10">
<el-col :span="12">used (MB)</el-col>
<el-col :span="12" v-text="state.ram.usedMb"></el-col>
<el-col :span="12" v-text="state.ram.usedMb" />
</el-row>
<el-row :gutter="10">
<el-col :span="12">total (GB)</el-col>
<el-col :span="12" v-text="state.ram.totalMb / 1024"></el-col>
<el-col :span="12" v-text="state.ram.totalMb / 1024" />
</el-row>
<el-row :gutter="10">
<el-col :span="12">used (GB)</el-col>
<el-col
:span="12"
v-text="(state.ram.usedMb / 1024).toFixed(2)"
></el-col>
/>
</el-row>
</el-col>
<el-col :span="12">
@@ -122,7 +122,7 @@
type="dashboard"
:percentage="state.ram.usedPercent"
:color="colors"
></el-progress>
/>
</el-col>
</el-row>
</div>
@@ -133,37 +133,37 @@
</template>
<script>
import { getSystemState } from "@/api/system.js";
import { getSystemState } from '@/api/system'
export default {
name: "State",
name: 'State',
data() {
return {
timer:null,
timer: null,
state: {},
colors: [
{ color: "#5cb87a", percentage: 20 },
{ color: "#e6a23c", percentage: 40 },
{ color: "#f56c6c", percentage: 80 },
],
};
{ color: '#5cb87a', percentage: 20 },
{ color: '#e6a23c', percentage: 40 },
{ color: '#f56c6c', percentage: 80 }
]
}
},
created() {
this.reload();
created() {
this.reload()
this.timer = setInterval(() => {
this.reload();
}, 1000*10);
this.reload()
}, 1000 * 10)
},
beforeDestroy(){
beforeDestroy() {
clearInterval(this.timer)
this.timer = null
},
methods: {
async reload() {
const { data } = await getSystemState();
this.state = data.server;
},
},
};
const { data } = await getSystemState()
this.state = data.server
}
}
}
</script>
<style>