@baipiaodajun/mcbots 1.0.10 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server.js +50 -4
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -471,7 +471,7 @@ class StatusServer {
|
|
|
471
471
|
this.app.get('/', (req, res) => {
|
|
472
472
|
const serversStatus = Array.from(globalServerStatus.servers.values());
|
|
473
473
|
const systemInfo = systemMonitor.getSystemInfo();
|
|
474
|
-
|
|
474
|
+
const { version } = require('./package.json');
|
|
475
475
|
const html = `
|
|
476
476
|
<!DOCTYPE html>
|
|
477
477
|
<html lang="zh-CN">
|
|
@@ -721,7 +721,31 @@ class StatusServer {
|
|
|
721
721
|
opacity: 0.8;
|
|
722
722
|
font-size: 0.9rem;
|
|
723
723
|
}
|
|
724
|
-
|
|
724
|
+
.refresh-info a {
|
|
725
|
+
color: #ffeb3b;
|
|
726
|
+
font-weight: bold;
|
|
727
|
+
text-decoration: none;
|
|
728
|
+
margin-left: 8px;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
.refresh-info a:hover {
|
|
732
|
+
text-decoration: underline;
|
|
733
|
+
color: #fff176;
|
|
734
|
+
}
|
|
735
|
+
.refresh-info button {
|
|
736
|
+
margin-left: 8px;
|
|
737
|
+
background-color: #ffeb3b;
|
|
738
|
+
color: #6a0dad;
|
|
739
|
+
font-weight: bold;
|
|
740
|
+
border: none;
|
|
741
|
+
border-radius: 4px;
|
|
742
|
+
padding: 4px 8px;
|
|
743
|
+
cursor: pointer;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
.refresh-info button:hover {
|
|
747
|
+
background-color: #fff176;
|
|
748
|
+
}
|
|
725
749
|
.progress-bar {
|
|
726
750
|
width: 100%;
|
|
727
751
|
height: 8px;
|
|
@@ -777,6 +801,7 @@ class StatusServer {
|
|
|
777
801
|
<span class="stat-label">监控服务器</span>
|
|
778
802
|
<span class="stat-value">${serversStatus.length} 个</span>
|
|
779
803
|
</div>
|
|
804
|
+
|
|
780
805
|
</div>
|
|
781
806
|
</div>
|
|
782
807
|
|
|
@@ -843,11 +868,32 @@ class StatusServer {
|
|
|
843
868
|
</div>
|
|
844
869
|
|
|
845
870
|
<div class="refresh-info">
|
|
846
|
-
|
|
847
|
-
|
|
871
|
+
页面每30秒自动刷新 • Minecraft 机器人监控系统 v${version}
|
|
872
|
+
· <a href="https://www.npmjs.com/package/@baipiaodajun/mcbots" target="_blank" rel="noopener noreferrer">NPM主頁</a>
|
|
873
|
+
· <a href="https://gbjs.hospedagem-gratis.com/mcbot.html" target="_blank" rel="noopener noreferrer">SERVER_JSON生成器</a>
|
|
874
|
+
· <a href="https://gbjs.hospedagem-gratis.com/mcbot2.html" target="_blank" rel="noopener noreferrer">SERVER_JSON修改器</a>
|
|
875
|
+
· <button id="copy-config">复制配置</button>
|
|
876
|
+
</div>
|
|
877
|
+
<!-- 隐藏元素存放 SERVERS_JSON -->
|
|
878
|
+
<div id="servers-json" style="display:none;">
|
|
879
|
+
${process.env.SERVERS_JSON}
|
|
880
|
+
</div>
|
|
848
881
|
</div>
|
|
849
882
|
|
|
850
883
|
<script>
|
|
884
|
+
document.getElementById('copy-config').addEventListener('click', () => {
|
|
885
|
+
// 从隐藏元素中获取内容
|
|
886
|
+
const serversJson = document.getElementById('servers-json').textContent.trim();
|
|
887
|
+
|
|
888
|
+
if (serversJson) {
|
|
889
|
+
navigator.clipboard.writeText(serversJson)
|
|
890
|
+
.then(() => alert('配置已复制到剪贴板'))
|
|
891
|
+
.catch(err => alert('复制失败: ' + err));
|
|
892
|
+
} else {
|
|
893
|
+
alert('未找到配置内容');
|
|
894
|
+
}
|
|
895
|
+
});
|
|
896
|
+
|
|
851
897
|
// 30秒自动刷新
|
|
852
898
|
setTimeout(() => {
|
|
853
899
|
location.reload();
|