mirror of
https://github.com/itdoginfo/podkop.git
synced 2026-01-31 06:40:46 +03:00
feat: conditionally include external_ui in clash_api config if external_ui path is provided
This commit is contained in:
@@ -1335,8 +1335,8 @@ sing_box_cm_configure_cache_file() {
|
|||||||
# Configure the experimental clash_api section of a sing-box JSON configuration.
|
# Configure the experimental clash_api section of a sing-box JSON configuration.
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# config: JSON configuration (string)
|
# config: JSON configuration (string)
|
||||||
# external_controller: string, URL or path for the external controller
|
# external_controller: API listening address; Clash API will be disabled if empty
|
||||||
# external_ui: string, URL or path for the external UI
|
# external_ui: Optional path to static web resources to serve at http://{{external-controller}}/ui
|
||||||
# Outputs:
|
# Outputs:
|
||||||
# Writes updated JSON configuration to stdout
|
# Writes updated JSON configuration to stdout
|
||||||
# Example:
|
# Example:
|
||||||
@@ -1352,8 +1352,8 @@ sing_box_cm_configure_clash_api() {
|
|||||||
--arg external_ui "$external_ui" \
|
--arg external_ui "$external_ui" \
|
||||||
'.experimental.clash_api = {
|
'.experimental.clash_api = {
|
||||||
external_controller: $external_controller,
|
external_controller: $external_controller,
|
||||||
external_ui: $external_ui
|
}
|
||||||
}'
|
+ (if $external_ui != "" then { external_ui: $external_ui } else {} end)'
|
||||||
}
|
}
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
|
|||||||
Reference in New Issue
Block a user