├── img ├── 平台化操作.png ├── 第七步-正常角色-1.png ├── 第七步-正常角色-2.png ├── 第七步-正常角色-3.png ├── 第五步-灰度角色-1.png ├── 第五步-灰度角色-2.png ├── 第五步-灰度角色-3.png ├── 第五步-灰度角色-4.png ├── 第五步-灰度角色-5.png ├── 第六步-灰度角色-1.png ├── 第六步-灰度角色-2.png ├── 第六步-灰度角色-3.png ├── 第六步-灰度角色-4.png ├── 第四步-灰度角色-1.png ├── 第四步-灰度角色-2.png ├── 第四步-灰度角色-3.png ├── 第一步-release-1.png ├── 第二步-灰度角色-gray.png ├── 第四步-随机策略-1-1.png ├── 第四步-随机策略-1-2.png ├── 第四步-随机策略-1-3.png ├── 第四步-随机策略-2-1.png ├── 第四步-随机策略-2-2.png ├── 第四步-随机策略-2-3.png ├── 第三步-灰度角色-release.png ├── 第二步-正常角色-release.png ├── 第四步-灰度角色-result.png ├── 第一步-release-result.png ├── 第三步-灰度角色-release-result.png └── 第二步-正常角色-release-result.png └── DubboGray ├── dubbo-gray-user ├── src │ └── main │ │ ├── resources │ │ ├── zookeeper.properties │ │ ├── dubbo.properties │ │ ├── dubbo-user-call-consumers.xml │ │ ├── dubbo-user-provider.xml │ │ └── applicationContext.xml │ │ └── java │ │ └── com │ │ └── candao │ │ └── dubbo │ │ └── gray │ │ └── user │ │ ├── Startup.java │ │ └── service │ │ ├── datahandler │ │ └── UserHandler.java │ │ ├── UserService2.java │ │ └── UserService.java └── pom.xml ├── dubbo-gray-entry └── src │ └── main │ ├── resources │ ├── zookeeper.properties │ ├── dubbo-user-consumer.xml │ ├── dubbo-order-consumer.xml │ ├── log4j.properties │ ├── dubbo-consumer.xml │ ├── applicationContext.xml │ └── spring-mvc-context.xml │ ├── java │ └── com │ │ └── candao │ │ └── dubbo │ │ └── gray │ │ └── entry │ │ ├── net │ │ └── HttpResult.java │ │ ├── gray │ │ └── GrayStrategyService.java │ │ └── controller │ │ └── ExternalController.java │ └── jetty │ └── ServerStartupMerchantsEntry.java ├── dubbo-gray-order ├── src │ └── main │ │ ├── resources │ │ ├── zookeeper.properties │ │ ├── dubbo.properties │ │ ├── dubbo-order-call-consumers.xml │ │ ├── dubbo-order-provider.xml │ │ └── applicationContext.xml │ │ └── java │ │ └── com │ │ └── candao │ │ └── dubbo │ │ └── gray │ │ └── order │ │ ├── Startup.java │ │ └── service │ │ ├── datahandler │ │ └── OrderHandler.java │ │ └── OrderService.java └── pom.xml ├── dubbo-gray-order2 ├── src │ └── main │ │ ├── resources │ │ ├── zookeeper.properties │ │ ├── dubbo.properties │ │ ├── dubbo-order-call-consumers.xml │ │ ├── dubbo-order-provider.xml │ │ └── applicationContext.xml │ │ └── java │ │ └── com │ │ └── candao │ │ └── dubbo │ │ └── gray │ │ └── order │ │ ├── Startup.java │ │ └── service │ │ ├── datahandler │ │ └── OrderHandler.java │ │ └── OrderService.java └── pom.xml ├── dubbo-gray-user2 ├── src │ └── main │ │ ├── resources │ │ ├── zookeeper.properties │ │ ├── dubbo.properties │ │ ├── dubbo-user-call-consumers.xml │ │ ├── applicationContext.xml │ │ └── dubbo-user-provider.xml │ │ └── java │ │ └── com │ │ └── candao │ │ └── dubbo │ │ └── gray │ │ └── user │ │ ├── Startup.java │ │ └── service │ │ ├── datahandler │ │ └── UserHandler.java │ │ ├── UserService2.java │ │ └── UserService.java └── pom.xml ├── dubbo-gray-manager └── src │ └── main │ ├── webapp │ ├── css │ │ ├── validator.css │ │ ├── libs │ │ │ ├── themes │ │ │ │ ├── assets │ │ │ │ │ ├── img │ │ │ │ │ │ ├── bg.jpg │ │ │ │ │ │ ├── logo.png │ │ │ │ │ │ ├── tshirt.jpg │ │ │ │ │ │ ├── gridgum.png │ │ │ │ │ │ ├── logo-nav.png │ │ │ │ │ │ ├── shopify.png │ │ │ │ │ │ ├── stickers.jpg │ │ │ │ │ │ ├── carboncostume.png │ │ │ │ │ │ └── refs │ │ │ │ │ │ │ ├── htmlandcss.png │ │ │ │ │ │ │ ├── beautifulwebdesign.png │ │ │ │ │ │ │ └── eloquentjavascript.png │ │ │ │ │ └── js │ │ │ │ │ │ ├── bsa.js │ │ │ │ │ │ └── bootswatch.js │ │ │ │ └── fonts │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ ├── font-awesome │ │ │ │ └── font │ │ │ │ │ ├── FontAwesome.otf │ │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ │ └── fontawesome-webfont.woff │ │ │ ├── bootstrap │ │ │ │ └── fonts │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── multiselect │ │ │ │ └── bootstrap-multiselect.css │ │ ├── animation.css │ │ └── datepicker.css │ ├── img │ │ ├── glyphicons-halflings.png │ │ └── glyphicons-halflings-white.png │ ├── js │ │ ├── codemirror │ │ │ ├── theme │ │ │ │ ├── ambiance-mobile.css │ │ │ │ ├── neat.css │ │ │ │ ├── elegant.css │ │ │ │ ├── neo.css │ │ │ │ ├── eclipse.css │ │ │ │ ├── colorforth.css │ │ │ │ ├── cobalt.css │ │ │ │ ├── rubyblue.css │ │ │ │ ├── night.css │ │ │ │ └── tomorrow-night-bright.css │ │ │ ├── addon │ │ │ │ ├── display │ │ │ │ │ ├── fullscreen.css │ │ │ │ │ └── fullscreen.js │ │ │ │ ├── search │ │ │ │ │ └── matchesonscrollbar.css │ │ │ │ ├── fold │ │ │ │ │ ├── foldgutter.css │ │ │ │ │ ├── indent-fold.js │ │ │ │ │ └── markdown-fold.js │ │ │ │ ├── dialog │ │ │ │ │ └── dialog.css │ │ │ │ ├── hint │ │ │ │ │ ├── show-hint.css │ │ │ │ │ └── anyword-hint.js │ │ │ │ ├── mode │ │ │ │ │ └── multiplex_test.js │ │ │ │ ├── lint │ │ │ │ │ ├── yaml-lint.js │ │ │ │ │ ├── json-lint.js │ │ │ │ │ ├── css-lint.js │ │ │ │ │ └── coffeescript-lint.js │ │ │ │ ├── edit │ │ │ │ │ ├── trailingspace.js │ │ │ │ │ └── continuelist.js │ │ │ │ ├── tern │ │ │ │ │ └── worker.js │ │ │ │ ├── runmode │ │ │ │ │ └── colorize.js │ │ │ │ └── scroll │ │ │ │ │ ├── simplescrollbars.css │ │ │ │ │ └── scrollpastend.js │ │ │ └── mode │ │ │ │ ├── tiddlywiki │ │ │ │ └── tiddlywiki.css │ │ │ │ ├── ruby │ │ │ │ └── test.js │ │ │ │ ├── tiki │ │ │ │ └── tiki.css │ │ │ │ ├── clike │ │ │ │ └── test.js │ │ │ │ ├── diff │ │ │ │ └── diff.js │ │ │ │ ├── asciiarmor │ │ │ │ └── index.html │ │ │ │ ├── htmlembedded │ │ │ │ └── htmlembedded.js │ │ │ │ ├── ntriples │ │ │ │ └── index.html │ │ │ │ ├── twig │ │ │ │ └── index.html │ │ │ │ ├── spreadsheet │ │ │ │ └── index.html │ │ │ │ ├── http │ │ │ │ └── index.html │ │ │ │ ├── solr │ │ │ │ └── index.html │ │ │ │ ├── ecl │ │ │ │ └── index.html │ │ │ │ ├── z80 │ │ │ │ └── index.html │ │ │ │ ├── rust │ │ │ │ └── index.html │ │ │ │ ├── turtle │ │ │ │ └── index.html │ │ │ │ ├── pascal │ │ │ │ └── index.html │ │ │ │ ├── pig │ │ │ │ └── index.html │ │ │ │ ├── vbscript │ │ │ │ └── index.html │ │ │ │ ├── gherkin │ │ │ │ └── index.html │ │ │ │ ├── properties │ │ │ │ └── index.html │ │ │ │ ├── javascript │ │ │ │ └── typescript.html │ │ │ │ ├── sass │ │ │ │ └── index.html │ │ │ │ ├── perl │ │ │ │ └── index.html │ │ │ │ ├── elm │ │ │ │ └── index.html │ │ │ │ ├── idl │ │ │ │ └── index.html │ │ │ │ ├── dart │ │ │ │ └── index.html │ │ │ │ ├── handlebars │ │ │ │ └── handlebars.js │ │ │ │ ├── xml │ │ │ │ └── test.js │ │ │ │ └── jinja2 │ │ │ │ └── index.html │ │ ├── modules │ │ │ └── common │ │ │ │ ├── stickup.js │ │ │ │ ├── basic.module.js │ │ │ │ ├── libs-mapping.js │ │ │ │ ├── util.js │ │ │ │ ├── filter.js │ │ │ │ └── http.js │ │ └── libs │ │ │ ├── datepicker │ │ │ └── locale │ │ │ │ └── bootstrap-datepicker.zh-CN.min.js │ │ │ ├── angularjs │ │ │ └── angular-cookies.min.js │ │ │ └── showdown │ │ │ └── showdown-table.min.js │ ├── templates │ │ ├── menu │ │ │ └── menu.html │ │ ├── apps │ │ │ ├── service-readme.html │ │ │ └── node-details.html │ │ ├── breadcrumb │ │ │ └── breadcrumb.html │ │ ├── statistics │ │ │ ├── app-dependencies.html │ │ │ └── statistics.html │ │ └── dialog │ │ │ └── dialog.html │ └── WEB-INF │ │ └── web.xml │ ├── java │ └── com │ │ └── dubboclub │ │ └── dk │ │ └── web │ │ ├── dao │ │ ├── GraySwitchRepository.java │ │ ├── GrayUserRepository.java │ │ └── GrayStrategyRepository.java │ │ ├── utils │ │ ├── ContextLoaderListenerWrapper.java │ │ ├── ContextHolder.java │ │ ├── HttpResult.java │ │ └── ContextUtils.java │ │ ├── exception │ │ ├── DataHadChangedException.java │ │ └── DefaultExceptionHandler.java │ │ ├── model │ │ ├── BasicResponse.java │ │ ├── RouteAbstractInfo.java │ │ ├── WeightOverrideInfo.java │ │ ├── ConsumerInfo.java │ │ └── OverrideAbstractInfo.java │ │ ├── service │ │ ├── GraySwitchService.java │ │ ├── GrayStrategyService.java │ │ └── GrayUserService.java │ │ ├── properties │ │ └── DubboKeeperConfigurer.java │ │ └── bean │ │ └── Switch.java │ ├── resources │ ├── db.properties │ ├── dubbo.properties │ └── META-INF │ │ └── spring │ │ └── init.xml │ └── jetty │ └── com │ └── candao │ └── jetty │ └── ServerStartupMerchantsEntry.java ├── dubbo-gray-core ├── src │ └── main │ │ └── resources │ │ └── META-INF │ │ └── dubbo │ │ ├── com.alibaba.dubbo.rpc.cluster.LoadBalance │ │ └── internal │ │ └── com.alibaba.dubbo.rpc.cluster.LoadBalance └── pom.xml ├── dubbo-gray-user-api ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── candao │ │ │ └── dubbo │ │ │ └── gray │ │ │ └── user │ │ │ └── api │ │ │ ├── IUserService2.java │ │ │ ├── IUserService.java │ │ │ └── bean │ │ │ ├── User.java │ │ │ └── GrayUser.java │ │ └── resources │ │ └── dubbo-user-consumer.xml └── pom.xml ├── dubbo-gray-order-api ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── candao │ │ │ └── dubbo │ │ │ └── gray │ │ │ └── order │ │ │ └── api │ │ │ ├── IOrderService.java │ │ │ └── bean │ │ │ └── Order.java │ │ └── resources │ │ └── dubbo-order-consumer.xml └── pom.xml └── dubbo-gray-common └── pom.xml /img/平台化操作.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/平台化操作.png -------------------------------------------------------------------------------- /img/第七步-正常角色-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第七步-正常角色-1.png -------------------------------------------------------------------------------- /img/第七步-正常角色-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第七步-正常角色-2.png -------------------------------------------------------------------------------- /img/第七步-正常角色-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第七步-正常角色-3.png -------------------------------------------------------------------------------- /img/第五步-灰度角色-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第五步-灰度角色-1.png -------------------------------------------------------------------------------- /img/第五步-灰度角色-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第五步-灰度角色-2.png -------------------------------------------------------------------------------- /img/第五步-灰度角色-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第五步-灰度角色-3.png -------------------------------------------------------------------------------- /img/第五步-灰度角色-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第五步-灰度角色-4.png -------------------------------------------------------------------------------- /img/第五步-灰度角色-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第五步-灰度角色-5.png -------------------------------------------------------------------------------- /img/第六步-灰度角色-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第六步-灰度角色-1.png -------------------------------------------------------------------------------- /img/第六步-灰度角色-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第六步-灰度角色-2.png -------------------------------------------------------------------------------- /img/第六步-灰度角色-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第六步-灰度角色-3.png -------------------------------------------------------------------------------- /img/第六步-灰度角色-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第六步-灰度角色-4.png -------------------------------------------------------------------------------- /img/第四步-灰度角色-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第四步-灰度角色-1.png -------------------------------------------------------------------------------- /img/第四步-灰度角色-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第四步-灰度角色-2.png -------------------------------------------------------------------------------- /img/第四步-灰度角色-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第四步-灰度角色-3.png -------------------------------------------------------------------------------- /img/第一步-release-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第一步-release-1.png -------------------------------------------------------------------------------- /img/第二步-灰度角色-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第二步-灰度角色-gray.png -------------------------------------------------------------------------------- /img/第四步-随机策略-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第四步-随机策略-1-1.png -------------------------------------------------------------------------------- /img/第四步-随机策略-1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第四步-随机策略-1-2.png -------------------------------------------------------------------------------- /img/第四步-随机策略-1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第四步-随机策略-1-3.png -------------------------------------------------------------------------------- /img/第四步-随机策略-2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第四步-随机策略-2-1.png -------------------------------------------------------------------------------- /img/第四步-随机策略-2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第四步-随机策略-2-2.png -------------------------------------------------------------------------------- /img/第四步-随机策略-2-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第四步-随机策略-2-3.png -------------------------------------------------------------------------------- /img/第三步-灰度角色-release.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第三步-灰度角色-release.png -------------------------------------------------------------------------------- /img/第二步-正常角色-release.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第二步-正常角色-release.png -------------------------------------------------------------------------------- /img/第四步-灰度角色-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第四步-灰度角色-result.png -------------------------------------------------------------------------------- /img/第一步-release-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第一步-release-result.png -------------------------------------------------------------------------------- /img/第三步-灰度角色-release-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第三步-灰度角色-release-result.png -------------------------------------------------------------------------------- /img/第二步-正常角色-release-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/img/第二步-正常角色-release-result.png -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user/src/main/resources/zookeeper.properties: -------------------------------------------------------------------------------- 1 | zookeeper.url=10.200.102.136\:2181 2 | #zookeeper.url=10.205.127.69\:2181 3 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-entry/src/main/resources/zookeeper.properties: -------------------------------------------------------------------------------- 1 | zookeeper.url=10.200.102.136\:2181 2 | #zookeeper.url=10.205.127.69\:2181 3 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order/src/main/resources/zookeeper.properties: -------------------------------------------------------------------------------- 1 | zookeeper.url=10.200.102.136\:2181 2 | #zookeeper.url=10.205.127.69\:2181 3 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order2/src/main/resources/zookeeper.properties: -------------------------------------------------------------------------------- 1 | zookeeper.url=10.200.102.136\:2181 2 | #zookeeper.url=10.205.127.69\:2181 3 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user2/src/main/resources/zookeeper.properties: -------------------------------------------------------------------------------- 1 | zookeeper.url=10.200.102.136\:2181 2 | #zookeeper.url=10.205.127.69\:2181 3 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/validator.css: -------------------------------------------------------------------------------- 1 | .ng-invalid.ng-touched { 2 | border: solid 1px #c12e2a; 3 | } 4 | 5 | .ng-valid.ng-touched { 6 | border: solid 1px #ccc; 7 | } -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/theme/ambiance-mobile.css: -------------------------------------------------------------------------------- 1 | .cm-s-ambiance.CodeMirror { 2 | -webkit-box-shadow: none; 3 | -moz-box-shadow: none; 4 | box-shadow: none; 5 | } 6 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/bg.jpg -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/logo.png -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/tshirt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/tshirt.jpg -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-core/src/main/resources/META-INF/dubbo/com.alibaba.dubbo.rpc.cluster.LoadBalance: -------------------------------------------------------------------------------- 1 | grayrandom=com.candao.dubbo.gray.core.GrayDeployLoadBalance 2 | grayroundrobin=com.candao.dubbo.gray.core.GrayDeployLoadBalance -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/gridgum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/gridgum.png -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/logo-nav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/logo-nav.png -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/shopify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/shopify.png -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/stickers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/stickers.jpg -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/display/fullscreen.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-fullscreen { 2 | position: fixed; 3 | top: 0; left: 0; right: 0; bottom: 0; 4 | height: auto; 5 | z-index: 9; 6 | } 7 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/font-awesome/font/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/font-awesome/font/FontAwesome.otf -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/carboncostume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/carboncostume.png -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-core/src/main/resources/META-INF/dubbo/internal/com.alibaba.dubbo.rpc.cluster.LoadBalance: -------------------------------------------------------------------------------- 1 | grayrandom=com.alibaba.dubbo.gray.cluster.RandomLoadBalance 2 | grayroundrobin=com.alibaba.dubbo.gray.cluster.RoundRobinLoadBalance -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/refs/htmlandcss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/refs/htmlandcss.png -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/font-awesome/font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/font-awesome/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/font-awesome/font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/font-awesome/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/font-awesome/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/font-awesome/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/refs/beautifulwebdesign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/refs/beautifulwebdesign.png -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/refs/eloquentjavascript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/img/refs/eloquentjavascript.png -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeromeLiuLly/dubbo-gray/HEAD/DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user/src/main/java/com/candao/dubbo/gray/user/Startup.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.user; 2 | 3 | public class Startup { 4 | 5 | public static void main(String[] args) { 6 | com.alibaba.dubbo.container.Main.main(new String[] {}); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/modules/common/stickup.js: -------------------------------------------------------------------------------- 1 | var stickup = angular.module('stickup', []); 2 | stickup.directive('stickup', function() { 3 | return function(scope, element, attrs) { 4 | element.css({position:"fixed",width:"60%"}); 5 | } 6 | }); -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order/src/main/java/com/candao/dubbo/gray/order/Startup.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.order; 2 | 3 | public class Startup { 4 | 5 | public static void main(String[] args) { 6 | com.alibaba.dubbo.container.Main.main(new String[] {}); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order2/src/main/java/com/candao/dubbo/gray/order/Startup.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.order; 2 | 3 | public class Startup { 4 | 5 | public static void main(String[] args) { 6 | com.alibaba.dubbo.container.Main.main(new String[] {}); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user2/src/main/java/com/candao/dubbo/gray/user/Startup.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.user; 2 | 3 | public class Startup { 4 | 5 | public static void main(String[] args) { 6 | com.alibaba.dubbo.container.Main.main(new String[] {}); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order/src/main/resources/dubbo.properties: -------------------------------------------------------------------------------- 1 | #加载容器 spring,jetty,log4j 2 | dubbo.container=spring 3 | #spring路径 4 | dubbo.spring.config=classpath:applicationContext*.xml 5 | #指定dubbo服务的本地缓存文件 6 | dubbo.registry.file=dubbo-registry.cache 7 | #监控注册 8 | dubbo.monitor.protocol=registry -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user/src/main/resources/dubbo.properties: -------------------------------------------------------------------------------- 1 | #加载容器 spring,jetty,log4j 2 | dubbo.container=spring 3 | #spring路径 4 | dubbo.spring.config=classpath:applicationContext*.xml 5 | #指定dubbo服务的本地缓存文件 6 | dubbo.registry.file=dubbo-registry.cache 7 | #监控注册 8 | dubbo.monitor.protocol=registry -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user2/src/main/resources/dubbo.properties: -------------------------------------------------------------------------------- 1 | #加载容器 spring,jetty,log4j 2 | dubbo.container=spring 3 | #spring路径 4 | dubbo.spring.config=classpath:applicationContext*.xml 5 | #指定dubbo服务的本地缓存文件 6 | dubbo.registry.file=dubbo-registry.cache 7 | #监控注册 8 | dubbo.monitor.protocol=registry -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order2/src/main/resources/dubbo.properties: -------------------------------------------------------------------------------- 1 | #加载容器 spring,jetty,log4j 2 | dubbo.container=spring 3 | #spring路径 4 | dubbo.spring.config=classpath:applicationContext*.xml 5 | #指定dubbo服务的本地缓存文件 6 | dubbo.registry.file=dubbo-registry.cache 7 | #监控注册 8 | dubbo.monitor.protocol=registry -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/search/matchesonscrollbar.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-search-match { 2 | background: gold; 3 | border-top: 1px solid orange; 4 | border-bottom: 1px solid orange; 5 | -moz-box-sizing: border-box; 6 | box-sizing: border-box; 7 | opacity: .5; 8 | } 9 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/dao/GraySwitchRepository.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.dao; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import com.dubboclub.dk.web.bean.Switch; 5 | 6 | public interface GraySwitchRepository extends JpaRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/templates/menu/menu.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | {{menu.showName}} 4 | 5 | 6 |
-------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/dao/GrayUserRepository.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.dao; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.dubboclub.dk.web.bean.User; 6 | 7 | public interface GrayUserRepository extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/templates/apps/service-readme.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 服务 {{serviceKey}} 的调用文档 4 |
5 |
6 | 7 | 8 |
9 |
-------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/dao/GrayStrategyRepository.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.dao; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.dubboclub.dk.web.bean.GrayStrategy; 6 | 7 | public interface GrayStrategyRepository extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/js/bsa.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var bsa = document.createElement('script'); 3 | bsa.type = 'text/javascript'; 4 | bsa.async = true; 5 | bsa.src = 'http://s3.buysellads.com/ac/bsa.js'; 6 | (document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa); 7 | })(); -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/tiddlywiki/tiddlywiki.css: -------------------------------------------------------------------------------- 1 | span.cm-underlined { 2 | text-decoration: underline; 3 | } 4 | span.cm-strikethrough { 5 | text-decoration: line-through; 6 | } 7 | span.cm-brace { 8 | color: #170; 9 | font-weight: bold; 10 | } 11 | span.cm-table { 12 | color: blue; 13 | font-weight: bold; 14 | } 15 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user-api/src/main/java/com/candao/dubbo/gray/user/api/IUserService2.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.user.api; 2 | 3 | import java.util.List; 4 | 5 | import com.candao.dubbo.gray.common.bean.DistributedContext; 6 | import com.candao.dubbo.gray.user.api.bean.User; 7 | 8 | public interface IUserService2 { 9 | List getPermissions(DistributedContext distributedContext); 10 | } 11 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order-api/src/main/java/com/candao/dubbo/gray/order/api/IOrderService.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.order.api; 2 | 3 | import java.util.List; 4 | 5 | import com.candao.dubbo.gray.common.bean.DistributedContext; 6 | import com.candao.dubbo.gray.order.api.bean.Order; 7 | 8 | public interface IOrderService { 9 | 10 | List getOrders(DistributedContext context); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/resources/db.properties: -------------------------------------------------------------------------------- 1 | db.jdbcUrl=jdbc:mysql://10.200.102.51:3306/dms 2 | db.user=root 3 | db.password=123456 4 | db.initialSize=1 5 | db.minIdle=1 6 | db.maxActive=5 7 | db.maxWait=60000 8 | db.timeBetweenEvictionRunsMillis=60000 9 | db.minEvictableIdleTimeMillis=300000 10 | db.poolPreparedStatements=false 11 | db.maxPoolPreparedStatementPerConnectionSize=20 12 | db.driverClass=com.mysql.jdbc.Driver 13 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user-api/src/main/java/com/candao/dubbo/gray/user/api/IUserService.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.user.api; 2 | 3 | import java.util.List; 4 | 5 | 6 | import com.candao.dubbo.gray.common.bean.DistributedContext; 7 | import com.candao.dubbo.gray.user.api.bean.User; 8 | 9 | public interface IUserService { 10 | List getPermissions(DistributedContext distributedContext); 11 | 12 | List getPermissionsWithOrder(DistributedContext distributedContext); 13 | } -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/resources/dubbo.properties: -------------------------------------------------------------------------------- 1 | dubbo.application.name=common-monitor 2 | dubbo.application.owner=bieber 3 | dubbo.registry.address=zookeeper://10.200.102.136:2181 4 | 5 | #use netty4 6 | dubbo.reference.client=netty4 7 | 8 | dubbo.registry.file=dubbo-registry.cache 9 | 10 | #peeper config 11 | peeper.zookeepers=10.200.102.136:2181 12 | peeper.zookeeper.session.timeout=60000 13 | 14 | #logger 15 | monitor.log.home=/monitor-log 16 | 17 | monitor.collect.interval=6000 -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/libs/datepicker/locale/bootstrap-datepicker.zh-CN.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a.fn.datepicker.dates["zh-CN"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],daysShort:["周日","周一","周二","周三","周四","周五","周六"],daysMin:["日","一","二","三","四","五","六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今日",clear:"清除",format:"yyyy年mm月dd日",titleFormat:"yyyy年mm月",weekStart:1}}(jQuery); -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/utils/ContextLoaderListenerWrapper.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.utils; 2 | 3 | import org.springframework.web.context.ContextLoaderListener; 4 | 5 | /** 6 | * Created by bieber on 2015/8/12. 7 | */ 8 | public class ContextLoaderListenerWrapper extends ContextLoaderListener { 9 | static { 10 | System.setProperty("dubbo.application.logger","slf4j"); 11 | System.setProperty("io.netty.allocator.type","pooled"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/modules/common/basic.module.js: -------------------------------------------------------------------------------- 1 | angular.module('dubbokeeperFilters', []).filter('encodeUrl', function() { 2 | return function(input) { 3 | return encodeURIComponent(encodeURIComponent(input)); 4 | }; 5 | }).filter('formatInterfaceName',function(){ 6 | return function(input){ 7 | var items = input.split("."); 8 | for(var i=0;i 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order/src/main/resources/dubbo-order-call-consumers.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order2/src/main/resources/dubbo-order-call-consumers.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user2/src/main/resources/dubbo-user-call-consumers.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order-api/src/main/resources/dubbo-order-consumer.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-entry/src/main/resources/dubbo-user-consumer.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-entry/src/main/resources/dubbo-order-consumer.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/model/BasicResponse.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.model; 2 | 3 | /** 4 | * Created by bieber on 2015/6/12. 5 | */ 6 | public class BasicResponse { 7 | 8 | public static final short SUCCESS=0,FAILED=1; 9 | 10 | private short result=SUCCESS; 11 | 12 | private String memo; 13 | 14 | public short getResult() { 15 | return result; 16 | } 17 | 18 | public void setResult(short result) { 19 | this.result = result; 20 | } 21 | 22 | public String getMemo() { 23 | return memo; 24 | } 25 | 26 | public void setMemo(String memo) { 27 | this.memo = memo; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user/src/main/java/com/candao/dubbo/gray/user/service/datahandler/UserHandler.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.user.service.datahandler; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.springframework.stereotype.Component; 8 | 9 | import com.candao.dubbo.gray.common.bean.DistributedContext; 10 | import com.candao.dubbo.gray.order.api.IOrderService; 11 | import com.candao.dubbo.gray.order.api.bean.Order; 12 | 13 | @Component 14 | public class UserHandler { 15 | 16 | @Resource 17 | private IOrderService orderService; 18 | 19 | public List getOrder(DistributedContext context){ 20 | return orderService.getOrders(context); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/service/GraySwitchService.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.dubboclub.dk.web.bean.Switch; 7 | import com.dubboclub.dk.web.dao.GraySwitchRepository; 8 | 9 | @Service 10 | public class GraySwitchService { 11 | 12 | @Autowired 13 | private GraySwitchRepository graySwitchRepository; 14 | 15 | public Switch getSwitch(){ 16 | return graySwitchRepository.getOne(1); 17 | } 18 | 19 | public Switch updateSwitch(Switch graySwitch){ 20 | return graySwitchRepository.saveAndFlush(graySwitch); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/dialog/dialog.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-dialog { 2 | position: absolute; 3 | left: 0; right: 0; 4 | background: inherit; 5 | z-index: 15; 6 | padding: .1em .8em; 7 | overflow: hidden; 8 | color: inherit; 9 | } 10 | 11 | .CodeMirror-dialog-top { 12 | border-bottom: 1px solid #eee; 13 | top: 0; 14 | } 15 | 16 | .CodeMirror-dialog-bottom { 17 | border-top: 1px solid #eee; 18 | bottom: 0; 19 | } 20 | 21 | .CodeMirror-dialog input { 22 | border: none; 23 | outline: none; 24 | background: transparent; 25 | width: 20em; 26 | color: inherit; 27 | font-family: monospace; 28 | } 29 | 30 | .CodeMirror-dialog button { 31 | font-size: 70%; 32 | } 33 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order/src/main/java/com/candao/dubbo/gray/order/service/datahandler/OrderHandler.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.order.service.datahandler; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.springframework.stereotype.Component; 8 | 9 | import com.candao.dubbo.gray.common.bean.DistributedContext; 10 | import com.candao.dubbo.gray.user.api.IUserService; 11 | import com.candao.dubbo.gray.user.api.bean.User; 12 | 13 | @Component 14 | public class OrderHandler { 15 | 16 | @Resource 17 | private IUserService userService; 18 | 19 | public List getUser(DistributedContext context){ 20 | return userService.getPermissions(context); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order2/src/main/java/com/candao/dubbo/gray/order/service/datahandler/OrderHandler.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.order.service.datahandler; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.springframework.stereotype.Component; 8 | 9 | import com.candao.dubbo.gray.common.bean.DistributedContext; 10 | import com.candao.dubbo.gray.user.api.IUserService; 11 | import com.candao.dubbo.gray.user.api.bean.User; 12 | 13 | @Component 14 | public class OrderHandler { 15 | 16 | @Resource 17 | private IUserService userService; 18 | 19 | public List getUser(DistributedContext context){ 20 | return userService.getPermissions(context); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user2/src/main/java/com/candao/dubbo/gray/user/service/datahandler/UserHandler.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.user.service.datahandler; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.springframework.stereotype.Component; 8 | 9 | import com.candao.dubbo.gray.common.bean.DistributedContext; 10 | import com.candao.dubbo.gray.order.api.IOrderService; 11 | import com.candao.dubbo.gray.order.api.bean.Order; 12 | 13 | @Component 14 | public class UserHandler { 15 | 16 | @Resource 17 | private IOrderService orderService; 18 | 19 | public List getOrder(DistributedContext context){ 20 | return orderService.getOrders(context); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/properties/DubboKeeperConfigurer.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.properties; 2 | 3 | import com.dubboclub.dk.web.utils.ConfigUtils; 4 | import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; 5 | 6 | import java.io.IOException; 7 | import java.util.Properties; 8 | 9 | /** 10 | * Created by bieber on 2015/6/1. 11 | */ 12 | public class DubboKeeperConfigurer extends PropertyPlaceholderConfigurer { 13 | 14 | @Override 15 | protected Properties mergeProperties() throws IOException { 16 | Properties properties = super.mergeProperties(); 17 | ConfigUtils.appendProperties(properties); 18 | return properties; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-entry/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=WARN, systemLog, stdOut 2 | 3 | log4j.logger.com.candao=DEBUG 4 | 5 | # stdOut 6 | log4j.appender.stdOut=org.apache.log4j.ConsoleAppender 7 | log4j.appender.stdOut.layout=org.apache.log4j.PatternLayout 8 | log4j.appender.stdOut.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %m%n 9 | # lbs Log 10 | log4j.appender.systemLog=org.apache.log4j.DailyRollingFileAppender 11 | log4j.appender.systemLog.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.systemLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss};%m%n 13 | log4j.appender.systemLog.file=/home/log/system.log 14 | log4j.appender.systemLog.DatePattern='.'yyyy-MM-dd 15 | log4j.appender.systemLog.append=true 16 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.candao.gray 8 | DubboGray 9 | 0.0.1 10 | 11 | dubbo-gray-common 12 | dubbo-gray-common 13 | http://maven.apache.org 14 | 15 | UTF-8 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user-api/src/main/resources/dubbo-user-consumer.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/theme/neat.css: -------------------------------------------------------------------------------- 1 | .cm-s-neat span.cm-comment { color: #a86; } 2 | .cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; } 3 | .cm-s-neat span.cm-string { color: #a22; } 4 | .cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; } 5 | .cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; } 6 | .cm-s-neat span.cm-variable { color: black; } 7 | .cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; } 8 | .cm-s-neat span.cm-meta {color: #555;} 9 | .cm-s-neat span.cm-link { color: #3a3; } 10 | 11 | .cm-s-neat .CodeMirror-activeline-background {background: #e8f2ff !important;} 12 | .cm-s-neat .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} 13 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/modules/common/util.js: -------------------------------------------------------------------------------- 1 | window.queryString2Object= function (queryString) { 2 | var obj={}; 3 | var items=queryString.split("&"); 4 | for(var i=0;i 2 |
3 | 13 |
14 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/exception/DefaultExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.exception; 2 | 3 | import com.dubboclub.dk.web.model.BasicResponse; 4 | import org.springframework.web.bind.annotation.ControllerAdvice; 5 | import org.springframework.web.bind.annotation.ExceptionHandler; 6 | import org.springframework.web.bind.annotation.ResponseBody; 7 | 8 | /** 9 | * Created by bieber on 2015/6/15. 10 | */ 11 | @ControllerAdvice 12 | public class DefaultExceptionHandler { 13 | 14 | @ExceptionHandler(DataHadChangedException.class) 15 | public @ResponseBody 16 | BasicResponse dataHadChanged(){ 17 | BasicResponse response = new BasicResponse(); 18 | response.setResult(BasicResponse.FAILED); 19 | response.setMemo("数据已经发生变更!"); 20 | return response; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/theme/elegant.css: -------------------------------------------------------------------------------- 1 | .cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;} 2 | .cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;} 3 | .cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;} 4 | .cm-s-elegant span.cm-variable {color: black;} 5 | .cm-s-elegant span.cm-variable-2 {color: #b11;} 6 | .cm-s-elegant span.cm-qualifier {color: #555;} 7 | .cm-s-elegant span.cm-keyword {color: #730;} 8 | .cm-s-elegant span.cm-builtin {color: #30a;} 9 | .cm-s-elegant span.cm-link {color: #762;} 10 | .cm-s-elegant span.cm-error {background-color: #fdd;} 11 | 12 | .cm-s-elegant .CodeMirror-activeline-background {background: #e8f2ff !important;} 13 | .cm-s-elegant .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} 14 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/hint/show-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-hints { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | list-style: none; 6 | 7 | margin: 0; 8 | padding: 2px; 9 | 10 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 11 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 12 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 13 | border-radius: 3px; 14 | border: 1px solid silver; 15 | 16 | background: white; 17 | font-size: 90%; 18 | font-family: monospace; 19 | 20 | max-height: 20em; 21 | overflow-y: auto; 22 | } 23 | 24 | .CodeMirror-hint { 25 | margin: 0; 26 | padding: 0 4px; 27 | border-radius: 2px; 28 | max-width: 19em; 29 | overflow: hidden; 30 | white-space: pre; 31 | color: black; 32 | cursor: pointer; 33 | } 34 | 35 | li.CodeMirror-hint-active { 36 | background: #08f; 37 | color: white; 38 | } 39 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/libs/angularjs/angular-cookies.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.3.15 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(p,f,n){'use strict';f.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(e,b){var c={},g={},h,k=!1,l=f.copy,m=f.isUndefined;b.addPollFn(function(){var a=b.cookies();h!=a&&(h=a,l(a,g),l(a,c),k&&e.$apply())})();k=!0;e.$watch(function(){var a,d,e;for(a in g)m(c[a])&&b.cookies(a,n);for(a in c)d=c[a],f.isString(d)||(d=""+d,c[a]=d),d!==g[a]&&(b.cookies(a,d),e=!0);if(e)for(a in d=b.cookies(),c)c[a]!==d[a]&&(m(d[a])?delete c[a]:c[a]=d[a])});return c}]).factory("$cookieStore", 7 | ["$cookies",function(e){return{get:function(b){return(b=e[b])?f.fromJson(b):b},put:function(b,c){e[b]=f.toJson(c)},remove:function(b){delete e[b]}}}])})(window,window.angular); 8 | //# sourceMappingURL=angular-cookies.min.js.map 9 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order-api/src/main/java/com/candao/dubbo/gray/order/api/bean/Order.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.order.api.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | public class Order implements Serializable{ 6 | 7 | /** 8 | * 9 | */ 10 | private static final long serialVersionUID = -2630867422747334063L; 11 | 12 | private String orderId; 13 | 14 | private String orderName; 15 | 16 | private Object user; 17 | 18 | public String getOrderId() { 19 | return orderId; 20 | } 21 | 22 | public void setOrderId(String orderId) { 23 | this.orderId = orderId; 24 | } 25 | 26 | public String getOrderName() { 27 | return orderName; 28 | } 29 | 30 | public void setOrderName(String orderName) { 31 | this.orderName = orderName; 32 | } 33 | 34 | public Object getUser() { 35 | return user; 36 | } 37 | 38 | public void setUser(Object user) { 39 | this.user = user; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-entry/src/main/resources/dubbo-consumer.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/model/RouteAbstractInfo.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.model; 2 | 3 | /** 4 | * Created by bieber on 2015/8/1. 5 | */ 6 | public class RouteAbstractInfo { 7 | 8 | private String applicationName; 9 | 10 | private String serviceKey; 11 | 12 | private int routeCount; 13 | 14 | public String getApplicationName() { 15 | return applicationName; 16 | } 17 | 18 | public void setApplicationName(String applicationName) { 19 | this.applicationName = applicationName; 20 | } 21 | 22 | public String getServiceKey() { 23 | return serviceKey; 24 | } 25 | 26 | public void setServiceKey(String serviceKey) { 27 | this.serviceKey = serviceKey; 28 | } 29 | 30 | public int getRouteCount() { 31 | return routeCount; 32 | } 33 | 34 | public void setRouteCount(int routeCount) { 35 | this.routeCount = routeCount; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/resources/META-INF/spring/init.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | classpath*:/dubbo.properties 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/mode/multiplex_test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | CodeMirror.defineMode("markdown_with_stex", function(){ 6 | var inner = CodeMirror.getMode({}, "stex"); 7 | var outer = CodeMirror.getMode({}, "markdown"); 8 | 9 | var innerOptions = { 10 | open: '$', 11 | close: '$', 12 | mode: inner, 13 | delimStyle: 'delim', 14 | innerStyle: 'inner' 15 | }; 16 | 17 | return CodeMirror.multiplexingMode(outer, innerOptions); 18 | }); 19 | 20 | var mode = CodeMirror.getMode({}, "markdown_with_stex"); 21 | 22 | function MT(name) { 23 | test.mode( 24 | name, 25 | mode, 26 | Array.prototype.slice.call(arguments, 1), 27 | 'multiplexing'); 28 | } 29 | 30 | MT( 31 | "stexInsideMarkdown", 32 | "[strong **Equation:**] [delim $][inner&tag \\pi][delim $]"); 33 | })(); 34 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/lint/yaml-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | // Depends on js-yaml.js from https://github.com/nodeca/js-yaml 15 | 16 | // declare global: jsyaml 17 | 18 | CodeMirror.registerHelper("lint", "yaml", function(text) { 19 | var found = []; 20 | try { jsyaml.load(text); } 21 | catch(e) { 22 | var loc = e.mark; 23 | found.push({ from: CodeMirror.Pos(loc.line, loc.column), to: CodeMirror.Pos(loc.line, loc.column), message: e.message }); 24 | } 25 | return found; 26 | }); 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/utils/HttpResult.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.utils; 2 | 3 | import org.apache.http.HttpResponse; 4 | import org.apache.http.HttpStatus; 5 | 6 | /** 7 | * 请求结果 8 | * 9 | * @author jameslei 10 | * @version 1.0.0 2017年5月5日 下午5:35:06 11 | */ 12 | public class HttpResult { 13 | 14 | /** 15 | * 请求代码,如200、500、503等 16 | */ 17 | public int statusCode; 18 | 19 | /** 20 | * 结果内容 21 | */ 22 | public String content; 23 | 24 | /** 执行出现异常的异常信息 */ 25 | public String errorMsg; 26 | 27 | public HttpResponse response; 28 | 29 | public HttpResult(){} 30 | 31 | public HttpResult(int statusCode){ 32 | this.statusCode = statusCode; 33 | } 34 | 35 | /** 36 | * 请求是否正常 37 | * @return 38 | */ 39 | public boolean isOk() { 40 | return statusCode == HttpStatus.SC_OK; 41 | } 42 | 43 | @Override 44 | public String toString() { 45 | return "HttpResult [statusCode=" + statusCode + ", content=" + content + ", errorMsg=" + errorMsg + "]"; 46 | } 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.candao.gray 8 | DubboGray 9 | 0.0.1 10 | 11 | dubbo-gray-core 12 | dubbo-gray-core 13 | http://maven.apache.org 14 | 15 | UTF-8 16 | 17 | 18 | 19 | com.alibaba 20 | fastjson 21 | 1.1.41 22 | 23 | 24 | com.candao.gray 25 | dubbo-gray-common 26 | 0.0.1 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-entry/src/main/java/com/candao/dubbo/gray/entry/net/HttpResult.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.entry.net; 2 | 3 | import org.apache.http.HttpResponse; 4 | import org.apache.http.HttpStatus; 5 | 6 | /** 7 | * 请求结果 8 | * 9 | * @author jameslei 10 | * @version 1.0.0 2017年5月5日 下午5:35:06 11 | */ 12 | public class HttpResult { 13 | 14 | /** 15 | * 请求代码,如200、500、503等 16 | */ 17 | public int statusCode; 18 | 19 | /** 20 | * 结果内容 21 | */ 22 | public String content; 23 | 24 | /** 执行出现异常的异常信息 */ 25 | public String errorMsg; 26 | 27 | public HttpResponse response; 28 | 29 | public HttpResult(){} 30 | 31 | public HttpResult(int statusCode){ 32 | this.statusCode = statusCode; 33 | } 34 | 35 | /** 36 | * 请求是否正常 37 | * @return 38 | */ 39 | public boolean isOk() { 40 | return statusCode == HttpStatus.SC_OK; 41 | } 42 | 43 | @Override 44 | public String toString() { 45 | return "HttpResult [statusCode=" + statusCode + ", content=" + content + ", errorMsg=" + errorMsg + "]"; 46 | } 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user-api/src/main/java/com/candao/dubbo/gray/user/api/bean/User.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.user.api.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | public class User implements Serializable { 6 | 7 | private static final long serialVersionUID = -2741112503223057473L; 8 | 9 | /** 用户id*/ 10 | public int uid; 11 | public String userName = ""; 12 | 13 | /** 用户昵称,原系统username */ 14 | public String nickName = ""; 15 | 16 | /** 手机号码 */ 17 | public String phone = ""; 18 | 19 | public int getUid() { 20 | return uid; 21 | } 22 | 23 | public void setUid(int uid) { 24 | this.uid = uid; 25 | } 26 | 27 | public String getUserName() { 28 | return userName; 29 | } 30 | 31 | public void setUserName(String userName) { 32 | this.userName = userName; 33 | } 34 | 35 | public String getNickName() { 36 | return nickName; 37 | } 38 | 39 | public void setNickName(String nickName) { 40 | this.nickName = nickName; 41 | } 42 | 43 | public String getPhone() { 44 | return phone; 45 | } 46 | 47 | public void setPhone(String phone) { 48 | this.phone = phone; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order/src/main/resources/dubbo-order-provider.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order2/src/main/resources/dubbo-order-provider.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/lint/json-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on jsonlint.js from https://github.com/zaach/jsonlint 5 | 6 | // declare global: jsonlint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "json", function(text) { 19 | var found = []; 20 | jsonlint.parseError = function(str, hash) { 21 | var loc = hash.loc; 22 | found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column), 23 | to: CodeMirror.Pos(loc.last_line - 1, loc.last_column), 24 | message: str}); 25 | }; 26 | try { jsonlint.parse(text); } 27 | catch(e) {} 28 | return found; 29 | }); 30 | 31 | }); 32 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/service/GrayStrategyService.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.dubboclub.dk.web.bean.GrayStrategy; 9 | import com.dubboclub.dk.web.dao.GrayStrategyRepository; 10 | 11 | 12 | @Service 13 | public class GrayStrategyService { 14 | 15 | @Autowired 16 | private GrayStrategyRepository grayStrategyRepository; 17 | 18 | public List getAllStrategy(){ 19 | return grayStrategyRepository.findAll(); 20 | } 21 | 22 | public GrayStrategy getStrategyById(Integer id){ 23 | return grayStrategyRepository.getOne(id); 24 | } 25 | 26 | public GrayStrategy updateStrategyById(GrayStrategy grayStrategy){ 27 | return grayStrategyRepository.saveAndFlush(grayStrategy); 28 | } 29 | 30 | public GrayStrategy saveStrategy(GrayStrategy grayStrategy){ 31 | return grayStrategyRepository.save(grayStrategy); 32 | } 33 | 34 | public void deleteStrategyById(Integer id){ 35 | grayStrategyRepository.delete(id); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/theme/neo.css: -------------------------------------------------------------------------------- 1 | /* neo theme for codemirror */ 2 | 3 | /* Color scheme */ 4 | 5 | .cm-s-neo.CodeMirror { 6 | background-color:#ffffff; 7 | color:#2e383c; 8 | line-height:1.4375; 9 | } 10 | .cm-s-neo .cm-comment {color:#75787b} 11 | .cm-s-neo .cm-keyword, .cm-s-neo .cm-property {color:#1d75b3} 12 | .cm-s-neo .cm-atom,.cm-s-neo .cm-number {color:#75438a} 13 | .cm-s-neo .cm-node,.cm-s-neo .cm-tag {color:#9c3328} 14 | .cm-s-neo .cm-string {color:#b35e14} 15 | .cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier {color:#047d65} 16 | 17 | 18 | /* Editor styling */ 19 | 20 | .cm-s-neo pre { 21 | padding:0; 22 | } 23 | 24 | .cm-s-neo .CodeMirror-gutters { 25 | border:none; 26 | border-right:10px solid transparent; 27 | background-color:transparent; 28 | } 29 | 30 | .cm-s-neo .CodeMirror-linenumber { 31 | padding:0; 32 | color:#e0e2e5; 33 | } 34 | 35 | .cm-s-neo .CodeMirror-guttermarker { color: #1d75b3; } 36 | .cm-s-neo .CodeMirror-guttermarker-subtle { color: #e0e2e5; } 37 | 38 | .cm-s-neo div.CodeMirror-cursor { 39 | width: auto; 40 | border: 0; 41 | background: rgba(155,157,162,0.37); 42 | z-index: 1; 43 | } 44 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/edit/trailingspace.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) { 13 | if (prev == CodeMirror.Init) prev = false; 14 | if (prev && !val) 15 | cm.removeOverlay("trailingspace"); 16 | else if (!prev && val) 17 | cm.addOverlay({ 18 | token: function(stream) { 19 | for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {} 20 | if (i > stream.pos) { stream.pos = i; return null; } 21 | stream.pos = l; 22 | return "trailingspace"; 23 | }, 24 | name: "trailingspace" 25 | }); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/multiselect/bootstrap-multiselect.css: -------------------------------------------------------------------------------- 1 | .multiselect-container{position:absolute;list-style-type:none;margin:0;padding:0}.multiselect-container .input-group{margin:5px}.multiselect-container>li{padding:0}.multiselect-container>li>a.multiselect-all label{font-weight:700}.multiselect-container>li.multiselect-group label{margin:0;padding:3px 20px 3px 20px;height:100%;font-weight:700}.multiselect-container>li.multiselect-group-clickable label{cursor:pointer}.multiselect-container>li>a{padding:0}.multiselect-container>li>a>label{margin:0;height:100%;cursor:pointer;font-weight:400;padding:3px 20px 3px 40px}.multiselect-container>li>a>label.radio,.multiselect-container>li>a>label.checkbox{margin:0}.multiselect-container>li>a>label>input[type=checkbox]{margin-bottom:5px}.btn-group>.btn-group:nth-child(2)>.multiselect.btn{border-top-left-radius:4px;border-bottom-left-radius:4px}.form-inline .multiselect-container label.checkbox,.form-inline .multiselect-container label.radio{padding:3px 20px 3px 40px}.form-inline .multiselect-container li a label.checkbox input[type=checkbox],.form-inline .multiselect-container li a label.radio input[type=radio]{margin-left:-20px;margin-right:0} -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/bean/Switch.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.NamedQuery; 11 | import javax.persistence.Table; 12 | 13 | import org.springframework.context.annotation.Lazy; 14 | 15 | @Entity 16 | @Table(name="grayswitch") 17 | public class Switch implements Serializable{ 18 | 19 | /** 20 | * 21 | */ 22 | private static final long serialVersionUID = 8715996860655335947L; 23 | 24 | @Id 25 | @GeneratedValue(strategy = GenerationType.IDENTITY) 26 | private Integer id; 27 | 28 | @Column(name = "gray_switch") 29 | private Integer graySwitch; 30 | 31 | public Switch() { 32 | } 33 | 34 | public Integer getId() { 35 | return id; 36 | } 37 | 38 | public void setId(Integer id) { 39 | this.id = id; 40 | } 41 | 42 | public Integer getGraySwitch() { 43 | return graySwitch; 44 | } 45 | 46 | public void setGraySwitch(Integer graySwitch) { 47 | this.graySwitch = graySwitch; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | com.candao.gray 9 | DubboGray 10 | 0.0.1 11 | 12 | 13 | dubbo-gray-user-api 14 | dubbo-gray-user-api 15 | http://maven.apache.org 16 | 17 | UTF-8 18 | 19 | 20 | 21 | com.candao.gray 22 | dubbo-gray-common 23 | 0.0.1 24 | 25 | 26 | 27 | 28 | 29 | org.apache.maven.plugins 30 | maven-surefire-plugin 31 | 2.6 32 | 33 | true 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.candao.gray 8 | DubboGray 9 | 0.0.1 10 | 11 | dubbo-gray-order-api 12 | dubbo-gray-order-api 13 | http://maven.apache.org 14 | 15 | UTF-8 16 | 17 | 18 | 19 | 20 | com.candao.gray 21 | dubbo-gray-common 22 | 0.0.1 23 | 24 | 25 | 26 | 27 | 28 | 29 | org.apache.maven.plugins 30 | maven-surefire-plugin 31 | 2.6 32 | 33 | true 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.candao.gray 8 | DubboGray 9 | 0.0.1 10 | 11 | dubbo-gray-order2 12 | dubbo-gray-order2 13 | http://maven.apache.org 14 | 15 | UTF-8 16 | 17 | 18 | 19 | com.candao.gray 20 | dubbo-gray-order-api 21 | 0.0.1 22 | 23 | 24 | 25 | com.candao.gray 26 | dubbo-gray-user-api 27 | 0.0.1 28 | 29 | 30 | 31 | com.candao.gray 32 | dubbo-gray-core 33 | 0.0.1 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.candao.gray 8 | DubboGray 9 | 0.0.1 10 | 11 | dubbo-gray-user 12 | dubbo-gray-user 13 | http://maven.apache.org 14 | 15 | UTF-8 16 | 17 | 18 | 19 | com.candao.gray 20 | dubbo-gray-user-api 21 | 0.0.1 22 | 23 | 24 | 25 | com.candao.gray 26 | dubbo-gray-order-api 27 | 0.0.1 28 | 29 | 30 | 31 | com.candao.gray 32 | dubbo-gray-core 33 | 0.0.1 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.candao.gray 8 | DubboGray 9 | 0.0.1 10 | 11 | dubbo-gray-user2 12 | dubbo-gray-user2 13 | http://maven.apache.org 14 | 15 | UTF-8 16 | 17 | 18 | 19 | com.candao.gray 20 | dubbo-gray-user-api 21 | 0.0.1 22 | 23 | 24 | 25 | com.candao.gray 26 | dubbo-gray-order-api 27 | 0.0.1 28 | 29 | 30 | 31 | com.candao.gray 32 | dubbo-gray-core 33 | 0.0.1 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/theme/eclipse.css: -------------------------------------------------------------------------------- 1 | .cm-s-eclipse span.cm-meta {color: #FF1717;} 2 | .cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; } 3 | .cm-s-eclipse span.cm-atom {color: #219;} 4 | .cm-s-eclipse span.cm-number {color: #164;} 5 | .cm-s-eclipse span.cm-def {color: #00f;} 6 | .cm-s-eclipse span.cm-variable {color: black;} 7 | .cm-s-eclipse span.cm-variable-2 {color: #0000C0;} 8 | .cm-s-eclipse span.cm-variable-3 {color: #0000C0;} 9 | .cm-s-eclipse span.cm-property {color: black;} 10 | .cm-s-eclipse span.cm-operator {color: black;} 11 | .cm-s-eclipse span.cm-comment {color: #3F7F5F;} 12 | .cm-s-eclipse span.cm-string {color: #2A00FF;} 13 | .cm-s-eclipse span.cm-string-2 {color: #f50;} 14 | .cm-s-eclipse span.cm-qualifier {color: #555;} 15 | .cm-s-eclipse span.cm-builtin {color: #30a;} 16 | .cm-s-eclipse span.cm-bracket {color: #cc7;} 17 | .cm-s-eclipse span.cm-tag {color: #170;} 18 | .cm-s-eclipse span.cm-attribute {color: #00c;} 19 | .cm-s-eclipse span.cm-link {color: #219;} 20 | .cm-s-eclipse span.cm-error {color: #f00;} 21 | 22 | .cm-s-eclipse .CodeMirror-activeline-background {background: #e8f2ff !important;} 23 | .cm-s-eclipse .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} 24 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/clike/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-c"); 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 7 | 8 | MT("indent", 9 | "[variable-3 void] [def foo]([variable-3 void*] [variable a], [variable-3 int] [variable b]) {", 10 | " [variable-3 int] [variable c] [operator =] [variable b] [operator +]", 11 | " [number 1];", 12 | " [keyword return] [operator *][variable a];", 13 | "}"); 14 | 15 | MT("indent_switch", 16 | "[keyword switch] ([variable x]) {", 17 | " [keyword case] [number 10]:", 18 | " [keyword return] [number 20];", 19 | " [keyword default]:", 20 | " [variable printf]([string \"foo %c\"], [variable x]);", 21 | "}"); 22 | 23 | MT("def", 24 | "[variable-3 void] [def foo]() {}", 25 | "[keyword struct] [def bar]{}", 26 | "[variable-3 int] [variable-3 *][def baz]() {}"); 27 | 28 | MT("double_block", 29 | "[keyword for] (;;)", 30 | " [keyword for] (;;)", 31 | " [variable x][operator ++];", 32 | "[keyword return];"); 33 | })(); 34 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/templates/statistics/app-dependencies.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 6 | 7 |
8 | 9 | 提供者 10 | 消费者 11 | 即是提供者也是消费者 12 | 13 | 14 |
15 |
16 |
17 |
18 |
19 | 20 |
21 |
22 | 23 |
24 |
-------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/utils/ContextUtils.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.utils; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | 5 | import java.util.Collection; 6 | 7 | /** 8 | * Created by bieber on 2015/6/1. 9 | */ 10 | public class ContextUtils { 11 | 12 | private static ApplicationContext APPLICATION_CONTEXT; 13 | 14 | public static void setContext(ApplicationContext context){ 15 | if(APPLICATION_CONTEXT==null){ 16 | APPLICATION_CONTEXT = context; 17 | } 18 | } 19 | 20 | public static T getBean(Class type){ 21 | checkApplicationContext(); 22 | return APPLICATION_CONTEXT.getBean(type); 23 | } 24 | 25 | public static T getBean(String beanId){ 26 | checkApplicationContext(); 27 | return (T) APPLICATION_CONTEXT.getBean(beanId); 28 | } 29 | 30 | public static Collection getBeans(Class type){ 31 | checkApplicationContext(); 32 | return APPLICATION_CONTEXT.getBeansOfType(type).values(); 33 | } 34 | 35 | 36 | private static void checkApplicationContext(){ 37 | if(APPLICATION_CONTEXT==null){ 38 | throw new IllegalAccessError("must set ApplicatonContext first!"); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/lint/css-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on csslint.js from https://github.com/stubbornella/csslint 5 | 6 | // declare global: CSSLint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "css", function(text) { 19 | var found = []; 20 | if (!window.CSSLint) return found; 21 | var results = CSSLint.verify(text), messages = results.messages, message = null; 22 | for ( var i = 0; i < messages.length; i++) { 23 | message = messages[i]; 24 | var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col; 25 | found.push({ 26 | from: CodeMirror.Pos(startLine, startCol), 27 | to: CodeMirror.Pos(endLine, endCol), 28 | message: message.message, 29 | severity : message.type 30 | }); 31 | } 32 | return found; 33 | }); 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user/src/main/resources/dubbo-user-provider.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-entry/src/main/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | classpath:zookeeper.properties 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user/src/main/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | zookeeper.properties 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/modules/common/filter.js: -------------------------------------------------------------------------------- 1 | var queryFilter=angular.module("queryFilter",[]); 2 | queryFilter.$queryFilter=function(){ 3 | this.filterMethod=function(originData,query){ 4 | var filterResult=[]; 5 | for(var i=0;i 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | zookeeper.properties 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order2/src/main/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | zookeeper.properties 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user2/src/main/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | zookeeper.properties 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user2/src/main/resources/dubbo-user-provider.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/diff/diff.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineMode("diff", function() { 15 | 16 | var TOKEN_NAMES = { 17 | '+': 'positive', 18 | '-': 'negative', 19 | '@': 'meta' 20 | }; 21 | 22 | return { 23 | token: function(stream) { 24 | var tw_pos = stream.string.search(/[\t ]+?$/); 25 | 26 | if (!stream.sol() || tw_pos === 0) { 27 | stream.skipToEnd(); 28 | return ("error " + ( 29 | TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, ''); 30 | } 31 | 32 | var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd(); 33 | 34 | if (tw_pos === -1) { 35 | stream.skipToEnd(); 36 | } else { 37 | stream.pos = tw_pos; 38 | } 39 | 40 | return token_name; 41 | } 42 | }; 43 | }); 44 | 45 | CodeMirror.defineMIME("text/x-diff", "diff"); 46 | 47 | }); 48 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-entry/src/main/jetty/ServerStartupMerchantsEntry.java: -------------------------------------------------------------------------------- 1 | import org.mortbay.jetty.Connector; 2 | import org.mortbay.jetty.Server; 3 | import org.mortbay.jetty.handler.RequestLogHandler; 4 | import org.mortbay.jetty.nio.SelectChannelConnector; 5 | import org.mortbay.jetty.webapp.WebAppContext; 6 | 7 | public class ServerStartupMerchantsEntry { 8 | private Server server; 9 | 10 | public static void main(String[] args) { 11 | ServerStartupMerchantsEntry web = new ServerStartupMerchantsEntry(); 12 | web.startup(); 13 | } 14 | 15 | public ServerStartupMerchantsEntry() { 16 | } 17 | 18 | public void startup() { 19 | server = new Server(); 20 | 21 | Connector connector = new SelectChannelConnector(); 22 | int wapPort = 82; 23 | connector.setPort(wapPort); 24 | connector.setHost("0.0.0.0"); 25 | server.setConnectors(new Connector[] { connector }); 26 | 27 | WebAppContext context = new WebAppContext("src/main/webapp", "/"); 28 | 29 | server.addHandler(context); 30 | RequestLogHandler requestLogHandler = new RequestLogHandler(); 31 | server.addHandler(requestLogHandler); 32 | try { 33 | server.setStopAtShutdown(true); 34 | server.setSendServerVersion(true); 35 | server.start(); 36 | } catch (Exception e) { 37 | e.printStackTrace(); 38 | } 39 | } 40 | 41 | public void shutdown() { 42 | try { 43 | server.stop(); 44 | } catch (Exception e) { 45 | e.printStackTrace(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/tern/worker.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // declare global: tern, server 5 | 6 | var server; 7 | 8 | this.onmessage = function(e) { 9 | var data = e.data; 10 | switch (data.type) { 11 | case "init": return startServer(data.defs, data.plugins, data.scripts); 12 | case "add": return server.addFile(data.name, data.text); 13 | case "del": return server.delFile(data.name); 14 | case "req": return server.request(data.body, function(err, reqData) { 15 | postMessage({id: data.id, body: reqData, err: err && String(err)}); 16 | }); 17 | case "getFile": 18 | var c = pending[data.id]; 19 | delete pending[data.id]; 20 | return c(data.err, data.text); 21 | default: throw new Error("Unknown message type: " + data.type); 22 | } 23 | }; 24 | 25 | var nextId = 0, pending = {}; 26 | function getFile(file, c) { 27 | postMessage({type: "getFile", name: file, id: ++nextId}); 28 | pending[nextId] = c; 29 | } 30 | 31 | function startServer(defs, plugins, scripts) { 32 | if (scripts) importScripts.apply(null, scripts); 33 | 34 | server = new tern.Server({ 35 | getFile: getFile, 36 | async: true, 37 | defs: defs, 38 | plugins: plugins 39 | }); 40 | } 41 | 42 | this.console = { 43 | log: function(v) { postMessage({type: "debug", message: v}); } 44 | }; 45 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/jetty/com/candao/jetty/ServerStartupMerchantsEntry.java: -------------------------------------------------------------------------------- 1 | package com.candao.jetty; 2 | import org.mortbay.jetty.Connector; 3 | import org.mortbay.jetty.Server; 4 | import org.mortbay.jetty.handler.RequestLogHandler; 5 | import org.mortbay.jetty.nio.SelectChannelConnector; 6 | import org.mortbay.jetty.webapp.WebAppContext; 7 | 8 | public class ServerStartupMerchantsEntry { 9 | private Server server; 10 | 11 | public static void main(String[] args) { 12 | ServerStartupMerchantsEntry web = new ServerStartupMerchantsEntry(); 13 | web.startup(); 14 | } 15 | 16 | public ServerStartupMerchantsEntry() { 17 | } 18 | 19 | public void startup() { 20 | server = new Server(); 21 | 22 | int wapPort = 82; 23 | Connector connector = new SelectChannelConnector(); 24 | connector.setPort(wapPort); 25 | connector.setHost("0.0.0.0"); 26 | server.setConnectors(new Connector[] { connector }); 27 | 28 | WebAppContext context = new WebAppContext("src/main/webapp", "/"); 29 | 30 | server.addHandler(context); 31 | RequestLogHandler requestLogHandler = new RequestLogHandler(); 32 | server.addHandler(requestLogHandler); 33 | try { 34 | server.setStopAtShutdown(true); 35 | server.setSendServerVersion(true); 36 | server.start(); 37 | } catch (Exception e) { 38 | e.printStackTrace(); 39 | } 40 | } 41 | 42 | public void shutdown() { 43 | try { 44 | server.stop(); 45 | } catch (Exception e) { 46 | e.printStackTrace(); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/lint/coffeescript-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js 5 | 6 | // declare global: coffeelint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "coffeescript", function(text) { 19 | var found = []; 20 | var parseError = function(err) { 21 | var loc = err.lineNumber; 22 | found.push({from: CodeMirror.Pos(loc-1, 0), 23 | to: CodeMirror.Pos(loc, 0), 24 | severity: err.level, 25 | message: err.message}); 26 | }; 27 | try { 28 | var res = coffeelint.lint(text); 29 | for(var i = 0; i < res.length; i++) { 30 | parseError(res[i]); 31 | } 32 | } catch(e) { 33 | found.push({from: CodeMirror.Pos(e.location.first_line, 0), 34 | to: CodeMirror.Pos(e.location.last_line, e.location.last_column), 35 | severity: 'error', 36 | message: e.message}); 37 | } 38 | return found; 39 | }); 40 | 41 | }); 42 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user/src/main/java/com/candao/dubbo/gray/user/service/UserService2.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.user.service; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import com.alibaba.dubbo.common.utils.StringUtils; 7 | import com.alibaba.dubbo.rpc.RpcContext; 8 | import com.candao.dubbo.gray.common.bean.DistributedContext; 9 | import com.candao.dubbo.gray.user.api.IUserService2; 10 | import com.candao.dubbo.gray.user.api.bean.User; 11 | 12 | public class UserService2 implements IUserService2 { 13 | 14 | @Override 15 | public List getPermissions(DistributedContext distributedContext) { 16 | List list = new ArrayList(); 17 | User user2 = new User(); 18 | user2.setPhone("13570983345"); 19 | user2.setUserName("刘练源"); 20 | user2.setUid(1140120103); 21 | if (distributedContext.getGrayBean() != null) { 22 | String value = RpcContext.getContext().getUrl().getParameter(distributedContext.getGrayBean().getGrayKey()); 23 | if (StringUtils.isEmpty(value)) { 24 | user2.setNickName("我是user-service1,灰度服务寻找不到,进入正常服务,host:" + RpcContext.getContext().getLocalHost()+":"+RpcContext.getContext().getLocalPort()); 25 | }else{ 26 | user2.setNickName("我是user-service1,灰度策略:" +distributedContext.getGrayBean().getGrayKey() + " " + value); 27 | } 28 | }else{ 29 | user2.setNickName("我是user-service1,正常服务,host:" + RpcContext.getContext().getLocalHost()+":"+RpcContext.getContext().getLocalPort()); 30 | } 31 | list.add(user2); 32 | return list; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user2/src/main/java/com/candao/dubbo/gray/user/service/UserService2.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.user.service; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import com.alibaba.dubbo.common.utils.StringUtils; 7 | import com.alibaba.dubbo.rpc.RpcContext; 8 | import com.candao.dubbo.gray.common.bean.DistributedContext; 9 | import com.candao.dubbo.gray.user.api.IUserService2; 10 | import com.candao.dubbo.gray.user.api.bean.User; 11 | 12 | public class UserService2 implements IUserService2 { 13 | 14 | @Override 15 | public List getPermissions(DistributedContext distributedContext) { 16 | List list = new ArrayList(); 17 | User user2 = new User(); 18 | user2.setPhone("13570983345"); 19 | user2.setUserName("刘练源"); 20 | user2.setUid(1140120103); 21 | if (distributedContext.getGrayBean() != null) { 22 | String value = RpcContext.getContext().getUrl().getParameter(distributedContext.getGrayBean().getGrayKey()); 23 | if (StringUtils.isEmpty(value)) { 24 | user2.setNickName("我是user-service2,灰度服务寻找不到,进入正常服务,host:" + RpcContext.getContext().getLocalHost()+":"+RpcContext.getContext().getLocalPort()); 25 | }else{ 26 | user2.setNickName("我是user-service2,灰度策略:" +distributedContext.getGrayBean().getGrayKey() + " " + value); 27 | } 28 | }else{ 29 | user2.setNickName("我是user-service2,我是正常服务,host:" + RpcContext.getContext().getLocalHost()+":"+RpcContext.getContext().getLocalPort()); 30 | } 31 | list.add(user2); 32 | return list; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/runmode/colorize.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror"), require("./runmode")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror", "./runmode"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/; 15 | 16 | function textContent(node, out) { 17 | if (node.nodeType == 3) return out.push(node.nodeValue); 18 | for (var ch = node.firstChild; ch; ch = ch.nextSibling) { 19 | textContent(ch, out); 20 | if (isBlock.test(node.nodeType)) out.push("\n"); 21 | } 22 | } 23 | 24 | CodeMirror.colorize = function(collection, defaultMode) { 25 | if (!collection) collection = document.body.getElementsByTagName("pre"); 26 | 27 | for (var i = 0; i < collection.length; ++i) { 28 | var node = collection[i]; 29 | var mode = node.getAttribute("data-lang") || defaultMode; 30 | if (!mode) continue; 31 | 32 | var text = []; 33 | textContent(node, text); 34 | node.innerHTML = ""; 35 | CodeMirror.runMode(text.join(""), mode, node); 36 | 37 | node.className += " cm-s-default"; 38 | } 39 | }; 40 | }); 41 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/asciiarmor/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: ASCII Armor (PGP) mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

ASCII Armor (PGP) mode

27 |
36 | 37 | 42 | 43 |

MIME types 44 | defined: application/pgp, application/pgp-keys, application/pgp-signature

45 | 46 |
47 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user-api/src/main/java/com/candao/dubbo/gray/user/api/bean/GrayUser.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.user.api.bean; 2 | public class GrayUser { 3 | 4 | private Integer id; 5 | 6 | private String userName; 7 | 8 | private String serviceTag; 9 | 10 | private String serviceValue; 11 | 12 | private String strategy; 13 | 14 | private Integer weight; 15 | 16 | private Integer status; 17 | 18 | public Integer getId() { 19 | return id; 20 | } 21 | 22 | public void setId(Integer id) { 23 | this.id = id; 24 | } 25 | 26 | public String getUserName() { 27 | return userName; 28 | } 29 | 30 | public void setUserName(String userName) { 31 | this.userName = userName; 32 | } 33 | 34 | public String getServiceTag() { 35 | return serviceTag; 36 | } 37 | 38 | public void setServiceTag(String serviceTag) { 39 | this.serviceTag = serviceTag; 40 | } 41 | 42 | public String getServiceValue() { 43 | return serviceValue; 44 | } 45 | 46 | public void setServiceValue(String serviceValue) { 47 | this.serviceValue = serviceValue; 48 | } 49 | 50 | public Integer getWeight() { 51 | return weight; 52 | } 53 | 54 | public void setWeight(Integer weight) { 55 | this.weight = weight; 56 | } 57 | 58 | public String getStrategy() { 59 | return strategy; 60 | } 61 | 62 | public void setStrategy(String strategy) { 63 | this.strategy = strategy; 64 | } 65 | 66 | public Integer getStatus() { 67 | return status; 68 | } 69 | 70 | public void setStatus(Integer status) { 71 | this.status = status; 72 | } 73 | } -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/libs/showdown/showdown-table.min.js: -------------------------------------------------------------------------------- 1 | /*! showdown-table 17-06-2015 */ 2 | 3 | !function(){"use strict";var a=function(a){var b,c={},d="text-align:left;";return c.th=function(a){if(""===a.trim())return"";var b=a.trim().replace(/ /g,"_").toLowerCase();return''+a+""},c.td=function(b){return''+a.makeHtml(b)+""},c.ths=function(){var a="",b=0,d=[].slice.apply(arguments);for(b;b\n",a+="\n"},c.tr=function(){var a,b=[].slice.apply(arguments);return a="\n",a+=c.tds.apply(this,b),a+="\n"},b=function(a){var b,d,e=0,f=a.split("\n"),g=[];for(e;e"),d=b.substring(1,b.length-1).split("|"),h.push(c.thead.apply(this,d)),b=f[++e],b.trim().match(/^[|][-=|: ]+[|]$/)){for(b=f[++e],h.push("");b.trim().match(/^[|].*[|]$/);)b=b.trim(),h.push(c.tr.apply(this,b.substring(1,b.length-1).split("|"))),b=f[++e];h.push(""),h.push(""),g.push(h.join("\n"));continue}b=f[--e]}g.push(b)}return g.join("\n")},[{type:"lang",filter:b}]};"undefined"!=typeof window&&window.showdown&&window.showdown.extensions&&(window.showdown.extensions.table=a),"undefined"!=typeof module&&(module.exports=a)}(); 4 | //# sourceMappingURL=showdown-table.min.js.map -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.candao.gray 8 | DubboGray 9 | 0.0.1 10 | 11 | 12 | dubbo-gray-order 13 | dubbo-gray-order 14 | http://maven.apache.org 15 | 16 | 17 | UTF-8 18 | 19 | 20 | 21 | com.candao.gray 22 | dubbo-gray-order-api 23 | 0.0.1 24 | 25 | 26 | 27 | com.candao.gray 28 | dubbo-gray-user-api 29 | 0.0.1 30 | 31 | 32 | 33 | com.candao.gray 34 | dubbo-gray-core 35 | 0.0.1 36 | 37 | 38 | 39 | 40 | 41 | 42 | org.apache.maven.plugins 43 | maven-surefire-plugin 44 | 2.6 45 | 46 | true 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/htmlembedded/htmlembedded.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), 7 | require("../../addon/mode/multiplex")); 8 | else if (typeof define == "function" && define.amd) // AMD 9 | define(["../../lib/codemirror", "../htmlmixed/htmlmixed", 10 | "../../addon/mode/multiplex"], mod); 11 | else // Plain browser env 12 | mod(CodeMirror); 13 | })(function(CodeMirror) { 14 | "use strict"; 15 | 16 | CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { 17 | return CodeMirror.multiplexingMode(CodeMirror.getMode(config, "htmlmixed"), { 18 | open: parserConfig.open || parserConfig.scriptStartRegex || "<%", 19 | close: parserConfig.close || parserConfig.scriptEndRegex || "%>", 20 | mode: CodeMirror.getMode(config, parserConfig.scriptingModeSpec) 21 | }); 22 | }, "htmlmixed"); 23 | 24 | CodeMirror.defineMIME("application/x-ejs", {name: "htmlembedded", scriptingModeSpec:"javascript"}); 25 | CodeMirror.defineMIME("application/x-aspx", {name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); 26 | CodeMirror.defineMIME("application/x-jsp", {name: "htmlembedded", scriptingModeSpec:"text/x-java"}); 27 | CodeMirror.defineMIME("application/x-erb", {name: "htmlembedded", scriptingModeSpec:"ruby"}); 28 | }); 29 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/ntriples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: NTriples mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 28 | 29 |
30 |

NTriples mode

31 |
32 | 39 |
40 | 41 | 44 |

MIME types defined: text/n-triples.

45 |
46 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/twig/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Twig mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Twig mode

27 |
40 | 45 |
46 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/animation.css: -------------------------------------------------------------------------------- 1 | /* 2 | We're using CSS transitions for when 3 | the enter and move events are triggered 4 | for the element that has the .ng-animation 5 | class 6 | */ 7 | .ng-animation.ng-enter, .ng-animation.ng-move { 8 | -webkit-transition:0.5s linear all; 9 | -moz-transition:0.5s linear all; 10 | -o-transition:0.5s linear all; 11 | transition:0.5s linear all; 12 | opacity:0; 13 | } 14 | 15 | /* 16 | The ng-enter-active and ng-move-active 17 | are where the transition destination properties 18 | are set so that the animation knows what to 19 | animate. 20 | */ 21 | .ng-animation.ng-enter.ng-enter-active, 22 | .ng-animation.ng-move.ng-move-active { 23 | opacity:1; 24 | } 25 | 26 | /* 27 | We're using CSS keyframe animations for when 28 | the leave event is triggered for the element 29 | that has the .ng-animation class 30 | */ 31 | .ng-animation.ng-leave { 32 | -webkit-animation:0.5s my_animation; 33 | -moz-animation:0.5s my_animation; 34 | -o-animation:0.5s my_animation; 35 | animation:0.5s my_animation; 36 | } 37 | 38 | @keyframes my_animation { 39 | from { opacity:1; } 40 | to { opacity:0; } 41 | } 42 | 43 | /* 44 | Unfortunately each browser vendor requires 45 | its own definition of keyframe animation code... 46 | */ 47 | @-webkit-keyframes my_animation { 48 | from { opacity:1; } 49 | to { opacity:0; } 50 | } 51 | 52 | @-moz-keyframes my_animation { 53 | from { opacity:1; } 54 | to { opacity:0; } 55 | } 56 | 57 | @-o-keyframes my_animation { 58 | from { opacity:1; } 59 | to { opacity:0; } 60 | } -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-entry/src/main/java/com/candao/dubbo/gray/entry/gray/GrayStrategyService.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.entry.gray; 2 | 3 | import com.alibaba.dubbo.common.utils.StringUtils; 4 | import com.alibaba.fastjson.JSONObject; 5 | import com.candao.dubbo.gray.common.bean.DistributedContext.GrayBean; 6 | import com.candao.dubbo.gray.entry.net.HttpClient; 7 | import com.candao.dubbo.gray.entry.net.HttpResult; 8 | import com.candao.dubbo.gray.user.api.bean.GrayUser; 9 | 10 | public class GrayStrategyService { 11 | 12 | // 检测灰度开关是否启动 13 | public static HttpResult checkGraySwitch() { 14 | String url = "http://localhost:8080/eureka/apps/switch"; 15 | HttpResult result = new HttpResult(); 16 | result.statusCode = 500; 17 | try { 18 | result = HttpClient.get(url, null); 19 | } catch (Exception e1) { 20 | e1.printStackTrace(); 21 | } 22 | return result; 23 | } 24 | 25 | public static GrayBean getUser(String userName) { 26 | String url = "http://localhost:8080/user/" + userName + "/getUser"; 27 | try { 28 | HttpResult result = HttpClient.get(url, null); 29 | if (!StringUtils.isEmpty(result.content)) { 30 | GrayUser grayUser = JSONObject.parseObject(result.content, GrayUser.class); 31 | GrayBean grayBean = new GrayBean(); 32 | grayBean.setGrayKey(grayUser.getServiceTag()); 33 | //grayBean.setGrayStrategy(grayUser.getStrategy()); 34 | grayBean.setGrayValue(grayUser.getServiceValue()); 35 | grayBean.setUserName(grayUser.getUserName()); 36 | return grayBean; 37 | } 38 | } catch (Exception e) { 39 | e.printStackTrace(); 40 | } 41 | 42 | return null; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/spreadsheet/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Spreadsheet mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Spreadsheet mode

28 |
29 | 30 | 37 | 38 |

MIME types defined: text/x-spreadsheet.

39 | 40 |

The Spreadsheet Mode

41 |

Created by Robert Plummer

42 |
43 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/templates/dialog/dialog.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/http/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: HTTP mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

HTTP mode

27 | 28 | 29 |
39 | 40 | 43 | 44 |

MIME types defined: message/http.

45 |
46 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/libs/themes/assets/js/bootswatch.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | $(window).scroll(function () { 3 | var top = $(document).scrollTop(); 4 | $('.splash').css({ 5 | 'background-position': '0px -'+(top/3).toFixed(2)+'px' 6 | }); 7 | if(top > 50) 8 | $('#home > .navbar').removeClass('navbar-transparent'); 9 | else 10 | $('#home > .navbar').addClass('navbar-transparent'); 11 | }); 12 | 13 | $("a[href='#']").click(function(e) { 14 | e.preventDefault(); 15 | }); 16 | 17 | var $button = $("
< >
").click(function(){ 18 | var html = $(this).parent().html(); 19 | html = cleanSource(html); 20 | $("#source-modal pre").text(html); 21 | $("#source-modal").modal(); 22 | }); 23 | 24 | $('.bs-component [data-toggle="popover"]').popover(); 25 | $('.bs-component [data-toggle="tooltip"]').tooltip(); 26 | 27 | $(".bs-component").hover(function(){ 28 | $(this).append($button); 29 | $button.show(); 30 | }, function(){ 31 | $button.hide(); 32 | }); 33 | 34 | function cleanSource(html) { 35 | var lines = html.split(/\n/); 36 | 37 | lines.shift(); 38 | lines.splice(-1, 1); 39 | 40 | var indentSize = lines[0].length - lines[0].trim().length, 41 | re = new RegExp(" {" + indentSize + "}"); 42 | 43 | lines = lines.map(function(line){ 44 | if (line.match(re)) { 45 | line = line.substring(indentSize); 46 | } 47 | 48 | return line; 49 | }); 50 | 51 | lines = lines.join("\n"); 52 | 53 | return lines; 54 | } 55 | 56 | })(); 57 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/templates/apps/node-details.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{application | uppercase}}应用节点列表 4 |
5 |
6 |
7 |
8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
#节点地址信息 13 | 14 |
{{(isEmpty||!details||details.length<=0)?"未发现任何数据...":"努力加载中...."}}
{{$index+1}}{{detail.nodeAddress}}
27 |
28 |
29 |
-------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/templates/statistics/statistics.html: -------------------------------------------------------------------------------- 1 |
2 | 10 |
11 |
12 |
13 | 14 |
15 |
16 | 17 |
18 |
19 |
20 |
21 | 22 |
23 |
24 |
25 | 26 | 27 |
28 |
29 |
30 | 31 |
32 |
-------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/solr/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Solr mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 20 | 33 | 34 |
35 |

Solr mode

36 | 37 |
38 | 47 |
48 | 49 | 55 | 56 |

MIME types defined: text/x-solr.

57 |
58 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/ecl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: ECL mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

ECL mode

27 |
45 | 48 | 49 |

Based on CodeMirror's clike mode. For more information see HPCC Systems web site.

50 |

MIME types defined: text/x-ecl.

51 | 52 |
53 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/z80/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Z80 assembly mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Z80 assembly mode

27 | 28 | 29 |
45 | 46 | 51 | 52 |

MIME types defined: text/x-z80, text/x-ez80.

53 |
54 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/rust/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Rust mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Rust mode

27 | 28 | 29 |
52 | 53 | 58 | 59 |

MIME types defined: text/x-rustsrc.

60 |
61 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/scroll/simplescrollbars.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div { 2 | position: absolute; 3 | background: #ccc; 4 | -moz-box-sizing: border-box; 5 | box-sizing: border-box; 6 | border: 1px solid #bbb; 7 | border-radius: 2px; 8 | } 9 | 10 | .CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical { 11 | position: absolute; 12 | z-index: 6; 13 | background: #eee; 14 | } 15 | 16 | .CodeMirror-simplescroll-horizontal { 17 | bottom: 0; left: 0; 18 | height: 8px; 19 | } 20 | .CodeMirror-simplescroll-horizontal div { 21 | bottom: 0; 22 | height: 100%; 23 | } 24 | 25 | .CodeMirror-simplescroll-vertical { 26 | right: 0; top: 0; 27 | width: 8px; 28 | } 29 | .CodeMirror-simplescroll-vertical div { 30 | right: 0; 31 | width: 100%; 32 | } 33 | 34 | 35 | .CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler { 36 | display: none; 37 | } 38 | 39 | .CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { 40 | position: absolute; 41 | background: #bcd; 42 | border-radius: 3px; 43 | } 44 | 45 | .CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical { 46 | position: absolute; 47 | z-index: 6; 48 | } 49 | 50 | .CodeMirror-overlayscroll-horizontal { 51 | bottom: 0; left: 0; 52 | height: 6px; 53 | } 54 | .CodeMirror-overlayscroll-horizontal div { 55 | bottom: 0; 56 | height: 100%; 57 | } 58 | 59 | .CodeMirror-overlayscroll-vertical { 60 | right: 0; top: 0; 61 | width: 6px; 62 | } 63 | .CodeMirror-overlayscroll-vertical div { 64 | right: 0; 65 | width: 100%; 66 | } 67 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/service/GrayUserService.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.data.domain.Example; 7 | import org.springframework.data.domain.Sort; 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.alibaba.fastjson.JSONObject; 11 | import com.dubboclub.dk.web.bean.User; 12 | import com.dubboclub.dk.web.dao.GrayUserRepository; 13 | 14 | 15 | @Service 16 | public class GrayUserService { 17 | 18 | @Autowired 19 | private GrayUserRepository grayUserRepository; 20 | 21 | public List getAllUser(){ 22 | return grayUserRepository.findAll(); 23 | } 24 | 25 | public User getUserByUseName(String userName){ 26 | User grayUser = new User(); 27 | grayUser.setStatus(1); 28 | grayUser.setUserName(userName); 29 | Example example = Example.of(grayUser); 30 | 31 | Sort sort = new Sort(Sort.Direction.DESC, "weight"); 32 | List grayUsers = grayUserRepository.findAll(example,sort); 33 | 34 | System.out.println(JSONObject.toJSONString(grayUsers)); 35 | if (grayUsers != null && grayUsers.size() > 0) { 36 | return grayUsers.get(0); 37 | } 38 | return null; 39 | } 40 | 41 | public User getUserById(Integer id){ 42 | return grayUserRepository.getOne(id); 43 | } 44 | 45 | public void deleteUserById(Integer id){ 46 | grayUserRepository.delete(id); 47 | } 48 | 49 | public User updateUser(User grayUser){ 50 | return grayUserRepository.saveAndFlush(grayUser); 51 | } 52 | 53 | public User addUser(User grayUser){ 54 | return grayUserRepository.save(grayUser); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/display/fullscreen.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineOption("fullScreen", false, function(cm, val, old) { 15 | if (old == CodeMirror.Init) old = false; 16 | if (!old == !val) return; 17 | if (val) setFullscreen(cm); 18 | else setNormal(cm); 19 | }); 20 | 21 | function setFullscreen(cm) { 22 | var wrap = cm.getWrapperElement(); 23 | cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, 24 | width: wrap.style.width, height: wrap.style.height}; 25 | wrap.style.width = ""; 26 | wrap.style.height = "auto"; 27 | wrap.className += " CodeMirror-fullscreen"; 28 | document.documentElement.style.overflow = "hidden"; 29 | cm.refresh(); 30 | } 31 | 32 | function setNormal(cm) { 33 | var wrap = cm.getWrapperElement(); 34 | wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, ""); 35 | document.documentElement.style.overflow = ""; 36 | var info = cm.state.fullScreenRestore; 37 | wrap.style.width = info.width; wrap.style.height = info.height; 38 | window.scrollTo(info.scrollLeft, info.scrollTop); 39 | cm.refresh(); 40 | } 41 | }); 42 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/model/WeightOverrideInfo.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.model; 2 | 3 | import com.alibaba.dubbo.common.Constants; 4 | import com.alibaba.dubbo.common.utils.StringUtils; 5 | 6 | import java.util.Map; 7 | 8 | /** 9 | * Created by bieber on 2015/6/21. 10 | */ 11 | public class WeightOverrideInfo extends OverrideInfo{ 12 | 13 | private int weight; 14 | 15 | public int getWeight() { 16 | return weight; 17 | } 18 | 19 | public void setWeight(int weight) { 20 | this.weight = weight; 21 | } 22 | public static WeightOverrideInfo valueOf(com.dubboclub.dk.admin.model.Override override){ 23 | String weight = null; 24 | if(!org.apache.commons.lang.StringUtils.isEmpty(override.getParams())){ 25 | Map parameters = StringUtils.parseQueryString(override.getParams()); 26 | weight=parameters.get(Constants.WEIGHT_KEY); 27 | if(org.apache.commons.lang.StringUtils.isEmpty(weight)||"null".equals(weight)){ 28 | return null; 29 | } 30 | } 31 | WeightOverrideInfo overrideInfo = new WeightOverrideInfo(); 32 | overrideInfo.setAddress(override.getAddress()); 33 | overrideInfo.setApplication(override.getApplication()==null?Constants.ANY_VALUE:override.getApplication()); 34 | overrideInfo.setEnable(override.isEnabled()); 35 | overrideInfo.setId(override.getId()); 36 | overrideInfo.setParameters(override.getParams()); 37 | if(!org.apache.commons.lang.StringUtils.isEmpty(weight)){ 38 | overrideInfo.setWeight(Integer.parseInt(weight)); 39 | } 40 | return overrideInfo; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | com.dubboclub.dk.web.utils.ContextLoaderListenerWrapper 7 | 8 | 9 | contextConfigLocation 10 | classpath*:/META-INF/spring/*.xml 11 | 12 | 13 | 14 | springMVC 15 | org.springframework.web.servlet.DispatcherServlet 16 | 17 | contextConfigLocation 18 | classpath:webApplication-jpa.xml 19 | 20 | 0 21 | 22 | 23 | springMVC 24 | / 25 | 26 | 27 | 40 | 41 | index.jsp 42 | 43 | 44 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/turtle/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Turtle mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Turtle mode

27 |
41 | 47 | 48 |

MIME types defined: text/turtle.

49 | 50 |
51 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/scroll/scrollpastend.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineOption("scrollPastEnd", false, function(cm, val, old) { 15 | if (old && old != CodeMirror.Init) { 16 | cm.off("change", onChange); 17 | cm.off("refresh", updateBottomMargin); 18 | cm.display.lineSpace.parentNode.style.paddingBottom = ""; 19 | cm.state.scrollPastEndPadding = null; 20 | } 21 | if (val) { 22 | cm.on("change", onChange); 23 | cm.on("refresh", updateBottomMargin); 24 | updateBottomMargin(cm); 25 | } 26 | }); 27 | 28 | function onChange(cm, change) { 29 | if (CodeMirror.changeEnd(change).line == cm.lastLine()) 30 | updateBottomMargin(cm); 31 | } 32 | 33 | function updateBottomMargin(cm) { 34 | var padding = ""; 35 | if (cm.lineCount() > 1) { 36 | var totalH = cm.display.scroller.clientHeight - 30, 37 | lastLineH = cm.getLineHandle(cm.lastLine()).height; 38 | padding = (totalH - lastLineH) + "px"; 39 | } 40 | if (cm.state.scrollPastEndPadding != padding) { 41 | cm.state.scrollPastEndPadding = padding; 42 | cm.display.lineSpace.parentNode.style.paddingBottom = padding; 43 | cm.setSize(); 44 | } 45 | } 46 | }); 47 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/pascal/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Pascal mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Pascal mode

27 | 28 | 29 |
52 | 53 | 59 | 60 |

MIME types defined: text/x-pascal.

61 |
62 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/pig/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Pig Latin mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Pig Latin mode

27 |
39 | 40 | 47 | 48 |

49 | Simple mode that handles Pig Latin language. 50 |

51 | 52 |

MIME type defined: text/x-pig 53 | (PIG code) 54 | 55 |

56 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/vbscript/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: VBScript mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

VBScript mode

27 | 28 | 29 |
46 | 47 | 53 | 54 |

MIME types defined: text/vbscript.

55 |
56 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/gherkin/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Gherkin mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Gherkin mode

27 |
42 | 45 | 46 |

MIME types defined: text/x-feature.

47 | 48 |
49 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/modules/common/http.js: -------------------------------------------------------------------------------- 1 | var httpWrapper=angular.module("httpWrapper",[]); 2 | httpWrapper.$httpWrapper=function(){ 3 | var http=function($http,$dialog){ 4 | this.$http=$http; 5 | this.$dialog=$dialog; 6 | }; 7 | http.prototype.get=function(options){ 8 | var me=this; 9 | me.$http.get(options.url,options.data,options.config).success(function(data){ 10 | if(!data.result||data.result==ajaxResultStatu.SUCCESS){ 11 | if(options.success){ 12 | options.success(data); 13 | } 14 | }else{ 15 | me.$dialog.info({content:data.memo}); 16 | } 17 | }).error(function(e){ 18 | if(options.error){ 19 | options.error(e); 20 | } 21 | console.log(e); 22 | me.$dialog.info({content:"后端系统出现异常,请稍后再试!"}); 23 | }); 24 | }; 25 | http.prototype.post=function(options){ 26 | var me=this; 27 | me.$http.post(options.url,options.data,options.config).success(function(data){ 28 | if(!data.result||data.result==ajaxResultStatu.SUCCESS){ 29 | if(options.success){ 30 | options.success(data); 31 | } 32 | }else{ 33 | me.$dialog.info({content:data.memo}); 34 | } 35 | }).error(function(e){ 36 | if(options.error){ 37 | options.error(e); 38 | } 39 | console.log(e); 40 | me.$dialog.info({content:"后端系统出现异常,请稍后再试!"}); 41 | }); 42 | }; 43 | this.$get =['$http','$dialog',function($http,$dialog){ 44 | return new http($http,$dialog); 45 | }]; 46 | } 47 | 48 | httpWrapper.provider("$httpWrapper",httpWrapper.$httpWrapper); -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-entry/src/main/java/com/candao/dubbo/gray/entry/controller/ExternalController.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.entry.controller; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import com.candao.dubbo.gray.entry.service.ExternalService; 11 | import com.candao.dubbo.gray.order.api.bean.Order; 12 | import com.candao.dubbo.gray.user.api.bean.User; 13 | 14 | @RestController 15 | @RequestMapping("/external") 16 | public class ExternalController { 17 | 18 | 19 | @Autowired 20 | private ExternalService externalService; 21 | 22 | @RequestMapping("/user/{name}") 23 | public List getUser(@PathVariable("name")String name){ 24 | return externalService.getUserByName(name); 25 | } 26 | 27 | @RequestMapping("/user2/{name}") 28 | public List getUser2(@PathVariable("name")String name){ 29 | return externalService.getUserByName2(name); 30 | } 31 | 32 | 33 | @RequestMapping("/user3/{name}") 34 | public List getUser3(@PathVariable("name")String name){ 35 | return externalService.getUserByName3(name); 36 | } 37 | 38 | 39 | @RequestMapping("/order/{name}") 40 | public List getOrder(@PathVariable("name")String name){ 41 | return externalService.getOrderByName(name); 42 | } 43 | 44 | @RequestMapping("/order2/{name}") 45 | public List geOrder2(@PathVariable("name")String name){ 46 | return externalService.getOrderByName2(name); 47 | } 48 | 49 | 50 | @RequestMapping("/order3/{name}") 51 | public List getOrder3(@PathVariable("name")String name){ 52 | return externalService.getOrderByName3(name); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/properties/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Properties files mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Properties files mode

27 |
46 | 49 | 50 |

MIME types defined: text/x-properties, 51 | text/x-ini.

52 | 53 |
54 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/theme/colorforth.css: -------------------------------------------------------------------------------- 1 | .cm-s-colorforth.CodeMirror { background: #000000; color: #f8f8f8; } 2 | .cm-s-colorforth .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } 3 | .cm-s-colorforth .CodeMirror-guttermarker { color: #FFBD40; } 4 | .cm-s-colorforth .CodeMirror-guttermarker-subtle { color: #78846f; } 5 | .cm-s-colorforth .CodeMirror-linenumber { color: #bababa; } 6 | .cm-s-colorforth .CodeMirror-cursor { border-left: 1px solid white !important; } 7 | 8 | .cm-s-colorforth span.cm-comment { color: #ededed; } 9 | .cm-s-colorforth span.cm-def { color: #ff1c1c; font-weight:bold; } 10 | .cm-s-colorforth span.cm-keyword { color: #ffd900; } 11 | .cm-s-colorforth span.cm-builtin { color: #00d95a; } 12 | .cm-s-colorforth span.cm-variable { color: #73ff00; } 13 | .cm-s-colorforth span.cm-string { color: #007bff; } 14 | .cm-s-colorforth span.cm-number { color: #00c4ff; } 15 | .cm-s-colorforth span.cm-atom { color: #606060; } 16 | 17 | .cm-s-colorforth span.cm-variable-2 { color: #EEE; } 18 | .cm-s-colorforth span.cm-variable-3 { color: #DDD; } 19 | .cm-s-colorforth span.cm-property {} 20 | .cm-s-colorforth span.cm-operator {} 21 | 22 | .cm-s-colorforth span.cm-meta { color: yellow; } 23 | .cm-s-colorforth span.cm-qualifier { color: #FFF700; } 24 | .cm-s-colorforth span.cm-bracket { color: #cc7; } 25 | .cm-s-colorforth span.cm-tag { color: #FFBD40; } 26 | .cm-s-colorforth span.cm-attribute { color: #FFF700; } 27 | .cm-s-colorforth span.cm-error { color: #f00; } 28 | 29 | .cm-s-colorforth .CodeMirror-selected { background: #333d53 !important; } 30 | 31 | .cm-s-colorforth span.cm-compilation { background: rgba(255, 255, 255, 0.12); } 32 | 33 | .cm-s-colorforth .CodeMirror-activeline-background {background: #253540 !important;} 34 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/fold/indent-fold.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.registerHelper("fold", "indent", function(cm, start) { 15 | var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line); 16 | if (!/\S/.test(firstLine)) return; 17 | var getIndent = function(line) { 18 | return CodeMirror.countColumn(line, null, tabSize); 19 | }; 20 | var myIndent = getIndent(firstLine); 21 | var lastLineInFold = null; 22 | // Go through lines until we find a line that definitely doesn't belong in 23 | // the block we're folding, or to the end. 24 | for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) { 25 | var curLine = cm.getLine(i); 26 | var curIndent = getIndent(curLine); 27 | if (curIndent > myIndent) { 28 | // Lines with a greater indent are considered part of the block. 29 | lastLineInFold = i; 30 | } else if (!/\S/.test(curLine)) { 31 | // Empty lines might be breaks within the block we're trying to fold. 32 | } else { 33 | // A non-empty line at an indent equal to or less than ours marks the 34 | // start of another block. 35 | break; 36 | } 37 | } 38 | if (lastLineInFold) return { 39 | from: CodeMirror.Pos(start.line, firstLine.length), 40 | to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length) 41 | }; 42 | }); 43 | 44 | }); 45 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/theme/cobalt.css: -------------------------------------------------------------------------------- 1 | .cm-s-cobalt.CodeMirror { background: #002240; color: white; } 2 | .cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; } 3 | .cm-s-cobalt .CodeMirror-line::selection, .cm-s-cobalt .CodeMirror-line > span::selection, .cm-s-cobalt .CodeMirror-line > span > span::selection { background: rgba(179, 101, 57, .99); } 4 | .cm-s-cobalt .CodeMirror-line::-moz-selection, .cm-s-cobalt .CodeMirror-line > span::-moz-selection, .cm-s-cobalt .CodeMirror-line > span > span::-moz-selection { background: rgba(179, 101, 57, .99); } 5 | .cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } 6 | .cm-s-cobalt .CodeMirror-guttermarker { color: #ffee80; } 7 | .cm-s-cobalt .CodeMirror-guttermarker-subtle { color: #d0d0d0; } 8 | .cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; } 9 | .cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; } 10 | 11 | .cm-s-cobalt span.cm-comment { color: #08f; } 12 | .cm-s-cobalt span.cm-atom { color: #845dc4; } 13 | .cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; } 14 | .cm-s-cobalt span.cm-keyword { color: #ffee80; } 15 | .cm-s-cobalt span.cm-string { color: #3ad900; } 16 | .cm-s-cobalt span.cm-meta { color: #ff9d00; } 17 | .cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; } 18 | .cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; } 19 | .cm-s-cobalt span.cm-bracket { color: #d8d8d8; } 20 | .cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; } 21 | .cm-s-cobalt span.cm-link { color: #845dc4; } 22 | .cm-s-cobalt span.cm-error { color: #9d1e15; } 23 | 24 | .cm-s-cobalt .CodeMirror-activeline-background {background: #002D57 !important;} 25 | .cm-s-cobalt .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important} 26 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/fold/markdown-fold.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.registerHelper("fold", "markdown", function(cm, start) { 15 | var maxDepth = 100; 16 | 17 | function isHeader(lineNo) { 18 | var tokentype = cm.getTokenTypeAt(CodeMirror.Pos(lineNo, 0)); 19 | return tokentype && /\bheader\b/.test(tokentype); 20 | } 21 | 22 | function headerLevel(lineNo, line, nextLine) { 23 | var match = line && line.match(/^#+/); 24 | if (match && isHeader(lineNo)) return match[0].length; 25 | match = nextLine && nextLine.match(/^[=\-]+\s*$/); 26 | if (match && isHeader(lineNo + 1)) return nextLine[0] == "=" ? 1 : 2; 27 | return maxDepth; 28 | } 29 | 30 | var firstLine = cm.getLine(start.line), nextLine = cm.getLine(start.line + 1); 31 | var level = headerLevel(start.line, firstLine, nextLine); 32 | if (level === maxDepth) return undefined; 33 | 34 | var lastLineNo = cm.lastLine(); 35 | var end = start.line, nextNextLine = cm.getLine(end + 2); 36 | while (end < lastLineNo) { 37 | if (headerLevel(end + 1, nextLine, nextNextLine) <= level) break; 38 | ++end; 39 | nextLine = nextNextLine; 40 | nextNextLine = cm.getLine(end + 2); 41 | } 42 | 43 | return { 44 | from: CodeMirror.Pos(start.line, firstLine.length), 45 | to: CodeMirror.Pos(end, cm.getLine(end).length) 46 | }; 47 | }); 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/javascript/typescript.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: TypeScript mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

TypeScript mode

27 | 28 | 29 |
51 | 52 | 59 | 60 |

This is a specialization of the JavaScript mode.

61 |
62 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/hint/anyword-hint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var WORD = /[\w$]+/, RANGE = 500; 15 | 16 | CodeMirror.registerHelper("hint", "anyword", function(editor, options) { 17 | var word = options && options.word || WORD; 18 | var range = options && options.range || RANGE; 19 | var cur = editor.getCursor(), curLine = editor.getLine(cur.line); 20 | var end = cur.ch, start = end; 21 | while (start && word.test(curLine.charAt(start - 1))) --start; 22 | var curWord = start != end && curLine.slice(start, end); 23 | 24 | var list = [], seen = {}; 25 | var re = new RegExp(word.source, "g"); 26 | for (var dir = -1; dir <= 1; dir += 2) { 27 | var line = cur.line, endLine = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir; 28 | for (; line != endLine; line += dir) { 29 | var text = editor.getLine(line), m; 30 | while (m = re.exec(text)) { 31 | if (line == cur.line && m[0] === curWord) continue; 32 | if ((!curWord || m[0].lastIndexOf(curWord, 0) == 0) && !Object.prototype.hasOwnProperty.call(seen, m[0])) { 33 | seen[m[0]] = true; 34 | list.push(m[0]); 35 | } 36 | } 37 | } 38 | } 39 | return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)}; 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order/src/main/java/com/candao/dubbo/gray/order/service/OrderService.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.order.service; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.UUID; 6 | 7 | import javax.annotation.Resource; 8 | 9 | import org.springframework.stereotype.Service; 10 | 11 | import com.alibaba.dubbo.common.utils.StringUtils; 12 | import com.alibaba.dubbo.rpc.RpcContext; 13 | import com.candao.dubbo.gray.common.bean.DistributedContext; 14 | import com.candao.dubbo.gray.order.api.IOrderService; 15 | import com.candao.dubbo.gray.order.api.bean.Order; 16 | import com.candao.dubbo.gray.order.service.datahandler.OrderHandler; 17 | import com.candao.dubbo.gray.user.api.bean.User; 18 | 19 | @Service 20 | public class OrderService implements IOrderService { 21 | 22 | @Resource 23 | public OrderHandler orderHandler; 24 | 25 | @Override 26 | public List getOrders(DistributedContext context) { 27 | Order order = new Order(); 28 | order.setOrderId(UUID.randomUUID().toString()); 29 | 30 | if (context.getGrayBean() != null) { 31 | String value = RpcContext.getContext().getUrl().getParameter(context.getGrayBean().getGrayKey()); 32 | if (StringUtils.isEmpty(value)) { 33 | order.setOrderName("我是order-service1,灰度服务寻找不到,进入正常服务,host:" +RpcContext.getContext().getLocalHost()+":"+RpcContext.getContext().getLocalPort()); 34 | }else{ 35 | order.setOrderName("我是order-service1,灰度策略:" +context.getGrayBean().getGrayKey() + " " + value); 36 | } 37 | }else{ 38 | order.setOrderName("我是order-service1,是正常服务,host:" + RpcContext.getContext().getLocalHost()+":"+RpcContext.getContext().getLocalPort()); 39 | } 40 | 41 | List userList = orderHandler.getUser(context); 42 | order.setUser(userList.get(0)); 43 | 44 | List list= new ArrayList(); 45 | list.add(order); 46 | 47 | return list; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-order2/src/main/java/com/candao/dubbo/gray/order/service/OrderService.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.order.service; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.UUID; 6 | 7 | import javax.annotation.Resource; 8 | 9 | import org.springframework.stereotype.Service; 10 | 11 | import com.alibaba.dubbo.common.utils.StringUtils; 12 | import com.alibaba.dubbo.rpc.RpcContext; 13 | import com.candao.dubbo.gray.common.bean.DistributedContext; 14 | import com.candao.dubbo.gray.order.api.IOrderService; 15 | import com.candao.dubbo.gray.order.api.bean.Order; 16 | import com.candao.dubbo.gray.order.service.datahandler.OrderHandler; 17 | import com.candao.dubbo.gray.user.api.bean.User; 18 | 19 | @Service 20 | public class OrderService implements IOrderService { 21 | 22 | @Resource 23 | public OrderHandler orderHandler; 24 | 25 | @Override 26 | public List getOrders(DistributedContext context) { 27 | Order order = new Order(); 28 | order.setOrderId(UUID.randomUUID().toString()); 29 | 30 | if (context.getGrayBean() != null) { 31 | String value = RpcContext.getContext().getUrl().getParameter(context.getGrayBean().getGrayKey()); 32 | if (StringUtils.isEmpty(value)) { 33 | order.setOrderName("我是order-service2,灰度服务寻找不到,进入正常服务,host:" +RpcContext.getContext().getLocalHost()+":"+RpcContext.getContext().getLocalPort()); 34 | }else{ 35 | order.setOrderName("我是order-service2,灰度策略:" +context.getGrayBean().getGrayKey() + " " + value); 36 | } 37 | }else{ 38 | order.setOrderName("我是order-service2,是正常服务,host:" + RpcContext.getContext().getLocalHost()+":"+RpcContext.getContext().getLocalPort()); 39 | } 40 | 41 | List userList = orderHandler.getUser(context); 42 | order.setUser(userList.get(0)); 43 | 44 | List list= new ArrayList(); 45 | list.add(order); 46 | 47 | return list; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/model/ConsumerInfo.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.model; 2 | 3 | /** 4 | * Created by bieber on 2015/6/6. 5 | * 消费者信息 6 | */ 7 | public class ConsumerInfo extends BasicResponse{ 8 | 9 | private String application; 10 | 11 | private String username; 12 | 13 | private String parameters; 14 | 15 | public String getParameters() { 16 | return parameters; 17 | } 18 | 19 | public void setParameters(String parameters) { 20 | this.parameters = parameters; 21 | } 22 | 23 | public String getApplication() { 24 | return application; 25 | } 26 | 27 | public void setApplication(String application) { 28 | this.application = application; 29 | } 30 | 31 | public String getUsername() { 32 | return username; 33 | } 34 | 35 | public void setUsername(String username) { 36 | this.username = username; 37 | } 38 | 39 | @Override 40 | public boolean equals(Object o) { 41 | if (this == o) return true; 42 | if (o == null || getClass() != o.getClass()) return false; 43 | 44 | ConsumerInfo that = (ConsumerInfo) o; 45 | 46 | if (application != null ? !application.equals(that.application) : that.application != null) return false; 47 | if (parameters != null ? !parameters.equals(that.parameters) : that.parameters != null) return false; 48 | if (username != null ? !username.equals(that.username) : that.username != null) return false; 49 | 50 | return true; 51 | } 52 | 53 | @Override 54 | public int hashCode() { 55 | int result = application != null ? application.hashCode() : 0; 56 | result = 31 * result + (username != null ? username.hashCode() : 0); 57 | result = 31 * result + (parameters != null ? parameters.hashCode() : 0); 58 | return result; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/sass/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Sass mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Sass mode

28 |
58 | 64 | 65 |

MIME types defined: text/x-sass.

66 |
67 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/java/com/dubboclub/dk/web/model/OverrideAbstractInfo.java: -------------------------------------------------------------------------------- 1 | package com.dubboclub.dk.web.model; 2 | 3 | /** 4 | * Created by bieber on 2015/6/27. 5 | */ 6 | public class OverrideAbstractInfo { 7 | 8 | private String applicationName; 9 | 10 | private String serviceKey; 11 | 12 | private int overrideCount; 13 | 14 | public String getApplicationName() { 15 | return applicationName; 16 | } 17 | 18 | public void setApplicationName(String applicationName) { 19 | this.applicationName = applicationName; 20 | } 21 | 22 | public String getServiceKey() { 23 | return serviceKey; 24 | } 25 | 26 | public void setServiceKey(String serviceKey) { 27 | this.serviceKey = serviceKey; 28 | } 29 | 30 | public int getOverrideCount() { 31 | return overrideCount; 32 | } 33 | 34 | public void setOverrideCount(int overrideCount) { 35 | this.overrideCount = overrideCount; 36 | } 37 | 38 | @Override 39 | public boolean equals(Object o) { 40 | if (this == o) return true; 41 | if (o == null || getClass() != o.getClass()) return false; 42 | 43 | OverrideAbstractInfo that = (OverrideAbstractInfo) o; 44 | 45 | if (overrideCount != that.overrideCount) return false; 46 | if (applicationName != null ? !applicationName.equals(that.applicationName) : that.applicationName != null) 47 | return false; 48 | if (serviceKey != null ? !serviceKey.equals(that.serviceKey) : that.serviceKey != null) return false; 49 | 50 | return true; 51 | } 52 | 53 | @Override 54 | public int hashCode() { 55 | int result = applicationName != null ? applicationName.hashCode() : 0; 56 | result = 31 * result + (serviceKey != null ? serviceKey.hashCode() : 0); 57 | result = 31 * result + overrideCount; 58 | return result; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/perl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Perl mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Perl mode

27 | 28 | 29 |
67 | 68 | 73 | 74 |

MIME types defined: text/x-perl.

75 |
76 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/theme/rubyblue.css: -------------------------------------------------------------------------------- 1 | .cm-s-rubyblue.CodeMirror { background: #112435; color: white; } 2 | .cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; } 3 | .cm-s-rubyblue .CodeMirror-line::selection, .cm-s-rubyblue .CodeMirror-line > span::selection, .cm-s-rubyblue .CodeMirror-line > span > span::selection { background: rgba(56, 86, 111, 0.99); } 4 | .cm-s-rubyblue .CodeMirror-line::-moz-selection, .cm-s-rubyblue .CodeMirror-line > span::-moz-selection, .cm-s-rubyblue .CodeMirror-line > span > span::-moz-selection { background: rgba(56, 86, 111, 0.99); } 5 | .cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; } 6 | .cm-s-rubyblue .CodeMirror-guttermarker { color: white; } 7 | .cm-s-rubyblue .CodeMirror-guttermarker-subtle { color: #3E7087; } 8 | .cm-s-rubyblue .CodeMirror-linenumber { color: white; } 9 | .cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; } 10 | 11 | .cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; } 12 | .cm-s-rubyblue span.cm-atom { color: #F4C20B; } 13 | .cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; } 14 | .cm-s-rubyblue span.cm-keyword { color: #F0F; } 15 | .cm-s-rubyblue span.cm-string { color: #F08047; } 16 | .cm-s-rubyblue span.cm-meta { color: #F0F; } 17 | .cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; } 18 | .cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; } 19 | .cm-s-rubyblue span.cm-bracket { color: #F0F; } 20 | .cm-s-rubyblue span.cm-link { color: #F4C20B; } 21 | .cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; } 22 | .cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; } 23 | .cm-s-rubyblue span.cm-error { color: #AF2018; } 24 | 25 | .cm-s-rubyblue .CodeMirror-activeline-background {background: #173047 !important;} 26 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/css/datepicker.css: -------------------------------------------------------------------------------- 1 | .date-picker-number-spinner{ 2 | background: white; 3 | width: 14px; 4 | height: 14px; 5 | overflow: hidden; 6 | line-height: 16px; 7 | font-size: 12px; 8 | border: 0px; 9 | background-color: transparent; 10 | padding: 0px; 11 | margin: 0px; 12 | display: block; 13 | color: #999; 14 | text-align: center; 15 | outline: 0px; 16 | border-top: 1px solid #E3E3E3; 17 | } 18 | .date-picker-number-spinner-wrapper{ 19 | background: white !important; 20 | padding-left: 0px !important; 21 | padding-right: 0px !important; 22 | padding-bottom: 0px !important; 23 | padding-top: 0px !important; 24 | } 25 | .date-picker-number-spinner-input{ 26 | width: 39px !important; 27 | float: right !important; 28 | 29 | } 30 | .date-time-picker-input{ 31 | margin-top: 6px; 32 | margin-bottom: 3px; 33 | } 34 | .data-picker-td{ 35 | padding-top: 10px; 36 | width: 13px; 37 | } 38 | .data-picker-number-slip{ 39 | vertical-align: middle; 40 | margin-top: 4px; 41 | font-weight: bolder; 42 | font-size: 14px; 43 | padding-left: 9px !important; 44 | padding-right: 0px !important; 45 | } 46 | 47 | .date-picker-range-picker-container{ 48 | border: 1px solid #ccc; 49 | border-radius: 4px; 50 | -webkit-background-clip: padding-box; 51 | -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 10px 0px; 52 | } 53 | .date-time-picker{ 54 | padding-top: 10px; 55 | padding-bottom: 10px; 56 | } 57 | .date-time-range-picker-wrapper{ 58 | padding-left: 15px; padding-right: 15px; 59 | display: block; 60 | z-index: 1000; 61 | 62 | background: white; 63 | } 64 | .date-time-picker-submit{ 65 | margin-right: 3px; 66 | float: right; 67 | } 68 | .date-time-picker-tip{ 69 | padding-top: 2px; 70 | text-align: left; 71 | } 72 | .date-time-picker-bottom{ 73 | padding-bottom: 5px; 74 | } -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/theme/night.css: -------------------------------------------------------------------------------- 1 | /* Loosely based on the Midnight Textmate theme */ 2 | 3 | .cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; } 4 | .cm-s-night div.CodeMirror-selected { background: #447 !important; } 5 | .cm-s-night .CodeMirror-line::selection, .cm-s-night .CodeMirror-line > span::selection, .cm-s-night .CodeMirror-line > span > span::selection { background: rgba(68, 68, 119, .99); } 6 | .cm-s-night .CodeMirror-line::-moz-selection, .cm-s-night .CodeMirror-line > span::-moz-selection, .cm-s-night .CodeMirror-line > span > span::-moz-selection { background: rgba(68, 68, 119, .99); } 7 | .cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } 8 | .cm-s-night .CodeMirror-guttermarker { color: white; } 9 | .cm-s-night .CodeMirror-guttermarker-subtle { color: #bbb; } 10 | .cm-s-night .CodeMirror-linenumber { color: #f8f8f8; } 11 | .cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; } 12 | 13 | .cm-s-night span.cm-comment { color: #6900a1; } 14 | .cm-s-night span.cm-atom { color: #845dc4; } 15 | .cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; } 16 | .cm-s-night span.cm-keyword { color: #599eff; } 17 | .cm-s-night span.cm-string { color: #37f14a; } 18 | .cm-s-night span.cm-meta { color: #7678e2; } 19 | .cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; } 20 | .cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; } 21 | .cm-s-night span.cm-bracket { color: #8da6ce; } 22 | .cm-s-night span.cm-comment { color: #6900a1; } 23 | .cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; } 24 | .cm-s-night span.cm-link { color: #845dc4; } 25 | .cm-s-night span.cm-error { color: #9d1e15; } 26 | 27 | .cm-s-night .CodeMirror-activeline-background {background: #1C005A !important;} 28 | .cm-s-night .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} 29 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-entry/src/main/resources/spring-mvc-context.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | text/plain;charset=UTF-8 31 | text/html;charset=UTF-8 32 | application/json;charset=UTF-8 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/elm/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Elm mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Elm mode

27 | 28 |
52 | 53 | 59 | 60 |

MIME types defined: text/x-elm.

61 |
62 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/idl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: IDL mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

IDL mode

27 | 28 |
52 | 62 | 63 |

MIME types defined: text/x-idl.

64 |
65 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/theme/tomorrow-night-bright.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Tomorrow Night - Bright 4 | Author: Chris Kempson 5 | 6 | Port done by Gerard Braad 7 | 8 | */ 9 | 10 | .cm-s-tomorrow-night-bright.CodeMirror {background: #000000; color: #eaeaea;} 11 | .cm-s-tomorrow-night-bright div.CodeMirror-selected {background: #424242 !important;} 12 | .cm-s-tomorrow-night-bright .CodeMirror-gutters {background: #000000; border-right: 0px;} 13 | .cm-s-tomorrow-night-bright .CodeMirror-guttermarker { color: #e78c45; } 14 | .cm-s-tomorrow-night-bright .CodeMirror-guttermarker-subtle { color: #777; } 15 | .cm-s-tomorrow-night-bright .CodeMirror-linenumber {color: #424242;} 16 | .cm-s-tomorrow-night-bright .CodeMirror-cursor {border-left: 1px solid #6A6A6A !important;} 17 | 18 | .cm-s-tomorrow-night-bright span.cm-comment {color: #d27b53;} 19 | .cm-s-tomorrow-night-bright span.cm-atom {color: #a16a94;} 20 | .cm-s-tomorrow-night-bright span.cm-number {color: #a16a94;} 21 | 22 | .cm-s-tomorrow-night-bright span.cm-property, .cm-s-tomorrow-night-bright span.cm-attribute {color: #99cc99;} 23 | .cm-s-tomorrow-night-bright span.cm-keyword {color: #d54e53;} 24 | .cm-s-tomorrow-night-bright span.cm-string {color: #e7c547;} 25 | 26 | .cm-s-tomorrow-night-bright span.cm-variable {color: #b9ca4a;} 27 | .cm-s-tomorrow-night-bright span.cm-variable-2 {color: #7aa6da;} 28 | .cm-s-tomorrow-night-bright span.cm-def {color: #e78c45;} 29 | .cm-s-tomorrow-night-bright span.cm-bracket {color: #eaeaea;} 30 | .cm-s-tomorrow-night-bright span.cm-tag {color: #d54e53;} 31 | .cm-s-tomorrow-night-bright span.cm-link {color: #a16a94;} 32 | .cm-s-tomorrow-night-bright span.cm-error {background: #d54e53; color: #6A6A6A;} 33 | 34 | .cm-s-tomorrow-night-bright .CodeMirror-activeline-background {background: #2a2a2a !important;} 35 | .cm-s-tomorrow-night-bright .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 36 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/dart/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Dart mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Dart mode

27 |
28 | 62 |
63 | 64 | 70 | 71 |
72 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/handlebars/handlebars.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror", "../../addon/mode/simple"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineSimpleMode("handlebars", { 15 | start: [ 16 | { regex: /\{\{!--/, push: "dash_comment", token: "comment" }, 17 | { regex: /\{\{!/, push: "comment", token: "comment" }, 18 | { regex: /\{\{/, push: "handlebars", token: "tag" } 19 | ], 20 | handlebars: [ 21 | { regex: /\}\}/, pop: true, token: "tag" }, 22 | 23 | // Double and single quotes 24 | { regex: /"(?:[^\\]|\\.)*?"/, token: "string" }, 25 | { regex: /'(?:[^\\]|\\.)*?'/, token: "string" }, 26 | 27 | // Handlebars keywords 28 | { regex: />|[#\/]([A-Za-z_]\w*)/, token: "keyword" }, 29 | { regex: /(?:else|this)\b/, token: "keyword" }, 30 | 31 | // Numeral 32 | { regex: /\d+/i, token: "number" }, 33 | 34 | // Atoms like = and . 35 | { regex: /=|~|@|true|false/, token: "atom" }, 36 | 37 | // Paths 38 | { regex: /(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/, token: "variable-2" } 39 | ], 40 | dash_comment: [ 41 | { regex: /--\}\}/, pop: true, token: "comment" }, 42 | 43 | // Commented code 44 | { regex: /./, token: "comment"} 45 | ], 46 | comment: [ 47 | { regex: /\}\}/, pop: true, token: "comment" }, 48 | { regex: /./, token: "comment" } 49 | ] 50 | }); 51 | 52 | CodeMirror.defineMIME("text/x-handlebars-template", "handlebars"); 53 | }); 54 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user/src/main/java/com/candao/dubbo/gray/user/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.user.service; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import javax.annotation.Resource; 7 | 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.alibaba.dubbo.common.utils.StringUtils; 11 | import com.alibaba.dubbo.rpc.RpcContext; 12 | import com.candao.dubbo.gray.common.bean.DistributedContext; 13 | import com.candao.dubbo.gray.order.api.bean.Order; 14 | import com.candao.dubbo.gray.user.api.IUserService; 15 | import com.candao.dubbo.gray.user.api.bean.User; 16 | import com.candao.dubbo.gray.user.service.datahandler.UserHandler; 17 | 18 | @Service 19 | public class UserService implements IUserService { 20 | 21 | @Resource 22 | public UserHandler userHandler; 23 | 24 | @Override 25 | public List getPermissions(DistributedContext distributedContext) { 26 | List list = new ArrayList(); 27 | User user2 = new User(); 28 | user2.setPhone("13570983345"); 29 | user2.setUserName("刘练源"); 30 | user2.setUid(1140120103); 31 | if (distributedContext.getGrayBean() != null) { 32 | String value = RpcContext.getContext().getUrl().getParameter(distributedContext.getGrayBean().getGrayKey()); 33 | if (StringUtils.isEmpty(value)) { 34 | user2.setNickName("我是user-service1,灰度服务寻找不到,进入正常服务,host:" + RpcContext.getContext().getLocalHost()+":"+RpcContext.getContext().getLocalPort()); 35 | }else{ 36 | user2.setNickName("我是user-service1,灰度策略:" +distributedContext.getGrayBean().getGrayKey() + " " + value); 37 | } 38 | }else{ 39 | user2.setNickName("我是user-service1,我是正常服务,host:" + RpcContext.getContext().getLocalHost()+":"+RpcContext.getContext().getLocalPort()); 40 | } 41 | list.add(user2); 42 | return list; 43 | } 44 | 45 | @Override 46 | public List getPermissionsWithOrder(DistributedContext distributedContext) { 47 | List list = userHandler.getOrder(distributedContext); 48 | return list; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-user2/src/main/java/com/candao/dubbo/gray/user/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.candao.dubbo.gray.user.service; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import javax.annotation.Resource; 7 | 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.alibaba.dubbo.common.utils.StringUtils; 11 | import com.alibaba.dubbo.rpc.RpcContext; 12 | import com.candao.dubbo.gray.common.bean.DistributedContext; 13 | import com.candao.dubbo.gray.order.api.bean.Order; 14 | import com.candao.dubbo.gray.user.api.IUserService; 15 | import com.candao.dubbo.gray.user.api.bean.User; 16 | import com.candao.dubbo.gray.user.service.datahandler.UserHandler; 17 | 18 | @Service 19 | public class UserService implements IUserService { 20 | 21 | @Resource 22 | public UserHandler userHandler; 23 | 24 | @Override 25 | public List getPermissions(DistributedContext distributedContext) { 26 | List list = new ArrayList(); 27 | 28 | User user2 = new User(); 29 | user2.setPhone("135"); 30 | user2.setUserName("刘练源"); 31 | user2.setUid(1140120103); 32 | if (distributedContext.getGrayBean() != null) { 33 | String value = RpcContext.getContext().getUrl().getParameter(distributedContext.getGrayBean().getGrayKey()); 34 | if (StringUtils.isEmpty(value)) { 35 | user2.setNickName("我是user-service2,灰度服务寻找不到,进入正常服务,host:" + RpcContext.getContext().getLocalHost()+":"+RpcContext.getContext().getLocalPort()); 36 | }else{ 37 | user2.setNickName("我是user-service2,灰度策略:" +distributedContext.getGrayBean().getGrayKey() + " " + value); 38 | } 39 | }else{ 40 | user2.setNickName("我是user-service2,我是正常服务,host:" + RpcContext.getContext().getLocalHost()+":"+RpcContext.getContext().getLocalPort()); 41 | } 42 | list.add(user2); 43 | return list; 44 | } 45 | 46 | @Override 47 | public List getPermissionsWithOrder(DistributedContext distributedContext) { 48 | List list = userHandler.getOrder(distributedContext); 49 | return list; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/xml/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml"; 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); } 7 | 8 | MT("matching", 9 | "[tag&bracket <][tag top][tag&bracket >]", 10 | " text", 11 | " [tag&bracket <][tag inner][tag&bracket />]", 12 | "[tag&bracket ]"); 13 | 14 | MT("nonmatching", 15 | "[tag&bracket <][tag top][tag&bracket >]", 16 | " [tag&bracket <][tag inner][tag&bracket />]", 17 | " [tag&bracket ]"); 18 | 19 | MT("doctype", 20 | "[meta ]", 21 | "[tag&bracket <][tag top][tag&bracket />]"); 22 | 23 | MT("cdata", 24 | "[tag&bracket <][tag top][tag&bracket >]", 25 | " [atom ]", 27 | "[tag&bracket ]"); 28 | 29 | // HTML tests 30 | mode = CodeMirror.getMode({indentUnit: 2}, "text/html"); 31 | 32 | MT("selfclose", 33 | "[tag&bracket <][tag html][tag&bracket >]", 34 | " [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string \"/foobar\"][tag&bracket >]", 35 | "[tag&bracket ]"); 36 | 37 | MT("list", 38 | "[tag&bracket <][tag ol][tag&bracket >]", 39 | " [tag&bracket <][tag li][tag&bracket >]one", 40 | " [tag&bracket <][tag li][tag&bracket >]two", 41 | "[tag&bracket ]"); 42 | 43 | MT("valueless", 44 | "[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]"); 45 | 46 | MT("pThenArticle", 47 | "[tag&bracket <][tag p][tag&bracket >]", 48 | " foo", 49 | "[tag&bracket <][tag article][tag&bracket >]bar"); 50 | 51 | })(); 52 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/addon/edit/continuelist.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/, 15 | emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/, 16 | unorderedListRE = /[*+-]\s/; 17 | 18 | CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) { 19 | if (cm.getOption("disableInput")) return CodeMirror.Pass; 20 | var ranges = cm.listSelections(), replacements = []; 21 | for (var i = 0; i < ranges.length; i++) { 22 | var pos = ranges[i].head; 23 | var eolState = cm.getStateAfter(pos.line); 24 | var inList = eolState.list !== false; 25 | var inQuote = eolState.quote !== 0; 26 | 27 | var line = cm.getLine(pos.line), match = listRE.exec(line); 28 | if (!ranges[i].empty() || (!inList && !inQuote) || !match) { 29 | cm.execCommand("newlineAndIndent"); 30 | return; 31 | } 32 | if (emptyListRE.test(line)) { 33 | cm.replaceRange("", { 34 | line: pos.line, ch: 0 35 | }, { 36 | line: pos.line, ch: pos.ch + 1 37 | }); 38 | replacements[i] = "\n"; 39 | } else { 40 | var indent = match[1], after = match[5]; 41 | var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0 42 | ? match[2] 43 | : (parseInt(match[3], 10) + 1) + match[4]; 44 | 45 | replacements[i] = "\n" + indent + bullet + after; 46 | } 47 | } 48 | 49 | cm.replaceSelections(replacements); 50 | }; 51 | }); 52 | -------------------------------------------------------------------------------- /DubboGray/dubbo-gray-manager/src/main/webapp/js/codemirror/mode/jinja2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Jinja2 mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Jinja2 mode

27 |
49 | 54 |
55 | --------------------------------------------------------------------------------