From 31bbe835f229fa8687313437cf81306949cf273f Mon Sep 17 00:00:00 2001 From: xlsea Date: Tue, 30 Jul 2024 16:16:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B7=AF=E7=94=B1=E7=AD=96=E7=95=A5?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=AC=AC=E4=B8=80=E4=B8=AA=E5=92=8C=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/business.ts | 4 +++- src/locales/langs/en-us.ts | 4 +++- src/locales/langs/zh-cn.ts | 4 +++- src/typings/api.d.ts | 4 ++-- src/typings/app.d.ts | 2 ++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/constants/business.ts b/src/constants/business.ts index 62e4b7e..9d2286c 100644 --- a/src/constants/business.ts +++ b/src/constants/business.ts @@ -112,7 +112,9 @@ export const routeKeyRecord: Record = { 1: 'common.routeKey.items.consistentHash', 2: 'common.routeKey.items.random', 3: 'common.routeKey.items.lru', - 4: 'common.routeKey.items.round' + 4: 'common.routeKey.items.round', + 5: 'common.routeKey.items.first', + 6: 'common.routeKey.items.last' }; export const routeKeyRecordOptions = transformRecordToNumberOption(routeKeyRecord, true); diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index ee49584..4bfe1f7 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -107,7 +107,9 @@ const local: App.I18n.Schema = { consistentHash: 'Consistent hash', random: 'Random', lru: 'LRU', - round: 'Round robin' + round: 'Round robin', + first: 'First', + last: 'Last' } }, blockStrategy: { diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index dc89250..4017790 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -107,7 +107,9 @@ const local: App.I18n.Schema = { consistentHash: '一致性哈希', random: '随机', lru: 'LRU', - round: '轮询' + round: '轮询', + first: '第一个', + last: '最后一个' } }, blockStrategy: { diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index c4a2b20..e5cccd1 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -70,8 +70,8 @@ declare namespace Api { status?: EnableStatus | null; } & T; - /** 1: 一致性Hash 2: 随机 3: LRU 4: 轮询 */ - type RouteKey = 1 | 2 | 3 | 4; + /** 1: 一致性Hash 2: 随机 3: LRU 4: 轮询 5: 第一个 6: 最后一个 */ + type RouteKey = 1 | 2 | 3 | 4 | 5 | 6; /** 阻塞策略 1:丢弃 2:覆盖 3:并行 4:恢复 */ type BlockStrategy = 1 | 2 | 3 | 4; diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index 4e42dc5..709ccbb 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -387,6 +387,8 @@ declare namespace App { random: string; lru: string; round: string; + first: string; + last: string; }; }; blockStrategy: {