Merge pull request #77 from Zyy955/master

独立`椰奶状态`背景api,防止api失效时无法渲染
This commit is contained in:
曉K
2023-10-07 00:38:40 +08:00
committed by GitHub
4 changed files with 11 additions and 2 deletions

View File

@@ -60,7 +60,8 @@ export class NewState extends plugin {
// 网络测试
let psTest = []
let { psTestSites, psTestTimeout } = Config.state
let { psTestSites, psTestTimeout, backdrop } = Config.state
State.chartData.backdrop = backdrop
psTestSites && promiseTaskList.push(...psTestSites?.map(i => State.getNetworkLatency(i.url, psTestTimeout).then(res => psTest.push({
first: i.name,
tail: res

View File

@@ -16,3 +16,6 @@ statusTask: true
#如果出现内存异常的情况可将此配置项开启,如果打开后报错请将监控任务关闭
statusPowerShellStart: false
# 背景图片api "https://t.mwm.moe/mp/"
backdrop: "https://t.mwm.moe/mp/"

View File

@@ -11,7 +11,6 @@
}
.container {
background-image: url("https://t.mwm.moe/mp/");
background-color: white;
background-position: center top;
background-repeat: no-repeat;

View File

@@ -66,6 +66,12 @@
const chart = echarts.init(document.getElementById('Chart'), 'westeros', {
renderer: 'svg'
})
const backdrop = chartData.backdrop
// 背景api
if (backdrop) {
var container = document.getElementById('container')
container.style.backgroundImage = 'url(' + backdrop + ')'
}
const by = (value) => {
value = value?.value ?? value
let units = ['B', 'KB', 'MB', 'GB', 'TB'] // 定义单位数组