Compare commits
7 Commits
v1.0.0-bet
...
main
Author | SHA1 | Date | |
---|---|---|---|
8997427192 | |||
eecf0a365d | |||
37a72ec902 | |||
855fc1643a | |||
ff039484b3 | |||
0cdcd32aaa | |||
64a6dc5cd1 |
26
Dockerfile
Normal file
26
Dockerfile
Normal 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
15
README.md
Normal 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
5
app.js
@ -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(/\/$/, ""), // 移除末尾的斜杠
|
||||||
|
@ -96,7 +96,7 @@
|
|||||||
<span class="close-modal" id="closeModal">×</span>
|
<span class="close-modal" id="closeModal">×</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>
|
||||||
|
Reference in New Issue
Block a user