Commit 3c203950 authored by zk's avatar zk
Browse files

Stabilize card layout and SSH timeout

parent 8f067d87
...@@ -94,7 +94,7 @@ npm start ...@@ -94,7 +94,7 @@ npm start
- `PORT`:网页端口,默认 `3066` - `PORT`:网页端口,默认 `3066`
- `POLL_INTERVAL_MS`:自动采集间隔,默认 `10000` 毫秒。 - `POLL_INTERVAL_MS`:自动采集间隔,默认 `10000` 毫秒。
- `SSH_TIMEOUT_MS`:单台服务器 SSH 超时,默认 `8000` 毫秒。 - `SSH_TIMEOUT_MS`:单台服务器 SSH/采集命令超时,默认 `20000` 毫秒。NVIDIA 机器首次执行 `nvidia-smi` 较慢时可以继续调大。
- `SSH_PATH`:自定义 SSH 程序路径。Windows 默认使用 `C:\Windows\System32\OpenSSH\ssh.exe` - `SSH_PATH`:自定义 SSH 程序路径。Windows 默认使用 `C:\Windows\System32\OpenSSH\ssh.exe`
## 上传到 GitHub ## 上传到 GitHub
......
...@@ -302,28 +302,31 @@ h2 { ...@@ -302,28 +302,31 @@ h2 {
.server-grid { .server-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
gap: 12px; grid-auto-rows: auto;
align-items: start; gap: 16px;
align-items: stretch;
flex: 1 1 auto; flex: 1 1 auto;
min-height: 0; min-height: 0;
overflow-y: auto; overflow-y: auto;
padding: 2px 4px 12px 2px; padding: 2px 8px 18px 2px;
} }
.server-card { .server-card {
min-height: 0; position: relative;
display: flex;
flex-direction: column;
min-height: 284px;
min-width: 0; min-width: 0;
border: 1px solid var(--line); border: 1px solid var(--line);
border-radius: 12px; border-radius: 12px;
background: #fff; background: #fff;
padding: 13px; padding: 13px;
transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease; transition: box-shadow 0.16s ease, border-color 0.16s ease;
} }
.server-card:hover, .server-card:hover,
.server-card.selected { .server-card.selected {
transform: translateY(-2px);
border-color: rgba(15, 159, 154, 0.45); border-color: rgba(15, 159, 154, 0.45);
box-shadow: 0 18px 40px rgba(30, 51, 61, 0.12); box-shadow: 0 18px 40px rgba(30, 51, 61, 0.12);
} }
...@@ -423,6 +426,7 @@ h2 { ...@@ -423,6 +426,7 @@ h2 {
.summary strong { .summary strong {
display: block; display: block;
font-size: 21px; font-size: 21px;
overflow-wrap: anywhere;
} }
.summary span { .summary span {
...@@ -432,7 +436,7 @@ h2 { ...@@ -432,7 +436,7 @@ h2 {
.gpu-grid { .gpu-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 6px; gap: 6px;
} }
...@@ -562,6 +566,7 @@ h2 { ...@@ -562,6 +566,7 @@ h2 {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 6px; gap: 6px;
align-items: center;
margin-top: 14px; margin-top: 14px;
} }
...@@ -885,4 +890,8 @@ select:focus { ...@@ -885,4 +890,8 @@ select:focus {
.gpu-grid { .gpu-grid {
grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-columns: repeat(2, minmax(0, 1fr));
} }
.server-card {
min-height: 0;
}
} }
...@@ -6,7 +6,7 @@ const crypto = require("crypto"); ...@@ -6,7 +6,7 @@ const crypto = require("crypto");
const PORT = Number(process.env.PORT || 3066); const PORT = Number(process.env.PORT || 3066);
const POLL_INTERVAL_MS = Number(process.env.POLL_INTERVAL_MS || 10000); const POLL_INTERVAL_MS = Number(process.env.POLL_INTERVAL_MS || 10000);
const SSH_TIMEOUT_MS = Number(process.env.SSH_TIMEOUT_MS || 8000); const SSH_TIMEOUT_MS = Number(process.env.SSH_TIMEOUT_MS || 20000);
const ROOT = __dirname; const ROOT = __dirname;
const DATA_DIR = path.join(ROOT, "data"); const DATA_DIR = path.join(ROOT, "data");
const CONFIG_PATH = path.join(DATA_DIR, "servers.json"); const CONFIG_PATH = path.join(DATA_DIR, "servers.json");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment