Compare commits

7 Commits

Author SHA1 Message Date
8997427192 更新 README.md 2025-07-21 21:56:13 +00:00
eecf0a365d README.md Update 2025-07-20 16:53:47 -07:00
37a72ec902 让客户端可以使用wss连接 2025-07-20 16:52:48 -07:00
855fc1643a README UPDATE 2025-07-20 16:32:33 -07:00
ff039484b3 Merge branch 'main' of https://github.com/BretRen/status 2025-07-20 16:20:37 -07:00
0cdcd32aaa Create README.md 2025-07-20 16:20:31 -07:00
64a6dc5cd1 docker add v1.0.0 2025-07-20 16:19:20 -07:00
4 changed files with 42 additions and 6 deletions

26
Dockerfile Normal file
View File

@ -0,0 +1,26 @@
# 构建阶段
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --production
COPY . .
RUN npm install -g pkg && \
pkg server.js --targets node18-linux-x64 --output app
# 运行时阶段
FROM alpine:3.18
RUN apk add --no-cache libstdc++
WORKDIR /app
COPY --from=builder /app/app .
# 安全配置
RUN addgroup -S appgroup && \
adduser -S appuser -G appgroup && \
chown -R appuser:appgroup /app
USER appuser
EXPOSE 3001
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget -qO- http://localhost:3001/health || exit 1
ENTRYPOINT ["./app"]

15
README.md Normal file
View File

@ -0,0 +1,15 @@
# Pdnode Status Panel
由Pdnode团队开发的状态面板。
**注意此状态面板并不成熟很可能有bug以及安全风险。请谨慎使用**
目前功能:
- 显示内存占用
- 显示CPU以及每个核的CPU占用
- 显示系统负载平均(**目前此功能只对linux/macos有效**
## 使用
此文档[已移至Wiki](https://gitea.pdnode.com/admin/status/wiki/)
## Q & A
此文档[已移至Wiki](https://gitea.pdnode.com/admin/status/wiki/)

5
app.js
View File

@ -124,11 +124,6 @@ function setupSocketListeners(socket) {
// 添加新服务器 // 添加新服务器
function addServer(name, address) { function addServer(name, address) {
// 验证地址格式
if (!address.startsWith("http://") && !address.startsWith("https://")) {
address = "http://" + address;
}
const newServer = { const newServer = {
name, name,
address: address.replace(/\/$/, ""), // 移除末尾的斜杠 address: address.replace(/\/$/, ""), // 移除末尾的斜杠

View File

@ -96,7 +96,7 @@
<span class="close-modal" id="closeModal">&times;</span> <span class="close-modal" id="closeModal">&times;</span>
<h2>添加服务器</h2> <h2>添加服务器</h2>
<input type="text" id="server-name" placeholder="服务器名称" /> <input type="text" id="server-name" placeholder="服务器名称" />
<input type="text" id="server-address" placeholder="IP地址或域名 (如: http://localhost:3001)" /> <input type="text" id="server-address" placeholder="IP地址或域名 (格式ws/wss://ip/域名)" />
<button class="submit-btn" id="add-server-btn">添加</button> <button class="submit-btn" id="add-server-btn">添加</button>
</div> </div>
</div> </div>