major updates to device and links management in admin

This commit is contained in:
user
2026-03-28 15:34:03 +02:00
parent e8c5986df6
commit 6639bcd799
32 changed files with 3304 additions and 496 deletions

View File

@@ -15,10 +15,11 @@ export const device = pgTable("device", {
status: varchar("status", { length: 16 }).notNull().default("offline"), // "online" | "offline" | "busy" | "error"
isActive: boolean("is_active").notNull().default(false),
inUse: boolean("in_use").notNull().default(false),
containerId: text("container_id"), // Docker container ID on the VPS
containerId: text("container_id").notNull(), // Docker container ID on the VPS
host: text("host").notNull(), // VPS hostname or IP
wsPort: text("ws_port"), // ws-scrcpy WebSocket port
wsPort: text("ws_port").notNull(), // ws-scrcpy WebSocket port
createdAt: timestamp("created_at").notNull(),
updatedAt: timestamp("updated_at").notNull(),

View File

@@ -1,4 +1,11 @@
import { integer, pgTable, serial, text, timestamp, varchar } from "drizzle-orm/pg-core";
import {
integer,
pgTable,
serial,
text,
timestamp,
varchar,
} from "drizzle-orm/pg-core";
import { device } from "./device.schema";
import { relations } from "drizzle-orm";
@@ -7,6 +14,8 @@ export const link = pgTable("link", {
token: text("token").notNull().unique(),
status: varchar("status", { length: 16 }).notNull().default("active"), // "active" | "inactive" | "expired" | "revoked"
appName: text("app_name").notNull(),
appPackage: text("app_package").notNull(),
linkedDeviceId: integer("linked_device_id").references(() => device.id, {
onDelete: "set null",