This commit is contained in:
2026-09-20 07:27:29 +01:00
parent dc2cd66b25
commit 8ec44ee0a7
70 changed files with 2657 additions and 128 deletions
+32 -2
View File
@@ -1,3 +1,7 @@
import {
ClientRuleProtocols,
ClientRuleTypes,
} from "@/src/dict/client-rules-dict";
import { MediaParadigms, MediaTypes } from "@/src/dict/media-dict";
import { UserTypes } from "@/src/dict/user-types-dict";
import { Variables } from "@/src/dict/variables-dict";
@@ -237,12 +241,38 @@ const schema: BUN_SQLITE_DatabaseSchemaType = {
dataType: "INTEGER",
},
{
fieldName: "client_id",
fieldName: "host_id",
dataType: "INTEGER",
defaultValue: 0,
},
{
fieldName: "rule",
fieldName: "client_id",
dataType: "INTEGER",
foreignKey: {
cascadeDelete: true,
destinationTableName: "clients",
destinationTableColumnName: "id",
destinationTableColumnType: "INTEGER",
foreignKeyName: "client_rules_client_fk",
},
},
{
fieldName: "rule_type",
dataType: "TEXT",
options: ClientRuleTypes.map((rt) => rt.value),
},
{
fieldName: "destination",
dataType: "TEXT",
},
{
fieldName: "ports",
dataType: "TEXT",
},
{
fieldName: "protocol",
dataType: "TEXT",
options: ClientRuleProtocols.map((p) => p.value),
},
],
},
+5 -1
View File
@@ -150,8 +150,12 @@ export type BUN_SQLITE_WGUI_CLIENT_RULES = {
*/
updated_at?: number | "";
user_id?: number | "";
host_id?: number | "";
client_id?: number | "";
rule?: string;
rule_type?: "all" | "destination" | "";
destination?: string;
ports?: string;
protocol?: "any" | "tcp" | "udp" | "";
}
export type BUN_SQLITE_WGUI_VARIABLES = {