diff --git a/apps/state.js b/apps/state.js index c88156c..e1c5910 100644 --- a/apps/state.js +++ b/apps/state.js @@ -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 diff --git a/config/default_config/state.yaml b/config/default_config/state.yaml index e12785d..6af84be 100644 --- a/config/default_config/state.yaml +++ b/config/default_config/state.yaml @@ -16,3 +16,6 @@ statusTask: true #如果出现内存异常的情况可将此配置项开启,如果打开后报错请将监控任务关闭 statusPowerShellStart: false + +# 背景图片api "https://t.mwm.moe/mp/" +backdrop: "https://t.mwm.moe/mp/" \ No newline at end of file diff --git a/resources/state/state.css b/resources/state/state.css index 62fdf11..3607085 100644 --- a/resources/state/state.css +++ b/resources/state/state.css @@ -11,7 +11,6 @@ } .container { - background-image: url("https://t.mwm.moe/mp/"); background-color: white; background-position: center top; background-repeat: no-repeat; diff --git a/resources/state/state.html b/resources/state/state.html index 269fe53..70ca221 100644 --- a/resources/state/state.html +++ b/resources/state/state.html @@ -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'] // 定义单位数组