diff --git a/src/components/FormItemLabel.vue b/src/components/FormItemLabel.vue
index c53e17b93..849884c08 100644
--- a/src/components/FormItemLabel.vue
+++ b/src/components/FormItemLabel.vue
@@ -3,7 +3,12 @@
{{ desc }}
-
+
+
+
+
+
+
@@ -24,5 +29,8 @@ defineProps({
type: Boolean,
default: false,
},
+ maxHeight: {
+ type: Number,
+ },
})
diff --git a/src/components/ListenerDrawer/ListenerDrawer.vue b/src/components/ListenerDrawer/ListenerDrawer.vue
index 3cb626614..758d6d28b 100644
--- a/src/components/ListenerDrawer/ListenerDrawer.vue
+++ b/src/components/ListenerDrawer/ListenerDrawer.vue
@@ -176,7 +176,15 @@
-
+
+
+
+
diff --git a/src/i18n/Gateway.js b/src/i18n/Gateway.js
index d6abc9e84..ca1e21e0d 100644
--- a/src/i18n/Gateway.js
+++ b/src/i18n/Gateway.js
@@ -123,6 +123,48 @@ export default {
zh: '挂载点',
en: 'MountPoint',
},
+ mountPointDesc: {
+ zh: `为客户端在 \`SUBSCRIBE\` 和 \`UNSUBSCRIBE\` 请求、\`PUBLISH\` 消息以及 Will Message(如果在 \`CONNECT\` 数据包中提供)中使用的主题添加静态或模板前缀(例如 \`n1/\` 或 \`{'$'}{'{'}username{'}'}/\`)。
+从发布到相应订阅的消息的主题中移除此前缀。
+
+支持的占位符包括:
+- \`{'$'}{'{'}username{'}'}\`
+- \`{'$'}{'{'}clientid{'}'}\`
+- \`{'$'}{'{'}zone{'}'}\`
+- \`{'$'}{'{'}client_attrs.NAME{'}'}\`
+
+例如,使用 \`mountpoint="{'$'}{'{'}username{'}'}/"\` 时,客户端 \`u1\` 将出现以下情况:
+- 客户端 SUBSCRIBE \`sensors/#\` -> 在代理中内部转换为 \`u1/sensors/#\`。
+- 代理 PUBLISH \`u1/sensors/data\` -> 发送给客户端时变为 \`sensors/data\`。
+
+前缀的挂载/卸载应用于:
+- \`CONNECT\` 中的 Will
+- \`PUBLISH\`
+- \`SUBSCRIBE\`
+- \`UNSUBSCRIBE\`
+
+注意:挂载发生在**授权/ACL检查之后**。`,
+ en: `Adds a static or templated prefix (e.g., \`n1/\` or \`{'$'}{'{'}username{'}'}/\`) to topics used by clients in \`SUBSCRIBE\` and \`UNSUBSCRIBE\` requests, \`PUBLISH\` messages, and Will Message (if supplied in the \`CONNECT\` packet).
+Removes this prefix from topics of messages published to the respective subscriptions.
+
+The supported placeholders are:
+- \`{'$'}{'{'}username{'}'}\`
+- \`{'$'}{'{'}clientid{'}'}\`
+- \`{'$'}{'{'}zone{'}'}\`
+- \`{'$'}{'{'}client_attrs.NAME{'}'}\`
+
+For example, with \`mountpoint="{'$'}{'{'}username{'}'}/"\`, a client \`u1\` will have:
+- Client SUBSCRIBE \`sensors/#\` -> \`u1/sensors/#\` internally in the broker.
+- Broker PUBLISH \`u1/sensors/data\` -> \`sensors/data\` sent to the client.
+
+The prefix mount/unmount is applied to:
+- Will in \`CONNECT\`
+- \`PUBLISH\`
+- \`SUBSCRIBE\`
+- \`UNSUBSCRIBE\`
+
+Note: mounting occurs **after authorization/ACL checks**.`,
+ },
lType: {
zh: '类型',
en: 'Type',
diff --git a/src/schemaText/schema-text-en.json b/src/schemaText/schema-text-en.json
index a4cd0105f..e4d3ce83a 100644
--- a/src/schemaText/schema-text-en.json
+++ b/src/schemaText/schema-text-en.json
@@ -1313,14 +1313,14 @@
},
"mqtt_client_attrs_init": {
"label": "Client Attributes",
- "desc": "Set custom attributes on client connection and use them in authentication, authorization, and other functions."
+ "desc": "Specify how to initialize client attributes.
Each client attribute can be initialized as `client_attrs.{'{'}NAME{'}'}`,
where `{'{'}NAME{'}'}` is the name of the attribute specified in the config field `set_as_attr`.
The initialized client attribute will be stored in the `client_attrs` property with the specified name,
and can be used as a variable to render a template for mountpoint, authentication and authorization requests.
For example, use `${'{'}client_attrs.tns{'}'}` to render an HTTP POST body when `set_as_attr = tns`,
or render listener config `moutpoint = ${'{'}client_attrs.tns{'}'}/` for topic namespacing."
},
"client_attrs_init_set_as_attr": {
"label": "Attribute"
},
"client_attrs_init_expression": {
"label": "Attribute Expression",
- "desc": "A single-line expression that dynamically extracts attribute values from existing client information can use the following fields:
- `clientid`: client ID
- `username`: user name
- `cn`: CN field of TLS certificate
- `dn`: DN field of TLS certificate
- `user_property.*`: extracts the property value from the `User-Property` of the MQTT CONNECT packet, e.g. `user_property.foo`
You can use predefined string functions to dynamically process the information. For example, to extract the prefix of a dot-separated client ID: `nth(1, tokens(clientid, '.'))`; to extract a partial username: `substr(username, 0, 5)`. You can read more about variform expressions in EMQX docs.
"
+ "desc": "A one line expression to evaluate a set of predefined string functions (like in the rule engine SQL statements).
The expression can be a function call with nested calls as its arguments, or direct variable reference.
So far, it does not provide user-defined variable binding (like `var a=1`) or user-defined functions.
As an example, to extract the prefix of client ID delimited by a dot: `nth(1, tokens(clientid, '.'))`.
The variables pre-bound variables are:
- `clientid`: MQTT Client ID.
- `username`: MQTT Client's username.
- `user_property.{'{'}NAME{'}'}`: User properties in the CONNECT packet.
For TLS clients, connected directly or via proxy-protocol (v2) enabled load balancer,
some extra variables can be used:
- `cn`: Client's TLS certificate common name.
- `dn`: Client's TLS certificate distinguished name (the subject).
- `peersni`: TLS server name indication sent by the client.
You can read more about variform expressions in EMQX docs."
},
"mqtt_keepalive_check_interval": {
"label": "Keep Alive Check Interval",
@@ -1332,7 +1332,7 @@
},
"mqtt_clientid_override": {
"label": "Client ID Override Expression",
- "desc": "A one line expression to evaluate a set of predefined string functions (like in the rule engine SQL statements).
The expression can be a function call with nested calls as its arguments, or direct variable reference.
So far, it does not provide user-defined variable binding (like `var a=1`) or user-defined functions.
As an example, to extract the prefix of client ID delimited by a dot: `nth(1, tokens(username, '.'))`.
The variables pre-bound variables are:
- `cn`: Client's TLS certificate common name.
- `dn`: Client's TLS certificate distinguished name (the subject).
- `clientid`: The original MQTT Client ID.
- `username`: MQTT Client's username.
- `client_attrs.{'{'}NAME{'}'}`: Client attributes initialized by per config `client_attrs_init`.
You can read more about variform expressions in EMQX docs."
+ "desc": "A one line expression to evaluate a set of predefined string functions (like in the rule engine SQL statements).
The expression can be a function call with nested calls as its arguments, or direct variable reference.
So far, it does not provide user-defined variable binding (like `var a=1`) or user-defined functions.
As an example, to extract the prefix of client ID delimited by a dot: `nth(1, tokens(username, '.'))`.
The variables pre-bound variables are:
- `clientid`: The original MQTT Client ID.
- `username`: MQTT Client's username.
- `client_attrs.{'{'}NAME{'}'}`: Client attributes initialized by per config `client_attrs_init`.
For TLS clients, connected directly or via proxy-protocol (v2) enabled load balancer,
some extra variables can be used:
- `cn`: Client's TLS certificate common name.
- `dn`: Client's TLS certificate distinguished name (the subject).
- `peersni`: TLS server name indication sent by the client.
You can read more about variform expressions in EMQX docs."
}
},
"ssl_opts": {
diff --git a/src/schemaText/schema-text-zh.json b/src/schemaText/schema-text-zh.json
index 62325db5c..743a92b6e 100644
--- a/src/schemaText/schema-text-zh.json
+++ b/src/schemaText/schema-text-zh.json
@@ -1309,14 +1309,14 @@
},
"mqtt_client_attrs_init": {
"label": "客户端属性",
- "desc": "在客户端连接时设置自定义属性并将其用于认证、授权等功能中。"
+ "desc": "指定如何初始化客户端属性。
每个客户端属性可以初始化为 `client_attrs.{'{'}NAME{'}'}`,
其中 `{'{'}NAME{'}'}` 是配置字段 `set_as_attr` 中指定的属性名称。
初始化的客户端属性将存储在带有指定名称的 `client_attrs` 属性中,
并可用作渲染挂载点、身份验证和授权请求的模板变量。
例如,当 `set_as_attr = tns` 时,使用 `${'{'}client_attrs.tns{'}'}` 渲染 HTTP POST 正文,
或渲染监听器配置 `moutpoint = ${'{'}client_attrs.tns{'}'}/` 用于主题命名空间。"
},
"client_attrs_init_set_as_attr": {
"label": "属性"
},
"client_attrs_init_expression": {
"label": "属性表达式",
- "desc": "一个行表达式,用于从客户端现有信息中动态提取属性值,可以使用以下字段:
- `clientid`:客户端 ID
- `username`:用户名
- `cn`:TLS 证书的 CN 字段
- `dn`:TLS 证书的 DN 字段
- `user_property.*`:从 MQTT CONNECT 数据包的 `User-Property` 中提取属性值,例如 `user_property.foo`
支持使用预定义的字符串函数对信息进行动态处理。例如,要提取由点分隔的客户端 ID 的前缀:`nth(1, tokens(clientid, '.'))`;要截取用户名部分信息:`substr(username, 0, 5)`。您可以在 EMQX 文档中了解有关 variform 表达式的更多信息。
"
+ "desc": "使用行表达式计算一组预定义的字符串函数(类似于规则引擎 SQL 语句)。
表达式可以是带有嵌套调用参数的函数调用,或直接引用变量。
目前不提供用户自定义变量绑定(如 `var a=1`)或用户自定义函数。
例如,要提取以点分隔的客户端 ID 前缀:`nth(1, tokens(clientid, '.'))`。
预绑定的变量有:
- `clientid`:MQTT 客户端 ID。
- `username`:MQTT 客户端的用户名。
- `user_property.{'{'}NAME{'}'}`:CONNECT 数据包中的用户属性。
对于 TLS 客户端,直接连接或通过支持代理协议(v2)的负载均衡器连接,
可以使用一些额外的变量:
- `cn`:客户端 TLS 证书的通用名称。
- `dn`:客户端 TLS 证书的可分辨名称(主题)。
- `peersni`:客户端发送的 TLS 服务器名称指示。
您可以在 EMQX 文档中阅读更多关于 variform 表达式的信息。"
},
"mqtt_keepalive_check_interval": {
"label": "保活检查间隔",
@@ -1328,7 +1328,7 @@
},
"mqtt_clientid_override": {
"label": "客户端 ID 重写表达式",
- "desc": "单行表达式,用于计算一组预定义字符串函数(如规则引擎 SQL 语句)。
表达式可以是以嵌套调用为参数的函数调用,也可以是直接变量引用。
目前不支持用户自定义变量绑定(如 `var a=1`)或用户自定义函数。
示例:要提取以点号分隔的客户端 ID 的前缀,可使用:`nth(1, tokens(username, '.'))`。
预绑定变量有
- `cn`: 客户端 TLS 证书的通用名称。
- `dn`: 客户端的 TLS 证书标识名称(主体)。
- `clientid`: 原始 MQTT 客户端 ID。
- `username`: MQTT 客户端的用户名。
- `client_attrs.{'{'}NAME{'}'}`: 通过配置 `client_attrs_init` 初始化的客户端属性。
有关可变形式表达式的更多信息,请参阅 EMQX 文档。
"
+ "desc": "使用行表达式计算一组预定义的字符串函数(类似于规则引擎 SQL 语句)。
表达式可以是带有嵌套调用参数的函数调用,或直接引用变量。
目前不提供用户自定义变量绑定(如 `var a=1`)或用户自定义函数。
例如,要提取以点分隔的客户端 ID 前缀:`nth(1, tokens(username, '.'))`。
预绑定的变量有:
- `clientid`:原始 MQTT 客户端 ID。
- `username`:MQTT 客户端的用户名。
- `client_attrs.{'{'}NAME{'}'}`:通过每个配置的 `client_attrs_init` 初始化的客户端属性。
对于 TLS 客户端,直接连接或通过支持代理协议(v2)的负载均衡器连接,
可以使用一些额外的变量:
- `cn`:客户端 TLS 证书的通用名称。
- `dn`:客户端 TLS 证书的可分辨名称(主题)。
- `peersni`:客户端发送的 TLS 服务器名称指示。
您可以在 EMQX 文档中阅读更多关于 variform 表达式的信息。"
}
},
"ssl_opts": {