From 45eae0c99ff89d99eecac4d463ab8c8eecb1d3bb Mon Sep 17 00:00:00 2001 From: tanghc Date: Thu, 11 Jun 2020 19:01:45 +0800 Subject: [PATCH] 3.2.0 --- changelog.md | 6 + sop-admin/sop-admin-server/pom.xml | 61 ++++-- .../SopAdminServerApplication.java | 2 + .../src/main/resources/public/index.html | 2 +- .../static/js/chunk-9f479afe.4609bf8b.js | 1 + .../static/js/chunk-9f479afe.51cf2439.js | 1 - .../src/views/service/serviceList.vue | 3 +- sop-auth/pom.xml | 70 ++++--- sop-common/pom.xml | 151 +++++++------- sop-common/sop-bridge-gateway/pom.xml | 6 +- sop-common/sop-bridge-zuul/pom.xml | 6 +- sop-common/sop-gateway-common/pom.xml | 42 ++-- .../gatewaycommon/bean/RouteDefinition.java | 3 + .../GatewayModifyResponseGatewayFilter.java | 2 +- .../gateway/filter/IndexFilter.java | 2 +- .../loadbalancer/NacosServerIntrospector.java | 2 +- .../gateway/route/GatewayRouteRepository.java | 6 +- .../manager/NacosEventProcessor.java | 119 ----------- .../manager/ServiceRoutesLoader.java | 183 ----------------- .../route/BaseRegistryListener.java | 1 + .../route/EurekaRegistryListener.java | 9 +- .../route/NacosRegistryListener.java | 113 ++++++++--- .../gatewaycommon/route/ServiceHolder.java | 11 ++ sop-common/sop-service-common/pom.xml | 25 ++- .../manager/RedisApiMetaManager.java | 30 --- sop-example/pom.xml | 2 - sop-example/readme.md | 4 +- sop-example/sop-book/pom.xml | 15 -- sop-example/sop-book/sop-book-api/.gitignore | 25 --- sop-example/sop-book/sop-book-api/pom.xml | 46 ----- .../java/com/gitee/book/api/domain/Book.java | 12 -- .../gitee/book/api/service/BookService.java | 14 -- sop-example/sop-book/sop-book-web/.gitignore | 25 --- sop-example/sop-book/sop-book-web/pom.xml | 147 -------------- .../gitee/sop/bookweb/SopBookApplication.java | 20 -- .../sop/bookweb/config/OpenServiceConfig.java | 33 ---- .../consumer/StoryServiceConsumer.java | 14 -- .../controller/AlipayBookController.java | 55 ------ .../sop/bookweb/controller/ApiResult.java | 72 ------- .../bookweb/controller/BookController.java | 73 ------- .../controller/DubboConsumerController.java | 40 ---- .../gitee/sop/bookweb/param/BookParam.java | 16 -- .../java/com/gitee/sop/bookweb/vo/BookVO.java | 16 -- .../main/resources/application-dev.properties | 16 -- .../sop/bookweb/SopBookApplicationTests.java | 17 -- sop-example/sop-easyopen/.gitignore | 25 --- sop-example/sop-easyopen/pom.xml | 126 ------------ sop-example/sop-easyopen/readme.md | 31 --- .../easyopen/server/IndexController.java | 25 --- .../server/SopEasyopenApplication.java | 14 -- .../gitee/easyopen/server/api/Goods2Api.java | 31 --- .../gitee/easyopen/server/api/GoodsApi.java | 31 --- .../easyopen/server/api/param/GoodsParam.java | 23 --- .../easyopen/server/api/result/Goods.java | 46 ----- .../easyopen/server/config/CorsConfig.java | 37 ---- .../easyopen/server/config/SopConfig.java | 28 --- .../server/interceptor/LogInterceptor.java | 23 --- .../easyopen/server/message/CommonErrors.java | 16 -- .../main/resources/application-dev.properties | 7 - .../src/main/resources/application.properties | 1 - .../resources/i18n/isv/error_zh_CN.properties | 2 - ...opEasyopenApplicationApplicationTests.java | 16 -- sop-example/sop-springmvc/pom.xml | 2 +- sop-example/sop-story/pom.xml | 138 +++++++++++-- .../sop-story/sop-story-api/.gitignore | 25 --- sop-example/sop-story/sop-story-api/pom.xml | 46 ----- .../com/gitee/sop/story/api/domain/Story.java | 18 -- .../gitee/sop/story/api/param/DemoParam.java | 14 -- .../sop/story/api/result/DemoResult.java | 15 -- .../sop/story/api/service/DemoService.java | 17 -- .../sop/story/api/service/StoryService.java | 15 -- .../sop-story/sop-story-web/.gitignore | 25 --- sop-example/sop-story/sop-story-web/pom.xml | 140 ------------- .../storyweb/controller/StoryController.java | 23 --- .../controller/StoryDemoController.java | 21 -- .../storyweb/service/DefaultDemoService.java | 32 --- .../src/main/resources/application.properties | 1 - .../sop/storyweb/SopStoryApplication.java | 0 .../storyweb/config/OpenServiceConfig.java | 0 .../storyweb/controller/AlipayController.java | 12 -- .../controller/AlipayController2.java | 0 .../controller/DownloadController.java | 0 .../controller/FileUploadDemoController.java | 0 .../controller/JSR303DemoController.java | 0 .../controller/PermissionDemoController.java | 1 - .../controller/PostJsonController.java | 24 +-- .../ThrowExceptionDemoController.java | 0 .../storyweb/controller/TokenController.java | 0 .../TraditionalWebappController.java | 0 .../controller/param/CategoryParam.java | 0 .../controller/param/FileUploadParam.java | 0 .../controller/param/FileUploadParam2.java | 0 .../storyweb/controller/param/GoodsParam.java | 0 .../controller/param/GoodsUpdateParam.java | 0 .../storyweb/controller/param/StoryParam.java | 0 .../controller/result/CategoryResult.java | 0 .../controller/result/FileUploadResult.java | 0 .../controller/result/StoryResult.java | 0 .../controller/result/TreeResult.java | 0 .../sop/storyweb/message/GoodsErrorEnum.java | 0 .../sop/storyweb/message/StoryErrorEnum.java | 0 .../main/resources/application-dev.properties | 7 - .../src/main/resources/application.properties | 0 .../resources/i18n/isp/bizerror_en.properties | 0 .../i18n/isp/bizerror_zh_CN.properties | 0 .../i18n/isp/goods_error_en.properties | 0 .../i18n/isp/goods_error_zh_CN.properties | 0 .../storyweb/SopStoryApplicationTests.java | 0 sop-gateway/pom.xml | 87 ++++---- .../gitee/sop/test/AlipayClientPostTest.java | 108 ---------- .../java/com/gitee/sop/test/AllInOneTest.java | 27 --- .../com/gitee/sop/test/DubboDemoTest.java | 58 ------ .../sop/test/EasyopenClientPostTest.java | 92 --------- .../java/com/gitee/sop/test/PostFormTest.java | 56 ------ .../java/com/gitee/sop/test/PostJsonTest.java | 90 --------- .../java/com/gitee/sop/test/RestUrlTest.java | 61 ------ .../SpringCloudGatewayClientPostTest.java | 185 ------------------ .../com/gitee/sop/test/StoryDemoTest.java | 87 -------- .../gitee/sop/test/TaobaoClientPostTest.java | 68 ------- sop-website/pom.xml | 32 ++- 120 files changed, 536 insertions(+), 2992 deletions(-) create mode 100644 sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9f479afe.4609bf8b.js delete mode 100644 sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9f479afe.51cf2439.js delete mode 100644 sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/NacosEventProcessor.java delete mode 100644 sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/ServiceRoutesLoader.java create mode 100644 sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/route/ServiceHolder.java delete mode 100644 sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/RedisApiMetaManager.java delete mode 100644 sop-example/sop-book/pom.xml delete mode 100644 sop-example/sop-book/sop-book-api/.gitignore delete mode 100644 sop-example/sop-book/sop-book-api/pom.xml delete mode 100644 sop-example/sop-book/sop-book-api/src/main/java/com/gitee/book/api/domain/Book.java delete mode 100644 sop-example/sop-book/sop-book-api/src/main/java/com/gitee/book/api/service/BookService.java delete mode 100644 sop-example/sop-book/sop-book-web/.gitignore delete mode 100644 sop-example/sop-book/sop-book-web/pom.xml delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/SopBookApplication.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/config/OpenServiceConfig.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/consumer/StoryServiceConsumer.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/AlipayBookController.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/ApiResult.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/BookController.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/DubboConsumerController.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/param/BookParam.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/vo/BookVO.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/resources/application-dev.properties delete mode 100644 sop-example/sop-book/sop-book-web/src/test/java/com/gitee/sop/bookweb/SopBookApplicationTests.java delete mode 100644 sop-example/sop-easyopen/.gitignore delete mode 100644 sop-example/sop-easyopen/pom.xml delete mode 100644 sop-example/sop-easyopen/readme.md delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/IndexController.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/SopEasyopenApplication.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/Goods2Api.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/GoodsApi.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/param/GoodsParam.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/result/Goods.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/config/CorsConfig.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/config/SopConfig.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/interceptor/LogInterceptor.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/message/CommonErrors.java delete mode 100644 sop-example/sop-easyopen/src/main/resources/application-dev.properties delete mode 100644 sop-example/sop-easyopen/src/main/resources/application.properties delete mode 100644 sop-example/sop-easyopen/src/main/resources/i18n/isv/error_zh_CN.properties delete mode 100644 sop-example/sop-easyopen/src/test/java/com/gitee/sop/adminserver/SopEasyopenApplicationApplicationTests.java delete mode 100644 sop-example/sop-story/sop-story-api/.gitignore delete mode 100644 sop-example/sop-story/sop-story-api/pom.xml delete mode 100644 sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/domain/Story.java delete mode 100644 sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/param/DemoParam.java delete mode 100644 sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/result/DemoResult.java delete mode 100644 sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/service/DemoService.java delete mode 100644 sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/service/StoryService.java delete mode 100644 sop-example/sop-story/sop-story-web/.gitignore delete mode 100644 sop-example/sop-story/sop-story-web/pom.xml delete mode 100644 sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/StoryController.java delete mode 100644 sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/StoryDemoController.java delete mode 100644 sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/service/DefaultDemoService.java delete mode 100644 sop-example/sop-story/sop-story-web/src/main/resources/application.properties rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/SopStoryApplication.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/config/OpenServiceConfig.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/AlipayController.java (95%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/AlipayController2.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/DownloadController.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/FileUploadDemoController.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/JSR303DemoController.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/PermissionDemoController.java (94%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/PostJsonController.java (63%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/ThrowExceptionDemoController.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/TokenController.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/TraditionalWebappController.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/param/CategoryParam.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/param/FileUploadParam.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/param/FileUploadParam2.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/param/GoodsParam.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/param/GoodsUpdateParam.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/param/StoryParam.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/result/CategoryResult.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/result/FileUploadResult.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/result/StoryResult.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/result/TreeResult.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/message/GoodsErrorEnum.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/message/StoryErrorEnum.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/resources/application-dev.properties (80%) rename sop-example/{sop-book/sop-book-web => sop-story}/src/main/resources/application.properties (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/resources/i18n/isp/bizerror_en.properties (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/resources/i18n/isp/bizerror_zh_CN.properties (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/resources/i18n/isp/goods_error_en.properties (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/resources/i18n/isp/goods_error_zh_CN.properties (100%) rename sop-example/sop-story/{sop-story-web => }/src/test/java/com/gitee/sop/storyweb/SopStoryApplicationTests.java (100%) delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/DubboDemoTest.java delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/EasyopenClientPostTest.java delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/PostFormTest.java delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/PostJsonTest.java delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/RestUrlTest.java delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/SpringCloudGatewayClientPostTest.java delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/StoryDemoTest.java delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/TaobaoClientPostTest.java diff --git a/changelog.md b/changelog.md index ebe0cbb8..19f075e6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # changelog +## 3.2.0 + +- 使用alibaba cloud + +Hoxton.SR3(Spring Cloud Version), 2.2.1.RELEASE(Spring Cloud Alibaba Version), 2.2.5.RELEASE(Spring Boot Version) + ## 3.1.5 修复文件上传大小不一致问题 diff --git a/sop-admin/sop-admin-server/pom.xml b/sop-admin/sop-admin-server/pom.xml index bcd2e93e..32f4ac06 100644 --- a/sop-admin/sop-admin-server/pom.xml +++ b/sop-admin/sop-admin-server/pom.xml @@ -2,6 +2,12 @@ 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.2.5.RELEASE + + com.gitee.sop sop-admin-server 1.0.0-SNAPSHOT @@ -10,32 +16,51 @@ sop-admin-server sop-admin-server - - org.springframework.boot - spring-boot-starter-parent - 2.1.4.RELEASE - - - + 1.8 UTF-8 UTF-8 - 1.8 3.11.0 - - 0.2.3 + + 2.2.5.RELEASE + + Hoxton.SR3 + + + 2.2.1.RELEASE + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + com.alibaba.cloud + spring-cloud-alibaba-dependencies + ${spring-cloud-alibaba.version} + pom + import + + + + - com.alibaba.boot - nacos-config-spring-boot-starter - ${nacos-spring-boot-starter.version} - - - com.alibaba.boot - nacos-discovery-spring-boot-starter - ${nacos-spring-boot-starter.version} + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/SopAdminServerApplication.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/SopAdminServerApplication.java index e388660d..52bf77ac 100644 --- a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/SopAdminServerApplication.java +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/SopAdminServerApplication.java @@ -2,7 +2,9 @@ package com.gitee.sop.adminserver; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +@EnableDiscoveryClient @SpringBootApplication public class SopAdminServerApplication { diff --git a/sop-admin/sop-admin-server/src/main/resources/public/index.html b/sop-admin/sop-admin-server/src/main/resources/public/index.html index 69e80a53..9375a706 100644 --- a/sop-admin/sop-admin-server/src/main/resources/public/index.html +++ b/sop-admin/sop-admin-server/src/main/resources/public/index.html @@ -1 +1 @@ -SOP Admin
\ No newline at end of file +SOP Admin
\ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9f479afe.4609bf8b.js b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9f479afe.4609bf8b.js new file mode 100644 index 00000000..eb8f7b8d --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9f479afe.4609bf8b.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-9f479afe"],{"02f4":function(e,t,n){var r=n("4588"),o=n("be13");e.exports=function(e){return function(t,n){var i,a,s=String(o(t)),l=r(n),c=s.length;return l<0||l>=c?e?"":void 0:(i=s.charCodeAt(l),i<55296||i>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):i:e?s.slice(l,l+2):a-56320+(i-55296<<10)+65536)}}},"0390":function(e,t,n){"use strict";var r=n("02f4")(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},"0bfb":function(e,t,n){"use strict";var r=n("cb7c");e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},"214f":function(e,t,n){"use strict";n("b0c5");var r=n("2aba"),o=n("32e9"),i=n("79e5"),a=n("be13"),s=n("2b4c"),l=n("520a"),c=s("species"),u=!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}),f=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var d=s(e),v=!i(function(){var t={};return t[d]=function(){return 7},7!=""[e](t)}),p=v?!i(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[c]=function(){return n}),n[d](""),!t}):void 0;if(!v||!p||"replace"===e&&!u||"split"===e&&!f){var g=/./[d],y=n(a,d,""[e],function(e,t,n,r,o){return t.exec===l?v&&!o?{done:!0,value:g.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),h=y[0],m=y[1];r(String.prototype,e,h),o(RegExp.prototype,d,2==t?function(e,t){return m.call(e,this,t)}:function(e){return m.call(e,this)})}}},"28a5":function(e,t,n){"use strict";var r=n("aae3"),o=n("cb7c"),i=n("ebd6"),a=n("0390"),s=n("9def"),l=n("5f1b"),c=n("520a"),u=n("79e5"),f=Math.min,d=[].push,v="split",p="length",g="lastIndex",y=4294967295,h=!u(function(){RegExp(y,"y")});n("214f")("split",2,function(e,t,n,u){var m;return m="c"=="abbc"[v](/(b)*/)[1]||4!="test"[v](/(?:)/,-1)[p]||2!="ab"[v](/(?:ab)*/)[p]||4!="."[v](/(.?)(.?)/)[p]||"."[v](/()()/)[p]>1||""[v](/.?/)[p]?function(e,t){var o=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(o,e,t);var i,a,s,l=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,v=void 0===t?y:t>>>0,h=new RegExp(e.source,u+"g");while(i=c.call(h,o)){if(a=h[g],a>f&&(l.push(o.slice(f,i.index)),i[p]>1&&i.index=v))break;h[g]===i.index&&h[g]++}return f===o[p]?!s&&h.test("")||l.push(""):l.push(o.slice(f)),l[p]>v?l.slice(0,v):l}:"0"[v](void 0,0)[p]?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var o=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,o,r):m.call(String(o),n,r)},function(e,t){var r=u(m,e,this,t,m!==n);if(r.done)return r.value;var c=o(e),d=String(this),v=i(c,RegExp),p=c.unicode,g=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(h?"y":"g"),b=new v(h?c:"^(?:"+c.source+")",g),_=void 0===t?y:t>>>0;if(0===_)return[];if(0===d.length)return null===l(b,d)?[d]:[];var w=0,x=0,I=[];while(x1&&i.call(a[0],n,function(){for(u=1;u0&&"pre"===t.row.metadata.env?n("el-tag",{attrs:{type:"warning"}},[e._v("预发布")]):e._e(),e._v(" "),t.row.parentId>0&&"gray"===t.row.metadata.env?n("el-tag",{attrs:{type:"info"}},[e._v("灰度")]):e._e(),e._v(" "),t.row.parentId>0&&!t.row.metadata.env?n("el-tag",{attrs:{type:"success"}},[e._v("线上")]):e._e()],1):e._e()]}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"metadata",label:"metadata",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.parentId>0?n("span",[e._v(e._s(JSON.stringify(t.row.metadata)))]):e._e()]}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"status",label:"服务状态",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.parentId>0&&"UP"===t.row.status?n("el-tag",{attrs:{type:"success"}},[e._v("正常")]):e._e(),e._v(" "),t.row.parentId>0&&"STARTING"===t.row.status?n("el-tag",{attrs:{type:"info"}},[e._v("正在启动")]):e._e(),e._v(" "),t.row.parentId>0&&"UNKNOWN"===t.row.status?n("el-tag",[e._v("未知")]):e._e(),e._v(" "),t.row.parentId>0&&("OUT_OF_SERVICE"===t.row.status||"DOWN"===t.row.status)?n("el-tag",{attrs:{type:"danger"}},[e._v("已禁用")]):e._e()]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"操作",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[e.blackList.indexOf(t.row.serviceId.toLowerCase())<0?n("div",[0===t.row.parentId?n("div",[n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onGrayConfigUpdate(t.row)}}},[e._v("设置灰度参数")])],1):e._e(),e._v(" "),t.row.parentId>0?n("div",["UP"===t.row.status?n("span",["pre"===t.row.metadata.env?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvPreClose(t.row)}}},[e._v("结束预发布")]):e._e(),e._v(" "),"gray"===t.row.metadata.env?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvGrayClose(t.row)}}},[e._v("结束灰度")]):e._e(),e._v(" "),t.row.metadata.env?e._e():n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvPreOpen(t.row)}}},[e._v("开启预发布")]),e._v(" "),t.row.metadata.env?e._e():n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvGrayOpen(t.row)}}},[e._v("开启灰度")])],1):e._e(),e._v(" "),n("span",{staticStyle:{"margin-left":"10px"}},["UP"===t.row.status?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onDisable(t.row)}}},[e._v("禁用")]):e._e(),e._v(" "),"OUT_OF_SERVICE"===t.row.status?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnable(t.row)}}},[e._v("启用")]):e._e()],1)]):e._e()]):e._e()]}}])})],1),e._v(" "),n("el-dialog",{attrs:{title:"灰度设置",visible:e.grayDialogVisible,"close-on-click-modal":!1},on:{"update:visible":function(t){e.grayDialogVisible=t},close:function(t){return e.resetForm("grayForm")}}},[n("el-form",{ref:"grayForm",attrs:{model:e.grayForm,rules:e.grayFormRules,size:"mini"}},[n("el-form-item",{attrs:{label:"serviceId"}},[e._v("\n "+e._s(e.grayForm.serviceId)+"\n ")]),e._v(" "),n("el-tabs",{attrs:{type:"card"},model:{value:e.tabsActiveName,callback:function(t){e.tabsActiveName=t},expression:"tabsActiveName"}},[n("el-tab-pane",{attrs:{label:"灰度用户",name:"first"}},[n("el-alert",{staticStyle:{"margin-bottom":"20px"},attrs:{title:"可以是appId或IP地址,多个用英文逗号隔开",type:"info",closable:!1}}),e._v(" "),n("el-form-item",{attrs:{prop:"userKeyContent"}},[n("el-input",{attrs:{placeholder:"可以是appId或IP地址,多个用英文逗号隔开",type:"textarea",rows:6},model:{value:e.grayForm.userKeyContent,callback:function(t){e.$set(e.grayForm,"userKeyContent",t)},expression:"grayForm.userKeyContent"}})],1)],1),e._v(" "),n("el-tab-pane",{attrs:{label:"接口配置",name:"second"}},[n("el-form-item",[n("el-button",{attrs:{type:"text"},on:{click:e.addNameVersion}},[e._v("新增灰度接口")])],1),e._v(" "),n("table",{attrs:{cellpadding:"0",cellspacing:"0"}},e._l(e.grayForm.grayRouteConfigList,function(t,r){return n("tr",{key:t.key},[n("td",[n("el-form-item",{key:t.key,attrs:{prop:"grayRouteConfigList."+r+".oldRouteId",rules:{required:!0,message:"不能为空",trigger:["blur","change"]}}},[e._v("\n 老接口:\n "),n("el-select",{staticStyle:{"margin-right":"10px"},on:{change:function(n){return e.onChangeOldRoute(t)}},model:{value:t.oldRouteId,callback:function(n){e.$set(t,"oldRouteId",n)},expression:"grayRouteConfig.oldRouteId"}},e._l(e.routeList,function(e){return n("el-option",{key:e.id,attrs:{label:e.name+"("+e.version+")",value:e.id}})}),1)],1)],1),e._v(" "),n("td",[n("el-form-item",{key:t.key+1,attrs:{prop:"grayRouteConfigList."+r+".newVersion",rules:{required:!0,message:"不能为空",trigger:["blur","change"]}}},[e._v("\n 灰度接口:\n "),n("el-select",{attrs:{"no-data-text":"无数据"},model:{value:t.newVersion,callback:function(n){e.$set(t,"newVersion",n)},expression:"grayRouteConfig.newVersion"}},e._l(e.getGraySelectData(t.oldRouteId),function(e){return n("el-option",{key:e.id,attrs:{label:e.name+"("+e.version+")",value:e.version}})}),1)],1)],1),e._v(" "),n("td",{staticStyle:{"vertical-align":"baseline"}},[n("el-button",{directives:[{name:"show",rawName:"v-show",value:e.grayForm.grayRouteConfigList.length>1,expression:"grayForm.grayRouteConfigList.length > 1"}],attrs:{type:"text"},on:{click:function(n){return n.preventDefault(),e.removeNameVersion(t)}}},[e._v("删除")])],1)])}),0)],1)],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.grayDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:e.onGrayConfigSave}},[e._v("确 定")])],1)],1)],1)},o=[],i=(n("28a5"),n("ac6a"),n("7f7f"),{data:function(){var e=/^\S+(,\S+)*$/,t=function(t,n,r){""===n?r(new Error("不能为空")):(e.test(n)||r(new Error("格式不正确")),r())};return{searchFormData:{serviceId:""},blackList:["sop-gateway","sop-admin"],grayDialogVisible:!1,grayForm:{serviceId:"",userKeyContent:"",onlyUpdateGrayUserkey:!1,grayRouteConfigList:[]},tabsActiveName:"first",routeList:[],selectNameVersion:[],grayFormRules:{userKeyContent:[{required:!0,message:"不能为空",trigger:"blur"},{validator:t,trigger:"blur"}]},tableData:[]}},created:function(){this.loadTable()},methods:{loadTable:function(){this.post("service.instance.list",this.searchFormData,function(e){this.tableData=this.buildTreeData(e.data)})},loadRouteList:function(e){this.post("route.list/1.2",{serviceId:e.toLowerCase()},function(e){this.routeList=e.data})},getGraySelectData:function(e){return this.routeList.filter(function(t){return e!==t.id&&e.indexOf(t.name)>-1})},buildTreeData:function(e){return e.forEach(function(t){var n=t.parentId;0===n||e.forEach(function(e){if(e.id===n){var r=e.children;r||(r=[]),r.push(t),e.children=r}})}),e=e.filter(function(e){return 0===e.parentId}),e},onSearchTable:function(){this.loadTable()},onDisable:function(e){this.confirm("确定要禁用 ".concat(e.serviceId,"(").concat(e.ipPort,") 吗?"),function(t){this.post("service.instance.offline",e,function(){this.tip("禁用成功"),t(),this.loadTableDelay()})})},onEnable:function(e){this.confirm("确定要启用 ".concat(e.serviceId,"(").concat(e.ipPort,") 吗?"),function(t){this.post("service.instance.online",e,function(){this.tip("启用成功"),t(),this.loadTableDelay()})})},doEnvOnline:function(e,t){this.post("service.instance.env.online",e,function(){t&&t.call(this)})},onEnvPreOpen:function(e){this.confirm("确定要开启 ".concat(e.serviceId,"(").concat(e.ipPort,") 预发布吗?"),function(t){this.post("service.instance.env.pre.open",e,function(){this.tip("预发布成功"),t(),this.loadTableDelay()})})},onEnvPreClose:function(e){this.confirm("确定要结束 ".concat(e.serviceId,"(").concat(e.ipPort,") 预发布吗?"),function(t){this.doEnvOnline(e,function(){this.tip("操作成功"),t(),this.loadTableDelay()})})},onEnvGrayOpen:function(e){this.confirm("确定要开启 ".concat(e.serviceId,"(").concat(e.ipPort,") 灰度吗?"),function(t){this.post("service.instance.env.gray.open",e,function(){this.tip("开启成功"),t(),this.loadTableDelay()})})},onEnvGrayClose:function(e){this.confirm("确定要结束 ".concat(e.serviceId,"(").concat(e.ipPort,") 灰度吗?"),function(t){this.doEnvOnline(e,function(){this.tip("操作成功"),t(),this.loadTableDelay()})})},onGrayConfigUpdate:function(e){var t=e.serviceId;this.loadRouteList(t),this.post("service.gray.config.get",{serviceId:t},function(e){var n=this;this.grayDialogVisible=!0,this.$nextTick(function(){var r=e.data;Object.assign(n.grayForm,{serviceId:t,userKeyContent:r.userKeyContent||"",grayRouteConfigList:n.createGrayRouteConfigList(r.nameVersionContent)})})})},onGrayConfigSave:function(){var e=this;this.$refs.grayForm.validate(function(t){if(t){for(var n=[],r=e.grayForm.grayRouteConfigList,o=0;o=c?e?"":void 0:(i=s.charCodeAt(l),i<55296||i>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):i:e?s.slice(l,l+2):a-56320+(i-55296<<10)+65536)}}},"0390":function(e,t,n){"use strict";var r=n("02f4")(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},"0bfb":function(e,t,n){"use strict";var r=n("cb7c");e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},"214f":function(e,t,n){"use strict";n("b0c5");var r=n("2aba"),o=n("32e9"),i=n("79e5"),a=n("be13"),s=n("2b4c"),l=n("520a"),c=s("species"),u=!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}),f=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var d=s(e),v=!i(function(){var t={};return t[d]=function(){return 7},7!=""[e](t)}),p=v?!i(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[c]=function(){return n}),n[d](""),!t}):void 0;if(!v||!p||"replace"===e&&!u||"split"===e&&!f){var g=/./[d],y=n(a,d,""[e],function(e,t,n,r,o){return t.exec===l?v&&!o?{done:!0,value:g.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),h=y[0],m=y[1];r(String.prototype,e,h),o(RegExp.prototype,d,2==t?function(e,t){return m.call(e,this,t)}:function(e){return m.call(e,this)})}}},"28a5":function(e,t,n){"use strict";var r=n("aae3"),o=n("cb7c"),i=n("ebd6"),a=n("0390"),s=n("9def"),l=n("5f1b"),c=n("520a"),u=n("79e5"),f=Math.min,d=[].push,v="split",p="length",g="lastIndex",y=4294967295,h=!u(function(){RegExp(y,"y")});n("214f")("split",2,function(e,t,n,u){var m;return m="c"=="abbc"[v](/(b)*/)[1]||4!="test"[v](/(?:)/,-1)[p]||2!="ab"[v](/(?:ab)*/)[p]||4!="."[v](/(.?)(.?)/)[p]||"."[v](/()()/)[p]>1||""[v](/.?/)[p]?function(e,t){var o=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(o,e,t);var i,a,s,l=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,v=void 0===t?y:t>>>0,h=new RegExp(e.source,u+"g");while(i=c.call(h,o)){if(a=h[g],a>f&&(l.push(o.slice(f,i.index)),i[p]>1&&i.index=v))break;h[g]===i.index&&h[g]++}return f===o[p]?!s&&h.test("")||l.push(""):l.push(o.slice(f)),l[p]>v?l.slice(0,v):l}:"0"[v](void 0,0)[p]?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var o=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,o,r):m.call(String(o),n,r)},function(e,t){var r=u(m,e,this,t,m!==n);if(r.done)return r.value;var c=o(e),d=String(this),v=i(c,RegExp),p=c.unicode,g=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(h?"y":"g"),b=new v(h?c:"^(?:"+c.source+")",g),_=void 0===t?y:t>>>0;if(0===_)return[];if(0===d.length)return null===l(b,d)?[d]:[];var w=0,x=0,I=[];while(x1&&i.call(a[0],n,function(){for(u=1;u0&&"pre"===t.row.metadata.env?n("el-tag",{attrs:{type:"warning"}},[e._v("预发布")]):e._e(),e._v(" "),t.row.parentId>0&&"gray"===t.row.metadata.env?n("el-tag",{attrs:{type:"info"}},[e._v("灰度")]):e._e(),e._v(" "),t.row.parentId>0&&!t.row.metadata.env?n("el-tag",{attrs:{type:"success"}},[e._v("线上")]):e._e()],1):e._e()]}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"metadata",label:"metadata",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.parentId>0?n("span",[e._v(e._s(JSON.stringify(t.row.metadata)))]):e._e()]}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"status",label:"服务状态",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.parentId>0&&"UP"===t.row.status?n("el-tag",{attrs:{type:"success"}},[e._v("正常")]):e._e(),e._v(" "),t.row.parentId>0&&"STARTING"===t.row.status?n("el-tag",{attrs:{type:"info"}},[e._v("正在启动")]):e._e(),e._v(" "),t.row.parentId>0&&"UNKNOWN"===t.row.status?n("el-tag",[e._v("未知")]):e._e(),e._v(" "),t.row.parentId>0&&("OUT_OF_SERVICE"===t.row.status||"DOWN"===t.row.status)?n("el-tag",{attrs:{type:"danger"}},[e._v("已禁用")]):e._e()]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"操作",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return["sop-gateway"!==t.row.serviceId.toLowerCase()?n("div",[0===t.row.parentId?n("div",[n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onGrayConfigUpdate(t.row)}}},[e._v("设置灰度参数")])],1):e._e(),e._v(" "),t.row.parentId>0?n("div",["UP"===t.row.status?n("span",["pre"===t.row.metadata.env?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvPreClose(t.row)}}},[e._v("结束预发布")]):e._e(),e._v(" "),"gray"===t.row.metadata.env?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvGrayClose(t.row)}}},[e._v("结束灰度")]):e._e(),e._v(" "),t.row.metadata.env?e._e():n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvPreOpen(t.row)}}},[e._v("开启预发布")]),e._v(" "),t.row.metadata.env?e._e():n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvGrayOpen(t.row)}}},[e._v("开启灰度")])],1):e._e(),e._v(" "),n("span",{staticStyle:{"margin-left":"10px"}},["UP"===t.row.status?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onDisable(t.row)}}},[e._v("禁用")]):e._e(),e._v(" "),"OUT_OF_SERVICE"===t.row.status?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnable(t.row)}}},[e._v("启用")]):e._e()],1)]):e._e()]):e._e()]}}])})],1),e._v(" "),n("el-dialog",{attrs:{title:"灰度设置",visible:e.grayDialogVisible,"close-on-click-modal":!1},on:{"update:visible":function(t){e.grayDialogVisible=t},close:function(t){return e.resetForm("grayForm")}}},[n("el-form",{ref:"grayForm",attrs:{model:e.grayForm,rules:e.grayFormRules,size:"mini"}},[n("el-form-item",{attrs:{label:"serviceId"}},[e._v("\n "+e._s(e.grayForm.serviceId)+"\n ")]),e._v(" "),n("el-tabs",{attrs:{type:"card"},model:{value:e.tabsActiveName,callback:function(t){e.tabsActiveName=t},expression:"tabsActiveName"}},[n("el-tab-pane",{attrs:{label:"灰度用户",name:"first"}},[n("el-alert",{staticStyle:{"margin-bottom":"20px"},attrs:{title:"可以是appId或IP地址,多个用英文逗号隔开",type:"info",closable:!1}}),e._v(" "),n("el-form-item",{attrs:{prop:"userKeyContent"}},[n("el-input",{attrs:{placeholder:"可以是appId或IP地址,多个用英文逗号隔开",type:"textarea",rows:6},model:{value:e.grayForm.userKeyContent,callback:function(t){e.$set(e.grayForm,"userKeyContent",t)},expression:"grayForm.userKeyContent"}})],1)],1),e._v(" "),n("el-tab-pane",{attrs:{label:"接口配置",name:"second"}},[n("el-form-item",[n("el-button",{attrs:{type:"text"},on:{click:e.addNameVersion}},[e._v("新增灰度接口")])],1),e._v(" "),n("table",{attrs:{cellpadding:"0",cellspacing:"0"}},e._l(e.grayForm.grayRouteConfigList,function(t,r){return n("tr",{key:t.key},[n("td",[n("el-form-item",{key:t.key,attrs:{prop:"grayRouteConfigList."+r+".oldRouteId",rules:{required:!0,message:"不能为空",trigger:["blur","change"]}}},[e._v("\n 老接口:\n "),n("el-select",{staticStyle:{"margin-right":"10px"},on:{change:function(n){return e.onChangeOldRoute(t)}},model:{value:t.oldRouteId,callback:function(n){e.$set(t,"oldRouteId",n)},expression:"grayRouteConfig.oldRouteId"}},e._l(e.routeList,function(e){return n("el-option",{key:e.id,attrs:{label:e.name+"("+e.version+")",value:e.id}})}),1)],1)],1),e._v(" "),n("td",[n("el-form-item",{key:t.key+1,attrs:{prop:"grayRouteConfigList."+r+".newVersion",rules:{required:!0,message:"不能为空",trigger:["blur","change"]}}},[e._v("\n 灰度接口:\n "),n("el-select",{attrs:{"no-data-text":"无数据"},model:{value:t.newVersion,callback:function(n){e.$set(t,"newVersion",n)},expression:"grayRouteConfig.newVersion"}},e._l(e.getGraySelectData(t.oldRouteId),function(e){return n("el-option",{key:e.id,attrs:{label:e.name+"("+e.version+")",value:e.version}})}),1)],1)],1),e._v(" "),n("td",{staticStyle:{"vertical-align":"baseline"}},[n("el-button",{directives:[{name:"show",rawName:"v-show",value:e.grayForm.grayRouteConfigList.length>1,expression:"grayForm.grayRouteConfigList.length > 1"}],attrs:{type:"text"},on:{click:function(n){return n.preventDefault(),e.removeNameVersion(t)}}},[e._v("删除")])],1)])}),0)],1)],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.grayDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:e.onGrayConfigSave}},[e._v("确 定")])],1)],1)],1)},o=[],i=(n("28a5"),n("ac6a"),n("7f7f"),{data:function(){var e=/^\S+(,\S+)*$/,t=function(t,n,r){""===n?r(new Error("不能为空")):(e.test(n)||r(new Error("格式不正确")),r())};return{searchFormData:{serviceId:""},grayDialogVisible:!1,grayForm:{serviceId:"",userKeyContent:"",onlyUpdateGrayUserkey:!1,grayRouteConfigList:[]},tabsActiveName:"first",routeList:[],selectNameVersion:[],grayFormRules:{userKeyContent:[{required:!0,message:"不能为空",trigger:"blur"},{validator:t,trigger:"blur"}]},tableData:[]}},created:function(){this.loadTable()},methods:{loadTable:function(){this.post("service.instance.list",this.searchFormData,function(e){this.tableData=this.buildTreeData(e.data)})},loadRouteList:function(e){this.post("route.list/1.2",{serviceId:e.toLowerCase()},function(e){this.routeList=e.data})},getGraySelectData:function(e){return this.routeList.filter(function(t){return e!==t.id&&e.indexOf(t.name)>-1})},buildTreeData:function(e){return e.forEach(function(t){var n=t.parentId;0===n||e.forEach(function(e){if(e.id===n){var r=e.children;r||(r=[]),r.push(t),e.children=r}})}),e=e.filter(function(e){return 0===e.parentId}),e},onSearchTable:function(){this.loadTable()},onDisable:function(e){this.confirm("确定要禁用 ".concat(e.serviceId,"(").concat(e.ipPort,") 吗?"),function(t){this.post("service.instance.offline",e,function(){this.tip("禁用成功"),t(),this.loadTableDelay()})})},onEnable:function(e){this.confirm("确定要启用 ".concat(e.serviceId,"(").concat(e.ipPort,") 吗?"),function(t){this.post("service.instance.online",e,function(){this.tip("启用成功"),t(),this.loadTableDelay()})})},doEnvOnline:function(e,t){this.post("service.instance.env.online",e,function(){t&&t.call(this)})},onEnvPreOpen:function(e){this.confirm("确定要开启 ".concat(e.serviceId,"(").concat(e.ipPort,") 预发布吗?"),function(t){this.post("service.instance.env.pre.open",e,function(){this.tip("预发布成功"),t(),this.loadTableDelay()})})},onEnvPreClose:function(e){this.confirm("确定要结束 ".concat(e.serviceId,"(").concat(e.ipPort,") 预发布吗?"),function(t){this.doEnvOnline(e,function(){this.tip("操作成功"),t(),this.loadTableDelay()})})},onEnvGrayOpen:function(e){this.confirm("确定要开启 ".concat(e.serviceId,"(").concat(e.ipPort,") 灰度吗?"),function(t){this.post("service.instance.env.gray.open",e,function(){this.tip("开启成功"),t(),this.loadTableDelay()})})},onEnvGrayClose:function(e){this.confirm("确定要结束 ".concat(e.serviceId,"(").concat(e.ipPort,") 灰度吗?"),function(t){this.doEnvOnline(e,function(){this.tip("操作成功"),t(),this.loadTableDelay()})})},onGrayConfigUpdate:function(e){var t=e.serviceId;this.loadRouteList(t),this.post("service.gray.config.get",{serviceId:t},function(e){var n=this;this.grayDialogVisible=!0,this.$nextTick(function(){var r=e.data;Object.assign(n.grayForm,{serviceId:t,userKeyContent:r.userKeyContent||"",grayRouteConfigList:n.createGrayRouteConfigList(r.nameVersionContent)})})})},onGrayConfigSave:function(){var e=this;this.$refs.grayForm.validate(function(t){if(t){for(var n=[],r=e.grayForm.grayRouteConfigList,o=0;o