Skip to content

Commit 42005e8

Browse files
fix(tui): removing telegram and ddiscord ids
1 parent a08a29f commit 42005e8

File tree

2 files changed

+32
-58
lines changed

2 files changed

+32
-58
lines changed

dashboard/src/service/api/index.ts

Lines changed: 30 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Do not edit manually.
44
* PasarGuardAPI
55
* Unified GUI Censorship Resistant Solution
6-
* OpenAPI spec version: 1.4.1
6+
* OpenAPI spec version: 1.5.0
77
*/
88
import { useMutation, useQuery } from '@tanstack/react-query'
99
import type {
@@ -368,20 +368,20 @@ export interface UsersResponse {
368368

369369
export type UserUsageStatsListPeriod = Period | null
370370

371-
export interface UserUsageStat {
372-
total_traffic: number
373-
period_start: string
374-
}
375-
376-
export type UserUsageStatsListStats = { [key: string]: UserUsageStat[] }
377-
378371
export interface UserUsageStatsList {
379372
period?: UserUsageStatsListPeriod
380373
start: string
381374
end: string
382375
stats: UserUsageStatsListStats
383376
}
384377

378+
export interface UserUsageStat {
379+
total_traffic: number
380+
period_start: string
381+
}
382+
383+
export type UserUsageStatsListStats = { [key: string]: UserUsageStat[] }
384+
385385
export type UserTemplateResponseIsDisabled = boolean | null
386386

387387
export type UserTemplateResponseOnHoldTimeout = number | null
@@ -750,8 +750,6 @@ export interface TransportSettingsOutput {
750750

751751
export type TransportSettingsInputWebsocketSettings = WebSocketSettings | null
752752

753-
export type TransportSettingsInputTcpSettings = TcpSettings | null
754-
755753
export type TransportSettingsInputKcpSettings = KCPSettings | null
756754

757755
export type TransportSettingsInputGrpcSettings = GRPCSettings | null
@@ -804,6 +802,8 @@ export interface TcpSettings {
804802
response?: TcpSettingsResponse
805803
}
806804

805+
export type TransportSettingsInputTcpSettings = TcpSettings | null
806+
807807
export type SystemStatsCpuUsage = number | null
808808

809809
export type SystemStatsCpuCores = number | null
@@ -1774,6 +1774,26 @@ export type BaseHostMuxSettings = MuxSettingsOutput | null
17741774

17751775
export type BaseHostTransportSettings = TransportSettingsOutput | null
17761776

1777+
export type BaseHostHttpHeadersAnyOf = { [key: string]: string }
1778+
1779+
export type BaseHostHttpHeaders = BaseHostHttpHeadersAnyOf | null
1780+
1781+
export type BaseHostAllowinsecure = boolean | null
1782+
1783+
export type BaseHostAlpn = ProxyHostALPN[] | null
1784+
1785+
export type BaseHostPath = string | null
1786+
1787+
export type BaseHostHost = string[] | null
1788+
1789+
export type BaseHostSni = string[] | null
1790+
1791+
export type BaseHostPort = number | null
1792+
1793+
export type BaseHostInboundTag = string | null
1794+
1795+
export type BaseHostId = number | null
1796+
17771797
export interface BaseHost {
17781798
id?: BaseHostId
17791799
remark: string
@@ -1800,26 +1820,6 @@ export interface BaseHost {
18001820
ech_config_list?: BaseHostEchConfigList
18011821
}
18021822

1803-
export type BaseHostHttpHeadersAnyOf = { [key: string]: string }
1804-
1805-
export type BaseHostHttpHeaders = BaseHostHttpHeadersAnyOf | null
1806-
1807-
export type BaseHostAllowinsecure = boolean | null
1808-
1809-
export type BaseHostAlpn = ProxyHostALPN[] | null
1810-
1811-
export type BaseHostPath = string | null
1812-
1813-
export type BaseHostHost = string[] | null
1814-
1815-
export type BaseHostSni = string[] | null
1816-
1817-
export type BaseHostPort = number | null
1818-
1819-
export type BaseHostInboundTag = string | null
1820-
1821-
export type BaseHostId = number | null
1822-
18231823
export type ApplicationOutputDescription = { [key: string]: string }
18241824

18251825
export interface ApplicationOutput {
@@ -1969,31 +1969,6 @@ export interface AdminCreate {
19691969
username: string
19701970
}
19711971

1972-
export type AdminContactInfoNotificationEnable = UserNotificationEnable | null
1973-
1974-
export type AdminContactInfoSupportUrl = string | null
1975-
1976-
export type AdminContactInfoProfileTitle = string | null
1977-
1978-
export type AdminContactInfoSubDomain = string | null
1979-
1980-
export type AdminContactInfoDiscordWebhook = string | null
1981-
1982-
export type AdminContactInfoTelegramId = number | null
1983-
1984-
/**
1985-
* Base model containing the core admin identification fields.
1986-
*/
1987-
export interface AdminContactInfo {
1988-
username: string
1989-
telegram_id?: AdminContactInfoTelegramId
1990-
discord_webhook?: AdminContactInfoDiscordWebhook
1991-
sub_domain?: AdminContactInfoSubDomain
1992-
profile_title?: AdminContactInfoProfileTitle
1993-
support_url?: AdminContactInfoSupportUrl
1994-
notification_enable?: AdminContactInfoNotificationEnable
1995-
}
1996-
19971972
/**
19981973
* Minimal admin model containing only the username.
19991974
*/

tui/admin.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ async def on_mount(self) -> None:
394394
self.query_one("#is_sudo").value = self.admin.is_sudo
395395
self.query_one("#is_disabled").value = self.admin.is_disabled
396396

397-
# Handle notification_enable (comes as dict from SQLAlchemy, None = legacy admin)
398397
# Load existing notification preferences (notification_enable is a dict from SQLAlchemy)
399398
notif = self.admin.notification_enable or {}
400399
master_on = any([
@@ -475,9 +474,9 @@ async def on_button_pressed(self, event: Button.Pressed) -> None:
475474
if event.button.id == "save":
476475
password = self.query_one("#password").value.strip() or None
477476
confirm_password = self.query_one("#confirm_password").value.strip() or None
478-
telegram_id = self.query_one("#telegram_id").value or None
477+
telegram_id = self.query_one("#telegram_id").value or 0
479478
discord_webhook = self.query_one("#discord_webhook").value.strip() or None
480-
discord_id = self.query_one("#discord_id").value or None
479+
discord_id = self.query_one("#discord_id").value or 0
481480
is_sudo = self.query_one("#is_sudo").value
482481
is_disabled = self.query_one("#is_disabled").value
483482
sub_template = self.query_one("#sub_template").value.strip() or None

0 commit comments

Comments
 (0)