From 7c430df9bbf59b3c7e4d4ebb252856dfbf462eee Mon Sep 17 00:00:00 2001 From: lxb <1580622474@qq.com> Date: Mon, 10 Feb 2025 19:10:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=AC=E5=91=8A=E7=9A=84?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server_config.json | 4 ++-- web/css/style_1.css | 10 ++++++++++ web/js/script.js | 21 ++++++++++++++++----- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/server_config.json b/server_config.json index b7285a3..a5b08f7 100644 --- a/server_config.json +++ b/server_config.json @@ -3,7 +3,7 @@ "port": 15002, "server_list":["76", "174", "233", "222"], "note_dict":{ - "174": "test note" + "76": "目前该服务器gpu的信息获取有问题,还不清楚是什么情况。大概三月份之后有空再修一下。" }, "api_name": "api" -} \ No newline at end of file +} diff --git a/web/css/style_1.css b/web/css/style_1.css index 4a37211..0b90a43 100644 --- a/web/css/style_1.css +++ b/web/css/style_1.css @@ -21,6 +21,16 @@ margin: 12px; } +.note-info { + border-style: solid; + border-width: 4px; + border-color: #a10000; + border-radius: 8px; + padding: 6px 10px; + margin-top: 4px; + margin-bottom: 6px; +} + .server-name { background-color: rgb(0, 0, 0); color: white; diff --git a/web/js/script.js b/web/js/script.js index a5e76d5..0a94370 100644 --- a/web/js/script.js +++ b/web/js/script.js @@ -113,6 +113,16 @@ function displayServerData(data){ serverName.textContent = serverTitle + " - Not update -"; } + // 添加公告 + if ('note' in serverData && serverData['note'] != ''){ + let noteInfo = document.createElement('div'); + noteInfo.className = 'note-info'; + + noteInfo.innerHTML = '