diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 9b300c065..bbabfe678 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -109,6 +109,7 @@ "SHENYU.HYSTRIX.TRIPPING.SLEEPTIME": "Sleep(ms)", "SHENYU.HYSTRIX.MAX.CONCURRENCY": "MaxConcurrentRequests", "SHENYU.HYSTRIX.ERROR.PERCENT": "ErrorThresholdPercentage", + "SHENYU.HYSTRIX.TIMEOUT": "Timeout(ms)", "SHENYU.HYSTRIX.TRIPPING.REQUEST.NUMBER": "MinimumRequests", "SHENYU.HYSTRIX.LSOLATION.MODE": "IsolationMode", "SHENYU.HYSTRIX.LSOLATION.SELECT": "Select Quarantine Mode", diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json index 06988269a..e457a42a3 100644 --- a/src/locales/zh-CN.json +++ b/src/locales/zh-CN.json @@ -109,6 +109,7 @@ "SHENYU.HYSTRIX.TRIPPING.SLEEPTIME": "跳闸休眠时间(ms)", "SHENYU.HYSTRIX.MAX.CONCURRENCY": "最大并发量", "SHENYU.HYSTRIX.ERROR.PERCENT": "错误百分比阀值", + "SHENYU.HYSTRIX.TIMEOUT": "超时时间(ms)", "SHENYU.HYSTRIX.TRIPPING.REQUEST.NUMBER": "跳闸最小请求数量", "SHENYU.HYSTRIX.LSOLATION.MODE": "隔离模式", "SHENYU.HYSTRIX.LSOLATION.SELECT": "请选择隔离模式", diff --git a/src/routes/Plugin/PluginRuleHandle/HystrixRuleHandle.js b/src/routes/Plugin/PluginRuleHandle/HystrixRuleHandle.js index 43c35e633..2f71f6e19 100644 --- a/src/routes/Plugin/PluginRuleHandle/HystrixRuleHandle.js +++ b/src/routes/Plugin/PluginRuleHandle/HystrixRuleHandle.js @@ -37,6 +37,7 @@ export default class HystrixRuleHandle extends Component { errorThresholdPercentage = "50", maxConcurrentRequests = "100", sleepWindowInMilliseconds = "5000", + timeout = "3000", groupKey = "", commandKey = "", callBackUri="", @@ -52,6 +53,7 @@ export default class HystrixRuleHandle extends Component { errorThresholdPercentage = myHandle.errorThresholdPercentage; maxConcurrentRequests = myHandle.maxConcurrentRequests; sleepWindowInMilliseconds = myHandle.sleepWindowInMilliseconds; + timeout = myHandle.timeout groupKey = myHandle.groupKey; commandKey = myHandle.commandKey; if (typeof(myHandle.executionIsolationStrategy) !== 'undefined' ) { @@ -67,6 +69,7 @@ export default class HystrixRuleHandle extends Component { errorThresholdPercentage, maxConcurrentRequests, sleepWindowInMilliseconds, + timeout, groupKey, commandKey, executionIsolationStrategy, @@ -81,6 +84,7 @@ export default class HystrixRuleHandle extends Component { errorThresholdPercentage, maxConcurrentRequests, sleepWindowInMilliseconds, + timeout, groupKey, commandKey, executionIsolationStrategy, @@ -95,6 +99,7 @@ export default class HystrixRuleHandle extends Component { maxConcurrentRequests > 0 ? maxConcurrentRequests : "0"; const mySleepWindowInMilliseconds = sleepWindowInMilliseconds > 0 ? sleepWindowInMilliseconds : "0"; + const myTimeout = timeout>0?timeout:"3000" const myCoreSize = hystrixThreadPoolConfig.coreSize > 0 ? hystrixThreadPoolConfig.coreSize : "0"; const myMaximumSize = hystrixThreadPoolConfig.maximumSize > 0 ? hystrixThreadPoolConfig.maximumSize : "0"; const myMaxQueueSize = hystrixThreadPoolConfig.maxQueueSize > 0 ? hystrixThreadPoolConfig.maxQueueSize : "0"; @@ -102,6 +107,7 @@ export default class HystrixRuleHandle extends Component { requestVolumeThreshold: myRequestVolumeThreshold, errorThresholdPercentage: myErrorThresholdPercentage, sleepWindowInMilliseconds: mySleepWindowInMilliseconds, + timeout:myTimeout, executionIsolationStrategy, callBackUri, groupKey, @@ -139,6 +145,7 @@ export default class HystrixRuleHandle extends Component { errorThresholdPercentage, maxConcurrentRequests, sleepWindowInMilliseconds, + timeout, groupKey, commandKey, executionIsolationStrategy, @@ -213,6 +220,21 @@ export default class HystrixRuleHandle extends Component { }} /> +
  • + {getIntlContent("SHENYU.HYSTRIX.TIMEOUT")}} + value={timeout} + placeholder="timeout" + onChange={e => { + const value = e.target.value; + this.onHandleNumberChange( + "timeout", + value + ); + }} + /> +
  • { this.state.executionIsolationStrategy === 1&&(