You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ju...@apache.org on 2020/06/11 09:18:33 UTC

[incubator-apisix-dashboard] branch feat-plugins updated (4e9885c -> 54a33d1)

This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a change to branch feat-plugins
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git.


    from 4e9885c  codes clean
     new bfa0b95  feat: added translation
     new 70f9bd9  feat: added locale for limit-count
     new 54a33d1  feat: added locale for limit-req

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/components/PluginForm/PluginForm.tsx   | 10 +++++-
 src/components/PluginForm/locales/en-US.ts | 13 ++++++++
 src/components/PluginForm/locales/zh-CN.ts | 49 ++++++++++++++++++++++++++++++
 3 files changed, 71 insertions(+), 1 deletion(-)


[incubator-apisix-dashboard] 02/03: feat: added locale for limit-count

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a commit to branch feat-plugins
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git

commit 70f9bd9e5bae5011ff11327031bc800cceee0b67
Author: juzhiyuan <jj...@gmail.com>
AuthorDate: Thu Jun 11 17:13:54 2020 +0800

    feat: added locale for limit-count
---
 src/components/PluginForm/locales/zh-CN.ts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/components/PluginForm/locales/zh-CN.ts b/src/components/PluginForm/locales/zh-CN.ts
index 306505a..f6cef75 100644
--- a/src/components/PluginForm/locales/zh-CN.ts
+++ b/src/components/PluginForm/locales/zh-CN.ts
@@ -35,6 +35,28 @@ export default {
 
   'PluginForm.plugin.limit-count.desc':
     '和 GitHub API 的限速类似, 在指定的时间范围内,限制总的请求个数。并且在 HTTP 响应头中返回剩余可以请求的个数。',
+  'PluginForm.plugin.limit-count.property.count': '单位窗口内请求数量',
+  'PluginForm.plugin.limit-count.property.count.extra': '指定时间窗口内的请求数量阈值',
+  'PluginForm.plugin.limit-count.property.time_window': '时间窗口大小',
+  'PluginForm.plugin.limit-count.property.time_window.extra':
+    '时间窗口的大小(以秒为单位),超过这个时间就会重置',
+  'PluginForm.plugin.limit-count.property.key': 'Key',
+  'PluginForm.plugin.limit-count.property.key.extra': '用来做请求计数的依据',
+  'PluginForm.plugin.limit-count.property.rejected_code': 'HTTP 状态码',
+  'PluginForm.plugin.limit-count.property.rejected_code.extra':
+    '当请求超过阈值被拒绝时,返回的 HTTP 状态码',
+  'PluginForm.plugin.limit-count.property.policy': '策略',
+  'PluginForm.plugin.limit-count.property.policy.extra': '用于检索和增加限制的速率限制策略',
+  'PluginForm.plugin.limit-count.property.redis_host': ' Redis 地址',
+  'PluginForm.plugin.limit-count.property.redis_host.extra': ' Redis 服务节点的地址',
+  'PluginForm.plugin.limit-count.property.redis_port': 'Redis 端口',
+  'PluginForm.plugin.limit-count.property.redis_port.extra': 'Redis 服务节点的端口',
+  'PluginForm.plugin.limit-count.property.redis_password': 'Redis 密码',
+  'PluginForm.plugin.limit-count.property.redis_password.extra': 'Redis 服务节点的密码',
+  'PluginForm.plugin.limit-count.property.redis_timeout': 'Redis 超时时间',
+  'PluginForm.plugin.limit-count.property.redis_timeout.extra':
+    'Redis 服务节点以毫秒为单位的超时时间',
+
   'PluginForm.plugin.limit-req.desc': '限制请求速度的插件,使用的是漏桶算法。',
   'PluginForm.plugin.mqtt-proxy.desc':
     'mqtt-proxy 只工作在流模式,它可以帮助你根据 MQTT 的 client_id 实现动态负载均衡。',


[incubator-apisix-dashboard] 03/03: feat: added locale for limit-req

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a commit to branch feat-plugins
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git

commit 54a33d12f8920352b22aab2a96b8a67db5d3bcf9
Author: juzhiyuan <jj...@gmail.com>
AuthorDate: Thu Jun 11 17:18:05 2020 +0800

    feat: added locale for limit-req
---
 src/components/PluginForm/locales/zh-CN.ts | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/components/PluginForm/locales/zh-CN.ts b/src/components/PluginForm/locales/zh-CN.ts
index f6cef75..5ea1019 100644
--- a/src/components/PluginForm/locales/zh-CN.ts
+++ b/src/components/PluginForm/locales/zh-CN.ts
@@ -29,7 +29,7 @@ export default {
   'PluginForm.plugin.limit-conn.property.key': '关键字',
   'PluginForm.plugin.limit-conn.property.key.extra':
     '用户指定的限制并发级别的关键字,可以是客户端IP或服务端IP。',
-  'PluginForm.plugin.limit-conn.property.rejected_code': '返回状态码',
+  'PluginForm.plugin.limit-conn.property.rejected_code': '错误 HTTP 状态码',
   'PluginForm.plugin.limit-conn.property.rejected_code.extra':
     '当请求超过阈值时返回的 HTTP 状态码, 默认值是503。',
 
@@ -42,9 +42,9 @@ export default {
     '时间窗口的大小(以秒为单位),超过这个时间就会重置',
   'PluginForm.plugin.limit-count.property.key': 'Key',
   'PluginForm.plugin.limit-count.property.key.extra': '用来做请求计数的依据',
-  'PluginForm.plugin.limit-count.property.rejected_code': 'HTTP 状态码',
+  'PluginForm.plugin.limit-count.property.rejected_code': '错误 HTTP 状态码',
   'PluginForm.plugin.limit-count.property.rejected_code.extra':
-    '当请求超过阈值被拒绝时,返回的 HTTP 状态码',
+    '当请求超过阈值时返回的 HTTP 状态码, 默认值是503。',
   'PluginForm.plugin.limit-count.property.policy': '策略',
   'PluginForm.plugin.limit-count.property.policy.extra': '用于检索和增加限制的速率限制策略',
   'PluginForm.plugin.limit-count.property.redis_host': ' Redis 地址',
@@ -58,6 +58,18 @@ export default {
     'Redis 服务节点以毫秒为单位的超时时间',
 
   'PluginForm.plugin.limit-req.desc': '限制请求速度的插件,使用的是漏桶算法。',
+  'PluginForm.plugin.limit-req.property.rate': 'Rate',
+  'PluginForm.plugin.limit-req.property.rate.extra':
+    '指定的请求速率(以秒为单位),请求速率超过 rate 但没有超过 (rate + brust)的请求会被加上延时。',
+  'PluginForm.plugin.limit-req.property.burst': 'Burst',
+  'PluginForm.plugin.limit-req.property.burst.extra':
+    '请求速率超过 (rate + brust)的请求会被直接拒绝。',
+  'PluginForm.plugin.limit-req.property.key': 'Key',
+  'PluginForm.plugin.limit-req.property.key.extra': '用来做请求计数的依据',
+  'PluginForm.plugin.limit-req.property.rejected_code': '错误 HTTP 状态码',
+  'PluginForm.plugin.limit-req.property.rejected_code.extra':
+    '当请求超过阈值时返回的 HTTP 状态码, 默认值是503。',
+
   'PluginForm.plugin.mqtt-proxy.desc':
     'mqtt-proxy 只工作在流模式,它可以帮助你根据 MQTT 的 client_id 实现动态负载均衡。',
   'PluginForm.plugin.oauth.desc':


[incubator-apisix-dashboard] 01/03: feat: added translation

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a commit to branch feat-plugins
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git

commit bfa0b9505db40653ae744968db2363a11bbd44aa
Author: juzhiyuan <jj...@gmail.com>
AuthorDate: Thu Jun 11 17:06:51 2020 +0800

    feat: added translation
---
 src/components/PluginForm/PluginForm.tsx   | 10 +++++++++-
 src/components/PluginForm/locales/en-US.ts | 13 +++++++++++++
 src/components/PluginForm/locales/zh-CN.ts | 15 +++++++++++++++
 3 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/src/components/PluginForm/PluginForm.tsx b/src/components/PluginForm/PluginForm.tsx
index ee3018f..5b69bec 100644
--- a/src/components/PluginForm/PluginForm.tsx
+++ b/src/components/PluginForm/PluginForm.tsx
@@ -108,6 +108,7 @@ const PluginForm: React.FC<PluginForm.Props> = ({
   initialData = {},
   onFinish,
 }) => {
+  const { formatMessage } = useIntl();
   const [schema, setSchema] = useState<PluginForm.PluginSchema>();
 
   useEffect(() => {
@@ -167,7 +168,14 @@ const PluginForm: React.FC<PluginForm.Props> = ({
 
         return (
           <Form.Item
-            label={propertyName}
+            label={formatMessage({
+              id: `PluginForm.plugin.${name}.property.${propertyName}`,
+              defaultMessage: propertyName,
+            })}
+            extra={formatMessage({
+              id: `PluginForm.plugin.${name}.property.${propertyName}.extra`,
+              defaultMessage: '',
+            })}
             name={propertyName}
             key={propertyName}
             rules={transformPropertyToRules(schema!, propertyName, propertyValue)}
diff --git a/src/components/PluginForm/locales/en-US.ts b/src/components/PluginForm/locales/en-US.ts
index fccd889..2c39349 100644
--- a/src/components/PluginForm/locales/en-US.ts
+++ b/src/components/PluginForm/locales/en-US.ts
@@ -17,8 +17,21 @@ export default {
     'kafka-logger is a plugin which works as a Kafka client driver for the ngx_lua nginx module.',
   'PluginForm.plugin.key-auth.desc':
     'key-auth is an authentication plugin, it should work with consumer together.',
+
+  // TODO:
   'PluginForm.plugin.limit-conn.desc':
     'Limiting request concurrency (or concurrent connections) plugin for Apisix.',
+  'PluginForm.plugin.limit-conn.property.burst': '',
+  'PluginForm.plugin.limit-conn.property.burst.extra': '',
+  'PluginForm.plugin.limit-conn.property.conn': '',
+  'PluginForm.plugin.limit-conn.property.conn.extra': '',
+  'PluginForm.plugin.limit-conn.property.default_conn_delay': '',
+  'PluginForm.plugin.limit-conn.property.default_conn_delay.extra': '',
+  'PluginForm.plugin.limit-conn.property.key': '',
+  'PluginForm.plugin.limit-conn.property.key.extra': '',
+  'PluginForm.plugin.limit-conn.property.rejected_code': '',
+  'PluginForm.plugin.limit-conn.property.rejected_code.extra': '',
+
   'PluginForm.plugin.limit-count.desc':
     'Limit request rate by a fixed number of requests in a given time window.',
   'PluginForm.plugin.limit-req.desc': 'limit request rate using the "leaky bucket" method.',
diff --git a/src/components/PluginForm/locales/zh-CN.ts b/src/components/PluginForm/locales/zh-CN.ts
index 95ebd87..306505a 100644
--- a/src/components/PluginForm/locales/zh-CN.ts
+++ b/src/components/PluginForm/locales/zh-CN.ts
@@ -17,7 +17,22 @@ export default {
     'kafka-logger 是一个插件,可用作ngx_lua nginx 模块的 Kafka 客户端驱动程序。',
   'PluginForm.plugin.key-auth.desc':
     'key-auth 是一个认证插件,它需要与 consumer 一起配合才能工作。',
+
   'PluginForm.plugin.limit-conn.desc': 'APISIX 的限制并发请求(或并发连接)插件。',
+  'PluginForm.plugin.limit-conn.property.burst': '最大并发请求数',
+  'PluginForm.plugin.limit-conn.property.burst.extra': '允许的最大并发请求数',
+  'PluginForm.plugin.limit-conn.property.conn': '可延迟并发请求数',
+  'PluginForm.plugin.limit-conn.property.conn.extra': '允许延迟的过多并发请求(或连接)的数量。',
+  'PluginForm.plugin.limit-conn.property.default_conn_delay': '默认请求延迟时间',
+  'PluginForm.plugin.limit-conn.property.default_conn_delay.extra':
+    '默认的典型连接(或请求)的处理延迟时间。',
+  'PluginForm.plugin.limit-conn.property.key': '关键字',
+  'PluginForm.plugin.limit-conn.property.key.extra':
+    '用户指定的限制并发级别的关键字,可以是客户端IP或服务端IP。',
+  'PluginForm.plugin.limit-conn.property.rejected_code': '返回状态码',
+  'PluginForm.plugin.limit-conn.property.rejected_code.extra':
+    '当请求超过阈值时返回的 HTTP 状态码, 默认值是503。',
+
   'PluginForm.plugin.limit-count.desc':
     '和 GitHub API 的限速类似, 在指定的时间范围内,限制总的请求个数。并且在 HTTP 响应头中返回剩余可以请求的个数。',
   'PluginForm.plugin.limit-req.desc': '限制请求速度的插件,使用的是漏桶算法。',