feat: add draggable server stats dashboard with customizable widgets

This commit is contained in:
ZacharyZcR
2025-10-09 08:59:45 +08:00
parent 7ddcb42f7f
commit 74f537ea0b
10 changed files with 576 additions and 4167 deletions

View File

@@ -166,6 +166,7 @@ async function initializeCompleteDatabase(): Promise<void> {
tunnel_connections TEXT,
enable_file_manager INTEGER NOT NULL DEFAULT 1,
default_path TEXT,
stats_config TEXT,
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users (id)
@@ -373,6 +374,7 @@ const migrateSchema = () => {
addColumnIfNotExists("ssh_data", "autostart_password", "TEXT");
addColumnIfNotExists("ssh_data", "autostart_key", "TEXT");
addColumnIfNotExists("ssh_data", "autostart_key_password", "TEXT");
addColumnIfNotExists("ssh_data", "stats_config", "TEXT");
addColumnIfNotExists("ssh_credentials", "private_key", "TEXT");
addColumnIfNotExists("ssh_credentials", "public_key", "TEXT");

View File

@@ -65,6 +65,7 @@ export const sshData = sqliteTable("ssh_data", {
.notNull()
.default(true),
defaultPath: text("default_path"),
statsConfig: text("stats_config"),
createdAt: text("created_at")
.notNull()
.default(sql`CURRENT_TIMESTAMP`),

View File

@@ -1239,13 +1239,6 @@ async function resolveHostCredentials(host: any): Promise<any> {
}
}
const result = { ...host };
if (host.key_password !== undefined) {
if (result.keyPassword === undefined) {
result.keyPassword = host.key_password;
}
delete result.key_password;
}
const result = { ...host };
if (host.key_password !== undefined) {
if (result.keyPassword === undefined) {