This commit is contained in:
ann 2023-06-29 16:59:38 +08:00
parent 5824e80b6b
commit 4937641f43
7 changed files with 47 additions and 25 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 KiB

View File

@ -113,7 +113,7 @@ export default {
this.radarChart.setOption(this.returnRadarChart([disk, memory, nodeCount, cpu]))
},
fontSize(rem) {
const scale = window.innerHeight / 1080
const scale = window.innerHeight / 900
return scale >= 1 ? 16 * rem : 14 * rem
},
returnRadarChart(data) {
@ -229,16 +229,19 @@ export default {
margin-top: 0.5vh;
}
span{
margin: 0.6rem 0;
margin: 0;
height: 2.4vh;
line-height: 3.4vh;
}
}
::v-deep {
.el-progress{
height: 2.4vh;
line-height: 2.4vh;
}
.el-progress-bar{
margin: 0.6rem 0;
margin: 1vh 0;
line-height: 2.5rem;
margin-right: -40px;
padding-right: 40px;

View File

@ -52,10 +52,11 @@ export default {
},
methods: {
fontSize(rem) {
// const scale = window.innerHeight / 1080
return 16 * rem
const scale = window.innerHeight / 900
return scale >= 1 ? 16 * rem : 12 * rem
},
drawLine() {
const scaleRate = window.innerHeight / 1080 >= 1
// domecharts
const chart = this.$echarts.init(this.$refs.echart)
var option
@ -73,13 +74,13 @@ export default {
show: false
},
backgroundColor: '#000033',
textStyle: { color: '#fff' },
textStyle: { fontSize: this.fontSize(0.7), color: '#fff' },
borderWidth: 0
},
grid: {
right: '5%',
bottom: '25%',
top: '15%',
top: scaleRate ? '15%' : '20%',
left: '13%'
},
xAxis: {
@ -96,10 +97,10 @@ export default {
interval: 28,
// rotate: -18,
// padding: [1, 0, 0, -10],
margin: 14,
margin: scaleRate ? 14 : 10,
textStyle: {
fontSize: this.fontSize(0.75),
lineHeight: 20,
lineHeight: scaleRate ? 20 : 10,
color: '#DDDDDD',
fontFamily: 'Source Han Sans CN'
},

View File

@ -93,11 +93,11 @@ export default {
},
methods: {
fontSize(rem) {
// const scale = window.innerHeight / 1080
return 16 * rem
const scale = window.innerHeight / 900
return scale >= 1 ? 16 * rem : 12 * rem
},
drawLine() {
// domecharts
const scaleRate = window.innerHeight / 900 >= 1
const chart = this.$echarts.init(this.$refs.echart)
var option
option = {
@ -116,7 +116,7 @@ export default {
show: false
},
backgroundColor: '#000033',
textStyle: { color: '#fff' },
textStyle: { fontSize: this.fontSize(0.7), color: '#fff' },
borderWidth: 0
},
legend: {
@ -132,7 +132,7 @@ export default {
grid: {
right: '1%',
bottom: '20%',
top: '15%',
top: scaleRate ? '15%' : '20%',
left: '15%'
},
xAxis: {
@ -148,11 +148,11 @@ export default {
interval: 0,
textStyle: {
fontSize: this.fontSize(0.75),
lineHeight: 20,
lineHeight: scaleRate ? 20 : 10,
color: 'rgba(221, 221, 221, 1)',
fontFamily: 'Source Han Sans CN'
},
margin: this.config.unit.length > 10 ? 35 : 8,
margin: scaleRate ? (this.config.unit.length > 10 ? 35 : 8) : 10,
formatter: function(params) {
var provideNumber = 4 //
return params.slice(0, provideNumber) + (params.length > provideNumber ? '...' : '')

View File

@ -33,8 +33,8 @@ export default {
},
methods: {
fontSize(rem) {
// const scale = window.innerHeight / 1080
return 16 * rem
const scale = window.innerHeight / 900
return scale >= 1 ? 16 * rem : 12 * rem
},
//
async getAllData() {
@ -71,6 +71,7 @@ export default {
},
// echart
initCharts() {
const scaleRate = window.innerHeight / 900 >= 1
const chart = echarts.init(this.$refs.myBarEchart)
//
const legend = ['CPU整体负载', '内存整体负载', 'CPU平均负载', '内存平均负载']
@ -80,7 +81,7 @@ export default {
right: '0',
itemWidth: 14,
data: legend,
itemHeight: 10,
itemHeight: scaleRate ? 10 : 2,
selectedMode: false, //
textStyle: {
color: '#FFFFFF',
@ -90,7 +91,7 @@ export default {
grid: {
right: '12%',
bottom: '16%',
top: '25%',
top: scaleRate ? '25%' : '30%',
left: '12%'
},
tooltip: {
@ -102,7 +103,7 @@ export default {
}
},
backgroundColor: '#000033',
textStyle: { color: '#fff' },
textStyle: { fontSize: this.fontSize(0.7), color: '#fff' },
borderWidth: 0,
formatter: (params) => {
let val = params[0].name
@ -121,10 +122,11 @@ export default {
},
axisLabel: {
textStyle: {
fontSize: this.fontSize(0.75),
color: 'rgba(221, 221, 221, 1)'
},
interval: 0,
margin: 14
margin: scaleRate ? 14 : 10
},
axisLine: {
lineStyle: {
@ -135,8 +137,15 @@ export default {
yAxis: [
{
name: '单位:核',
nameTextStyle: {
color: '#aaa',
// padding: [0, 10, 0, 0],
fontSize: this.fontSize(0.75),
nameLocation: 'start'
},
axisLabel: {
textStyle: {
fontSize: this.fontSize(0.75),
color: 'rgba(221, 221, 221, 1)'
},
formatter: '{value}'
@ -156,8 +165,15 @@ export default {
},
{
name: '单位GB',
nameTextStyle: {
color: '#aaa',
// padding: [0, 10, 0, 0],
fontSize: this.fontSize(0.75),
nameLocation: 'start'
},
axisLabel: {
textStyle: {
fontSize: this.fontSize(0.75),
color: 'rgba(221, 221, 221, 1)'
},
formatter: '{value}'

View File

@ -86,7 +86,7 @@ export default {
background-size: auto 100%;
text-align: right;
line-height: 7.5vh;
padding: 0 10px;
// padding: 0 10px;
}
}
.unUsed{

View File

@ -234,7 +234,7 @@ export default {
// },
resize() {
// 1080
const scale = window.innerHeight / 1080
const scale = window.innerHeight / 900
if (scale >= 1) {
document.documentElement.style.fontSize = `${16 * scale}px`
} else {
@ -618,7 +618,9 @@ export default {
padding-bottom: 4vh;
.createBtn{
height: 2.5vh;
line-height: 1vh;
line-height: 2.3vh;
margin: 0;
padding: 0 1rem;
font-size: 0.9rem;
position: absolute;
top: 0.5vh;