Skip to content

Commit bf43adf

Browse files
authored
update setting api (#123)
1 parent 1ee664f commit bf43adf

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

src/components/install-commands.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,22 +88,15 @@ export const InstallCommandsMenu = forwardRef<HTMLButtonElement, ButtonProps>((p
8888

8989
const generateCommand = (
9090
type: number,
91-
{ agent_secret_key, install_host, tls }: ModelSetting,
92-
{ agent_secret, role }: ModelProfile,
91+
{ install_host, tls }: ModelSetting,
92+
{ agent_secret }: ModelProfile,
9393
) => {
9494
if (!install_host) throw new Error(i18next.t("Results.InstallHostRequired"))
9595

96-
// 如果 agent_secret 为空且 role 为 0 ,则使用 agent_secret_key,否则如果 agent_secret 为空则报错
97-
if (!agent_secret && role === 0) {
98-
agent_secret = agent_secret_key
99-
} else if (!agent_secret) {
100-
throw new Error(i18next.t("Results.AgentSecretRequired"))
101-
}
102-
103-
agent_secret_key = agent_secret
96+
if (!agent_secret) throw new Error(i18next.t("Results.AgentSecretRequired"))
10497

105-
const env = `NZ_SERVER=${install_host} NZ_TLS=${tls || false} NZ_CLIENT_SECRET=${agent_secret_key}`
106-
const env_win = `$env:NZ_SERVER=\"${install_host}\";$env:NZ_TLS=\"${tls || false}\";$env:NZ_CLIENT_SECRET=\"${agent_secret_key}\";`
98+
const env = `NZ_SERVER=${install_host} NZ_TLS=${tls || false} NZ_CLIENT_SECRET=${agent_secret}`
99+
const env_win = `$env:NZ_SERVER=\"${install_host}\";$env:NZ_TLS=\"${tls || false}\";$env:NZ_CLIENT_SECRET=\"${agent_secret}\";`
107100

108101
switch (type) {
109102
case OSTypes.Linux:

src/types/api.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -631,32 +631,22 @@ export interface ModelServiceResponseItem {
631631

632632
export interface ModelSetting {
633633
admin_template: string
634-
agent_secret_key: string
635-
avg_ping_count: number
636634
/** 覆盖范围(0:提醒未被 IgnoredIPNotification 包含的所有服务器; 1:仅提醒被 IgnoredIPNotification 包含的服务器;) */
637635
cover: number
638636
custom_code: string
639637
custom_code_dashboard: string
640-
/** debug模式开关 */
641-
debug: boolean
642638
dns_servers: string
643639
/** IP变更提醒 */
644640
enable_ip_change_notification: boolean
645641
/** 通知信息IP不打码 */
646642
enable_plain_ip_in_notification: boolean
647-
/** 强制要求认证 */
648-
force_auth: boolean
649643
/** 特定服务器IP(多个服务器用逗号分隔) */
650644
ignored_ip_notification: string
651-
/** [ServerID] -> bool(值为true代表当前ServerID在特定服务器列表内) */
652645
ignored_ip_notification_server_ids: Record<string, boolean>
653646
install_host: string
654647
ip_change_notification_group_id: number
655648
/** 系统语言,默认 zh_CN */
656649
language: string
657-
/** 时区,默认为 Asia/Shanghai */
658-
location: string
659-
/** oauth2 供应商列表,无需配置,自动生成 */
660650
oauth2_providers: string[]
661651
/** 真实IP */
662652
real_ip_header: string

0 commit comments

Comments
 (0)