From 3ae22161c22bad4b3c92fbffe358ce38e080ce5a Mon Sep 17 00:00:00 2001 From: ndi-trip <131156346+ndi-trip@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:13:09 +0800 Subject: [PATCH] bugfix/fix console portal npe&add credis hetero type (#741) --- .../com/ctrip/xpipe/api/migration/OuterClientService.java | 6 ++++++ .../redis/console/service/impl/DcClusterServiceImpl.java | 4 +++- .../redis-console/src/main/resources/static/dist/bundle.js | 2 +- .../src/main/resources/static/scripts/ClusterType.ts | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/ctrip/xpipe/api/migration/OuterClientService.java b/core/src/main/java/com/ctrip/xpipe/api/migration/OuterClientService.java index ddb8b61b4..ab80f16a2 100644 --- a/core/src/main/java/com/ctrip/xpipe/api/migration/OuterClientService.java +++ b/core/src/main/java/com/ctrip/xpipe/api/migration/OuterClientService.java @@ -692,6 +692,12 @@ public com.ctrip.xpipe.cluster.ClusterType innerType() { public com.ctrip.xpipe.cluster.ClusterType innerType() { return com.ctrip.xpipe.cluster.ClusterType.CROSS_DC; } + }, + HETERO(6) { + @Override + public com.ctrip.xpipe.cluster.ClusterType innerType() { + return com.ctrip.xpipe.cluster.ClusterType.HETERO; + } }; private Integer intVal; diff --git a/redis/redis-console/src/main/java/com/ctrip/xpipe/redis/console/service/impl/DcClusterServiceImpl.java b/redis/redis-console/src/main/java/com/ctrip/xpipe/redis/console/service/impl/DcClusterServiceImpl.java index 03752250b..e4547b854 100644 --- a/redis/redis-console/src/main/java/com/ctrip/xpipe/redis/console/service/impl/DcClusterServiceImpl.java +++ b/redis/redis-console/src/main/java/com/ctrip/xpipe/redis/console/service/impl/DcClusterServiceImpl.java @@ -241,7 +241,9 @@ public DcClusterModel findDcClusterModelByClusterAndDc(String clusterName, Strin result.setShards(shardModelService.getAllShardModel(dcName, clusterName)); ClusterType azGroupType = azGroupClusterRepository.selectAzGroupTypeById(dcClusterTbl.getAzGroupClusterId()); - result.setAzGroupClusterType(azGroupType.name()); + if (azGroupType != null) { + result.setAzGroupClusterType(azGroupType.name()); + } if (azGroupType == ClusterType.SINGLE_DC) { result.setSources(sourceModelService.getAllSourceModels(dcName, clusterName)); } diff --git a/redis/redis-console/src/main/resources/static/dist/bundle.js b/redis/redis-console/src/main/resources/static/dist/bundle.js index 3bd6a7fcf..12e3bbae6 100644 --- a/redis/redis-console/src/main/resources/static/dist/bundle.js +++ b/redis/redis-console/src/main/resources/static/dist/bundle.js @@ -8962,7 +8962,7 @@ eval("angular\n .module('utils')\n .service('AppUtil', AppUtil);\nAppUtil. \********************************/ /***/ (() => { -eval("angular\n .module('cluster_type')\n .service('ClusterType', ClusterType);\nfunction ClusterType() {\n return {\n _values: {\n 'one_way': {\n name: '单向同步',\n value: 'one_way',\n multiActiveDcs: false,\n useKeeper: true,\n healthCheck: true,\n supportMigration: true,\n isCrossDc: false,\n supportApplier: false,\n useAzGroupType: false,\n },\n 'bi_direction': {\n name: '双向同步',\n value: 'bi_direction',\n multiActiveDcs: true,\n useKeeper: false,\n healthCheck: true,\n supportMigration: false,\n isCrossDc: false,\n supportApplier: false,\n useAzGroupType: false,\n },\n 'single_dc': {\n name: '单机房缓存',\n value: 'single_dc',\n multiActiveDcs: false,\n useKeeper: false,\n healthCheck: false,\n supportMigration: false,\n isCrossDc: false,\n supportApplier: false,\n useAzGroupType: false,\n },\n 'local_dc': {\n name: '本机房缓存',\n value: 'local_dc',\n multiActiveDcs: true,\n useKeeper: false,\n healthCheck: false,\n supportMigration: false,\n isCrossDc: false,\n supportApplier: false,\n useAzGroupType: false,\n },\n 'cross_dc': {\n name: '跨机房缓存',\n value: 'cross_dc',\n multiActiveDcs: true,\n useKeeper: false,\n healthCheck: false,\n supportMigration: false,\n isCrossDc: true,\n supportApplier: false,\n useAzGroupType: false,\n },\n 'hetero': {\n name: '异构',\n value: 'hetero',\n multiActiveDcs: false,\n useKeeper: true,\n healthCheck: true,\n supportMigration: true,\n isCrossDc: true,\n supportApplier: false,\n useAzGroupType: true,\n }\n },\n lookup: function (typeName) {\n return (typeName && this._values[typeName.toLowerCase()]) || null;\n },\n values: function () {\n return Object.values(this._values);\n },\n selectData: function () {\n var data = [{ id: \"\", title: \"\" }];\n for (var key in this._values) {\n data.push({\n id: this._values[key].value,\n title: this._values[key].name\n });\n }\n return data;\n },\n default: function () {\n return this._values.one_way;\n }\n };\n}\n\n\n//# sourceURL=webpack://XPipe-Console/./scripts/ClusterType.ts?"); +eval("angular\n .module('cluster_type')\n .service('ClusterType', ClusterType);\nfunction ClusterType() {\n return {\n _values: {\n 'one_way': {\n name: '单向同步',\n value: 'one_way',\n multiActiveDcs: false,\n useKeeper: true,\n healthCheck: true,\n supportMigration: true,\n isCrossDc: false,\n supportApplier: false,\n useAzGroupType: false,\n },\n 'bi_direction': {\n name: '双向同步',\n value: 'bi_direction',\n multiActiveDcs: true,\n useKeeper: false,\n healthCheck: true,\n supportMigration: false,\n isCrossDc: false,\n supportApplier: false,\n useAzGroupType: false,\n },\n 'single_dc': {\n name: '单机房缓存',\n value: 'single_dc',\n multiActiveDcs: false,\n useKeeper: false,\n healthCheck: false,\n supportMigration: false,\n isCrossDc: false,\n supportApplier: false,\n useAzGroupType: false,\n },\n 'local_dc': {\n name: '本机房缓存',\n value: 'local_dc',\n multiActiveDcs: true,\n useKeeper: false,\n healthCheck: false,\n supportMigration: false,\n isCrossDc: false,\n supportApplier: false,\n useAzGroupType: false,\n },\n 'cross_dc': {\n name: '跨机房缓存',\n value: 'cross_dc',\n multiActiveDcs: true,\n useKeeper: false,\n healthCheck: false,\n supportMigration: false,\n isCrossDc: true,\n supportApplier: false,\n useAzGroupType: false,\n },\n 'hetero': {\n name: '异构',\n value: 'hetero',\n multiActiveDcs: false,\n useKeeper: true,\n healthCheck: true,\n supportMigration: true,\n isCrossDc: false,\n supportApplier: false,\n useAzGroupType: true,\n }\n },\n lookup: function (typeName) {\n return (typeName && this._values[typeName.toLowerCase()]) || null;\n },\n values: function () {\n return Object.values(this._values);\n },\n selectData: function () {\n var data = [{ id: \"\", title: \"\" }];\n for (var key in this._values) {\n data.push({\n id: this._values[key].value,\n title: this._values[key].name\n });\n }\n return data;\n },\n default: function () {\n return this._values.one_way;\n }\n };\n}\n\n\n//# sourceURL=webpack://XPipe-Console/./scripts/ClusterType.ts?"); /***/ }), diff --git a/redis/redis-console/src/main/resources/static/scripts/ClusterType.ts b/redis/redis-console/src/main/resources/static/scripts/ClusterType.ts index 2193c6bc9..c2cb50104 100644 --- a/redis/redis-console/src/main/resources/static/scripts/ClusterType.ts +++ b/redis/redis-console/src/main/resources/static/scripts/ClusterType.ts @@ -67,7 +67,7 @@ function ClusterType() { useKeeper: true, healthCheck: true, supportMigration: true, - isCrossDc:true, + isCrossDc:false, supportApplier:false, useAzGroupType:true, }