diff --git a/web/public/js/components/server/http-remote-addr-config-box.js b/web/public/js/components/server/http-remote-addr-config-box.js index 18b372fc..1a8e6211 100644 --- a/web/public/js/components/server/http-remote-addr-config-box.js +++ b/web/public/js/components/server/http-remote-addr-config-box.js @@ -6,16 +6,49 @@ Vue.component("http-remote-addr-config-box", { config = { isPrior: false, isOn: false, - value: "${remoteAddr}" + value: "${remoteAddr}", + isCustomized: false } } + + let optionValue = "" + if (!config.isCustomized && (config.value == "${remoteAddr}" || config.value == "${rawRemoteAddr}")) { + optionValue = config.value + } + return { - config: config + config: config, + options: [ + { + name: "直接访问", + description: "用户可以直接访问边缘节点,即 \"用户 --> 边缘节点\" 模式。", + value: "${rawRemoteAddr}" + }, + { + name: "代理转发", + description: "用户和边缘节点之间有别的代理服务转发,即 \"用户 --> [第三方代理服务] --> 边缘节点\"。", + value: "${remoteAddr}" + }, + { + name: "[自定义]", + description: "", + value: "" + } + ], + optionValue: optionValue } }, methods: { isOn: function () { return ((!this.vIsLocation && !this.vIsGroup) || this.config.isPrior) && this.config.isOn + }, + changeOptionValue: function () { + if (this.optionValue.length > 0) { + this.config.value = this.optionValue + this.config.isCustomized = false + } else { + this.config.isCustomized = true + } } }, template: `
@@ -36,10 +69,22 @@ Vue.component("http-remote-addr-config-box", { - 请求变量 + 用户访问节点方式 * - -

通过此变量获取用户的IP地址。具体可用的请求变量列表可参考官方网站文档。

+ +

{{option.description}}

+ + + + 读取IP变量值 * + + +
+ +

通过此变量获取用户的IP地址。具体可用的请求变量列表可参考官方网站文档。

+