From d6247d69ceca81ec73e2179ef66e0b1f530012f5 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Thu, 5 Dec 2024 14:02:17 -0800 Subject: [PATCH] [Electron] Hide auto-launch in server config (#1815) --- src/constants/serverConfig.ts | 49 +++++++++++++++++------------------ 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/src/constants/serverConfig.ts b/src/constants/serverConfig.ts index 75c70ee19..2a06e3e59 100644 --- a/src/constants/serverConfig.ts +++ b/src/constants/serverConfig.ts @@ -20,7 +20,7 @@ export interface ServerConfig extends FormItem { getValue?: (value: T) => Record } -export const WEB_ONLY_CONFIG_ITEMS: ServerConfig[] = [ +export const WEB_ONLY_CONFIG_ITEMS: ServerConfig[] = [ // We only need these settings in the web version. Desktop app manages them already. { id: 'listen', @@ -35,6 +35,29 @@ export const WEB_ONLY_CONFIG_ITEMS: ServerConfig[] = [ category: ['Network'], type: 'number', defaultValue: 8188 + }, + // Launch behavior + { + id: 'auto-launch', + name: 'Automatically opens in the browser on startup', + category: ['Launch'], + type: 'combo', + options: Object.values(AutoLaunch), + defaultValue: AutoLaunch.Auto, + getValue: (value: AutoLaunch) => { + switch (value) { + case AutoLaunch.Auto: + return {} + case AutoLaunch.Enable: + return { + ['auto-launch']: true + } + case AutoLaunch.Disable: + return { + ['disable-auto-launch']: true + } + } + } } ] @@ -69,30 +92,6 @@ export const SERVER_CONFIG_ITEMS: ServerConfig[] = [ defaultValue: 100 }, - // Launch behavior - { - id: 'auto-launch', - name: 'Automatically opens in the browser on startup', - category: ['Launch'], - type: 'combo', - options: Object.values(AutoLaunch), - defaultValue: AutoLaunch.Auto, - getValue: (value: AutoLaunch) => { - switch (value) { - case AutoLaunch.Auto: - return {} - case AutoLaunch.Enable: - return { - ['auto-launch']: true - } - case AutoLaunch.Disable: - return { - ['disable-auto-launch']: true - } - } - } - }, - // CUDA settings { id: 'cuda-device',