From 8ff2ced3bec6c23482bd01fcec57d32b02b05361 Mon Sep 17 00:00:00 2001 From: LoadChange Date: Fri, 22 Mar 2019 15:01:58 +0800 Subject: [PATCH] fix: delete service add group name --- .../src/pages/ServiceManagement/ServiceList/ServiceList.js | 6 +++--- console/src/main/resources/static/js/main.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/console/src/main/resources/static/console-fe/src/pages/ServiceManagement/ServiceList/ServiceList.js b/console/src/main/resources/static/console-fe/src/pages/ServiceManagement/ServiceList/ServiceList.js index ab7fffe09..59e976e94 100644 --- a/console/src/main/resources/static/console-fe/src/pages/ServiceManagement/ServiceList/ServiceList.js +++ b/console/src/main/resources/static/console-fe/src/pages/ServiceManagement/ServiceList/ServiceList.js @@ -104,7 +104,7 @@ class ServiceList extends React.Component { setTimeout(() => this.queryServiceList()); }; - deleteService(serviceName) { + deleteService(service) { const { locale = {} } = this.props; const { prompt, promptDelete } = locale; Dialog.confirm({ @@ -113,7 +113,7 @@ class ServiceList extends React.Component { onOk: () => { request({ method: 'DELETE', - url: `v1/ns/service?serviceName=${serviceName}`, + url: `v1/ns/service?serviceName=${service.name}&groupName=${service.groupName}`, dataType: 'text', beforeSend: () => this.openLoading(), success: res => { @@ -241,7 +241,7 @@ class ServiceList extends React.Component { diff --git a/console/src/main/resources/static/js/main.js b/console/src/main/resources/static/js/main.js index 6080e7679..463af9599 100644 --- a/console/src/main/resources/static/js/main.js +++ b/console/src/main/resources/static/js/main.js @@ -52,7 +52,7 @@ function(n){var e,p,b,r,o,h,d,m,M,l,u,w,k,i,S,g,s,c,y,T="sizzle"+1*new Date,_=n. object-assign (c) Sindre Sorhus @license MIT -*/var l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(e){a[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},a)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),r=1;re.clientHeight&&0a.length&&a.every(function(e,t){return e===n[t]})},y.prototype.handleOpen=function(t,e,n,a){var o=this,r=void 0,i=this.props,s=i.mode,l=i.openMode,u=this.state.openKeys,c=u.indexOf(t);e&&-1===c?"inline"===s?"single"===l?(r=u.filter(function(e){return!o.isSibling(o.k2n[t].pos,o.k2n[e].pos)})).push(t):r=u.concat(t):(r=u.filter(function(e){return o.isAncestor(o.k2n[t].pos,o.k2n[e].pos)})).push(t):!e&&-1this.popupNode.offsetWidth&&y(this.popupNode,"width",p.offsetWidth+"px")}"outside"!==u||"hoz"===l&&1===n||(y(this.popupNode,"height",f.offsetHeight+"px"),y(this.popupNode,"overflow-y","scroll"));var h=this.popupProps;h.onOpen&&h.onOpen()},D.prototype.handlePopupClose=function(){var e=this.props.root.popupNodes,t=e.indexOf(this.popupNode);-1e.slidesToShow&&(t=e.slideWidth*e.slidesToShow*-1,o=e.slideHeight*e.slidesToShow*-1),e.slideCount%e.slidesToScroll!=0){var r=e.slideIndex+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow;if(e.rtl)r=(e.slideIndex>=e.slideCount?e.slideCount-e.slideIndex:e.slideIndex)+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow;r&&(o=e.slideIndex>e.slideCount?(t=(e.slidesToShow-(e.slideIndex-e.slideCount))*e.slideWidth*-1,(e.slidesToShow-(e.slideIndex-e.slideCount))*e.slideHeight*-1):(t=e.slideCount%e.slidesToScroll*e.slideWidth*-1,e.slideCount%e.slidesToScroll*e.slideHeight*-1))}}else e.slideCount%e.slidesToScroll!=0&&e.slideIndex+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow&&(t=(e.slidesToShow-e.slideCount%e.slidesToScroll)*e.slideWidth);if(e.centerMode&&(e.infinite?t+=e.slideWidth*Math.floor(e.slidesToShow/2):t=e.slideWidth*Math.floor(e.slidesToShow/2)),n=e.vertical?e.slideIndex*e.slideHeight*-1+o:e.slideIndex*e.slideWidth*-1+t,!0===e.variableWidth){var i=void 0;n=(a=e.slideCount<=e.slidesToShow||!1===e.infinite?s.default.findDOMNode(e.trackRef).childNodes[e.slideIndex]:(i=e.slideIndex+e.slidesToShow,s.default.findDOMNode(e.trackRef).childNodes[i]))?-1*a.offsetLeft:0,!0===e.centerMode&&(a=!1===e.infinite?s.default.findDOMNode(e.trackRef).children[e.slideIndex]:s.default.findDOMNode(e.trackRef).children[e.slideIndex+e.slidesToShow+1])&&(n=-1*a.offsetLeft+(e.listWidth-a.offsetWidth)/2)}return n}},function(e,t,n){"use strict";n(592)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.routerMiddleware=t.routerActions=t.goForward=t.goBack=t.go=t.replace=t.push=t.CALL_HISTORY_METHOD=t.routerReducer=t.LOCATION_CHANGE=t.syncHistoryWithStore=void 0;var a=n(293);Object.defineProperty(t,"LOCATION_CHANGE",{enumerable:!0,get:function(){return a.LOCATION_CHANGE}}),Object.defineProperty(t,"routerReducer",{enumerable:!0,get:function(){return a.routerReducer}});var o=n(294);Object.defineProperty(t,"CALL_HISTORY_METHOD",{enumerable:!0,get:function(){return o.CALL_HISTORY_METHOD}}),Object.defineProperty(t,"push",{enumerable:!0,get:function(){return o.push}}),Object.defineProperty(t,"replace",{enumerable:!0,get:function(){return o.replace}}),Object.defineProperty(t,"go",{enumerable:!0,get:function(){return o.go}}),Object.defineProperty(t,"goBack",{enumerable:!0,get:function(){return o.goBack}}),Object.defineProperty(t,"goForward",{enumerable:!0,get:function(){return o.goForward}}),Object.defineProperty(t,"routerActions",{enumerable:!0,get:function(){return o.routerActions}});var r=s(n(424)),i=s(n(425));function s(e){return e&&e.__esModule?e:{default:e}}t.syncHistoryWithStore=r.default,t.routerMiddleware=i.default},function(e,t,n){"use strict";function a(o){return function(e){var n=e.dispatch,a=e.getState;return function(t){return function(e){return"function"==typeof e?e(n,a,o):t(e)}}}}var o=a();o.withExtraArgument=a,t.a=o},function(e,t,n){"use strict";var a=n(140),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},d={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function f(e){return a.isMemo(e)?r:i[e.$$typeof]||o}i[a.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var p=Object.defineProperty,h=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols,g=Object.getOwnPropertyDescriptor,y=Object.getPrototypeOf,_=Object.prototype;e.exports=function e(t,n,a){if("string"==typeof n)return t;if(_){var o=y(n);o&&o!==_&&e(t,o,a)}var r=h(n);m&&(r=r.concat(m(n)));for(var i=f(t),s=f(n),l=0;l\n com.alibaba.nacos\n nacos-client\n ${version}\n \n*/\npackage com.alibaba.nacos.example;\n\nimport java.util.Properties;\nimport java.util.concurrent.Executor;\nimport com.alibaba.nacos.api.NacosFactory;\nimport com.alibaba.nacos.api.config.ConfigService;\nimport com.alibaba.nacos.api.config.listener.Listener;\nimport com.alibaba.nacos.api.exception.NacosException;\n\n/**\n * Config service example\n * \n * @author Nacos\n *\n */\npublic class ConfigExample {\n\n\tpublic static void main(String[] args) throws NacosException, InterruptedException {\n\t\tString serverAddr = "localhost";\n\t\tString dataId = "'.concat(e.dataId,'";\n\t\tString group = "').concat(e.group,'";\n\t\tProperties properties = new Properties();\n\t\tproperties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);\n\t\tConfigService configService = NacosFactory.createConfigService(properties);\n\t\tString content = configService.getConfig(dataId, group, 5000);\n\t\tSystem.out.println(content);\n\t\tconfigService.addListener(dataId, group, new Listener() {\n\t\t\t@Override\n\t\t\tpublic void receiveConfigInfo(String configInfo) {\n\t\t\t\tSystem.out.println("recieve:" + configInfo);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic Executor getExecutor() {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t});\n\t\t\n\t\tboolean isPublishOk = configService.publishConfig(dataId, group, "content");\n\t\tSystem.out.println(isPublishOk);\n\t\t\n\t\tThread.sleep(3000);\n\t\tcontent = configService.getConfig(dataId, group, 5000);\n\t\tSystem.out.println(content);\n\n\t\tboolean isRemoveOk = configService.removeConfig(dataId, group);\n\t\tSystem.out.println(isRemoveOk);\n\t\tThread.sleep(3000);\n\n\t\tcontent = configService.getConfig(dataId, group, 5000);\n\t\tSystem.out.println(content);\n\t\tThread.sleep(300000);\n\n\t}\n}\n')}},{key:"getNodejsCode",value:function(e){return"TODO"}},{key:"getCppCode",value:function(e){return"TODO"}},{key:"getShellCode",value:function(e){return"TODO"}},{key:"getPythonCode",value:function(e){return"TODO"}},{key:"openDialog",value:function(e){var t=this;this.setState({dialogvisible:!0}),this.record=e,setTimeout(function(){t.getData()})}},{key:"closeDialog",value:function(){this.setState({dialogvisible:!1})}},{key:"createCodeMirror",value:function(e,t){var n=this.refs.codepreview;n&&(n.innerHTML="",this.cm=window.CodeMirror(n,{value:t,mode:e,height:400,width:500,lineNumbers:!0,theme:"xq-light",lint:!0,tabMode:"indent",autoMatchParens:!0,textWrapping:!0,gutters:["CodeMirror-lint-markers"],extraKeys:{F1:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)}}}))}},{key:"changeTab",value:function(e,t){var n=this;setTimeout(function(){n[e]=!0,n.createCodeMirror("text/javascript",t)})}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=X.a.createElement("div",null);return X.a.createElement("div",null,X.a.createElement(H.a,{title:t.sampleCode,style:{width:"80%"},visible:this.state.dialogvisible,footer:n,onClose:this.closeDialog.bind(this)},X.a.createElement("div",{style:{height:500}},X.a.createElement(g.a,{tip:t.loading,style:{width:"100%"},visible:this.state.loading},X.a.createElement(re.a,{shape:"text",style:{height:40,paddingBottom:10}},X.a.createElement(ie,{title:"Java",key:1,onClick:this.changeTab.bind(this,"commoneditor1",this.defaultCode)}),X.a.createElement(ie,{title:"Spring Boot",key:2,onClick:this.changeTab.bind(this,"commoneditor2",this.sprigboot_code)}),X.a.createElement(ie,{title:"Spring Cloud",key:21,onClick:this.changeTab.bind(this,"commoneditor21",this.sprigcloud_code)}),X.a.createElement(ie,{title:"Node.js",key:3,onClick:this.changeTab.bind(this,"commoneditor3",this.nodejsCode)}),X.a.createElement(ie,{title:"C++",key:4,onClick:this.changeTab.bind(this,"commoneditor4",this.cppCode)}),X.a.createElement(ie,{title:"Shell",key:5,onClick:this.changeTab.bind(this,"commoneditor5",this.shellCode)}),X.a.createElement(ie,{title:"Python",key:6,onClick:this.changeTab.bind(this,"commoneditor6",this.pythonCode)})),X.a.createElement("div",{ref:"codepreview"})))))}}]),n}(X.a.Component),o.displayName="ShowCodeing",a=r))||a,le=(n(78),n(39)),ue=n.n(le),ce=(n(579),ue.a.Row),de=ue.a.Col,fe=(0,G.a.config)((l=s=function(e){function n(e){var t;return Object(F.a)(this,n),(t=Object(V.a)(this,Object(K.a)(n).call(this,e))).state={visible:!1,title:"",content:"",isok:!0,dataId:"",group:""},t}return Object(U.a)(n,e),Object(W.a)(n,[{key:"componentDidMount",value:function(){this.initData()}},{key:"initData",value:function(){var e=this.props.locale,t=void 0===e?{}:e;this.setState({title:t.confManagement})}},{key:"openDialog",value:function(e){this.setState({visible:!0,title:e.title,content:e.content,isok:e.isok,dataId:e.dataId,group:e.group,message:e.message})}},{key:"closeDialog",value:function(){this.setState({visible:!1})}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=X.a.createElement("div",{style:{textAlign:"right"}},X.a.createElement(b.a,{type:"primary",onClick:this.closeDialog.bind(this)},t.determine));return X.a.createElement("div",null,X.a.createElement(H.a,{visible:this.state.visible,footer:n,style:{width:555},onCancel:this.closeDialog.bind(this),onClose:this.closeDialog.bind(this),title:t.deletetitle},X.a.createElement("div",null,X.a.createElement(ce,null,X.a.createElement(de,{span:"4",style:{paddingTop:16}},X.a.createElement(j.a,{type:"".concat(this.state.isok?"success":"delete","-filling"),style:{color:this.state.isok?"green":"red"},size:"xl"})),X.a.createElement(de,{span:"20"},X.a.createElement("div",null,X.a.createElement("h3",null,this.state.isok?t.deletedSuccessfully:t.deleteFailed),X.a.createElement("p",null,X.a.createElement("span",{style:{color:"#999",marginRight:5}},"Data ID:"),X.a.createElement("span",{style:{color:"#c7254e"}},this.state.dataId)),X.a.createElement("p",null,X.a.createElement("span",{style:{color:"#999",marginRight:5}},"Group:"),X.a.createElement("span",{style:{color:"#c7254e"}},this.state.group)),this.state.isok?"":X.a.createElement("p",{style:{color:"red"}},this.state.message)))))))}}]),n}(X.a.Component),s.displayName="DeleteDialog",i=l))||i,pe=(n(580),n(345)),he=n.n(pe),me=(0,G.a.config)((d=c=function(e){function t(){return Object(F.a)(this,t),Object(V.a)(this,Object(K.a)(t).apply(this,arguments))}return Object(U.a)(t,e),Object(W.a)(t,[{key:"render",value:function(){var e=this.props,t=e.data,n=void 0===t?{}:t,a=e.height,o=e.locale,r=void 0===o?{}:o;return X.a.createElement("div",null,"notice"===n.modeType?X.a.createElement("div",{"data-spm-click":"gostr=/aliyun;locaid=notice"},X.a.createElement(he.a,{style:{marginBottom:1l?P.a.createElement($.a,{className:"pagination",total:s.count,pageSize:l,onChange:function(e){return a.onChangePage(e)}}):null,P.a.createElement(Z,{ref:this.editInstanceDialog,serviceName:r,clusterName:n,openLoading:function(){return a.openLoading()},closeLoading:function(){return a.closeLoading()},getInstanceList:function(){return a.getInstanceList()}})):null}}]),n}(P.a.Component),c.displayName="InstanceTable",u=d))||u,te=(n(593),Y.a.Item),ne={labelCol:{fixedSpan:10},wrapperCol:{span:14}},ae=(0,O.a.config)((h=p=function(e){function n(e){var t;return Object(T.a)(this,n),(t=Object(L.a)(this,Object(C.a)(n).call(this,e))).editServiceDialog=P.a.createRef(),t.editClusterDialog=P.a.createRef(),t.state={serviceName:Object(q.a)(e.location.search,"name"),groupName:Object(q.a)(e.location.search,"groupName"),loading:!1,currentPage:1,clusters:[],instances:{},service:{},pageSize:10,pageNum:{}},t}return Object(D.a)(n,e),Object(x.a)(n,[{key:"componentDidMount",value:function(){this.state.serviceName?this.getServiceDetail():this.props.history.goBack()}},{key:"getServiceDetail",value:function(){var r=this,e=this.state,t=e.serviceName,n=e.groupName;Object(I.c)({url:"v1/ns/catalog/service?serviceName=".concat(t,"&groupName=").concat(n),beforeSend:function(){return r.openLoading()},success:function(e){var t=e.clusters,n=void 0===t?[]:t,a=e.service,o=void 0===a?{}:a;return r.setState({service:o,clusters:n})},error:function(e){return k.a.error(e.responseText||"error")},complete:function(){return r.closeLoading()}})}},{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"openEditServiceDialog",value:function(){this.editServiceDialog.current.getInstance().show(this.state.service)}},{key:"openClusterDialog",value:function(e){this.editClusterDialog.current.getInstance().show(e)}},{key:"render",value:function(){var t=this,e=this.props.locale,n=void 0===e?{}:e,a=this.state,o=a.serviceName,r=a.loading,i=a.service,s=void 0===i?{}:i,l=a.clusters,u=s.metadata,c=void 0===u?{}:u,d=s.selector,f=void 0===d?{}:d,p=Object(q.b)(B.c)(c);return P.a.createElement("div",{className:"main-container service-detail"},P.a.createElement(g.a,{shape:"flower",tip:"Loading...",className:"loading",visible:r,color:"#333"},P.a.createElement("h1",{style:{position:"relative",width:"100%"}},n.serviceDetails,P.a.createElement(M.a,{type:"primary",className:"header-btn",onClick:function(){return t.props.history.goBack()}},n.back),P.a.createElement(M.a,{type:"normal",className:"header-btn",onClick:function(){return t.openEditServiceDialog()}},n.editService)),P.a.createElement(Y.a,ne,P.a.createElement(te,{label:"".concat(n.serviceName,":")},P.a.createElement(S.a,{value:s.name,readOnly:!0})),P.a.createElement(te,{label:"".concat(n.groupName,":")},P.a.createElement(S.a,{value:s.groupName,readOnly:!0})),P.a.createElement(te,{label:"".concat(n.protectThreshold,":")},P.a.createElement(S.a,{value:s.protectThreshold,readOnly:!0})),P.a.createElement(te,{label:"".concat(n.metadata,":")},P.a.createElement(U.a,{language:"properties",width:"100%",height:200,value:p,options:B.e})),P.a.createElement(te,{label:"".concat(n.type,":")},P.a.createElement(S.a,{value:f.type,readOnly:!0})),"label"===s.type&&P.a.createElement(te,{label:"".concat(n.selector,":")},P.a.createElement(S.a,{value:f.selector,readOnly:!0}))),l.map(function(e){return P.a.createElement(_.a,{key:e.name,className:"cluster-card",title:"".concat(n.cluster,":"),subTitle:e.name,contentHeight:"auto",extra:P.a.createElement(M.a,{type:"normal",onClick:function(){return t.openClusterDialog(e)}},n.editCluster)},P.a.createElement(ee,{clusterName:e.name,serviceName:o}))})),P.a.createElement(A.a,{ref:this.editServiceDialog,openLoading:function(){return t.openLoading()},closeLoading:function(){return t.closeLoading()},getServiceDetail:function(){return t.getServiceDetail()}}),P.a.createElement(G,{ref:this.editClusterDialog,openLoading:function(){return t.openLoading()},closeLoading:function(){return t.closeLoading()},getServiceDetail:function(){return t.getServiceDetail()}}))}}]),n}(P.a.Component),p.displayName="ServiceDetail",f=h))||f;t.a=ae},function(e,t,n){"use strict";n(41);var a,o,r,i,s,l,u=n(25),c=n.n(u),d=(n(29),n(19)),f=n.n(d),p=(n(330),n(110)),h=n.n(p),m=(n(30),n(23)),g=n.n(m),y=(n(58),n(31)),_=n.n(y),v=(n(32),n(10)),b=n.n(v),M=(n(50),n(27)),w=n.n(M),k=(n(33),n(20)),S=n.n(k),T=(n(44),n(28)),x=n.n(T),L=n(14),C=n(15),D=n(16),E=n(17),O=n(22),N=n(18),Y=(n(26),n(8)),j=n.n(Y),P=(n(98),n(81)),I=n.n(P),A=(n(35),n(9)),H=n.n(A),R=(n(138),n(56)),z=n.n(R),F=n(42),W=n.n(F),V=n(0),K=n.n(V),B=n(1),U=(n(78),n(39)),q=n.n(U),G=(n(557),q.a.Row),J=q.a.Col,$=(0,j.a.config)((r=o=function(e){function n(e){var t;return Object(L.a)(this,n),(t=Object(D.a)(this,Object(E.a)(n).call(this,e))).diffeditor=K.a.createRef(),t.state={dialogvisible:!1},t}return Object(N.a)(n,e),Object(C.a)(n,[{key:"openDialog",value:function(e,t){var n=this;this.setState({dialogvisible:!0}),setTimeout(function(){n.createDiffCodeMirror(e,t)})}},{key:"closeDialog",value:function(){this.setState({dialogvisible:!1})}},{key:"createDiffCodeMirror",value:function(e,t){var n=this.diffeditor.current;n.innerHTML="",this.diffeditor=window.CodeMirror.MergeView(n,{value:e||"",readOnly:!0,origLeft:null,orig:t||"",lineNumbers:!0,mode:this.mode,theme:"xq-light",highlightDifferences:!0,connect:"align",collapseIdentical:!1})}},{key:"confirmPub",value:function(){this.closeDialog(),this.props.publishConfig()}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=K.a.createElement("div",null," ",K.a.createElement(f.a,{type:"primary",onClick:this.confirmPub.bind(this)},t.publish));return K.a.createElement("div",null,K.a.createElement(S.a,{title:t.contents,style:{width:"80%"},visible:this.state.dialogvisible,footer:n,onClose:this.closeDialog.bind(this)},K.a.createElement("div",{style:{height:400}},K.a.createElement("div",null,K.a.createElement(G,null,K.a.createElement(J,{style:{textAlign:"center"}},t.currentArea),K.a.createElement(J,{style:{textAlign:"center"}},t.originalValue))),K.a.createElement("div",{style:{clear:"both",height:480},ref:this.diffeditor}))))}}]),n}(K.a.Component),o.displayName="DiffEditorDialog",a=r))||a,Q=n(83),X=n(111),Z=(n(558),z.a.Item),ee=H.a.Item,te=I.a.Group,ne=(0,j.a.config)((l=s=function(e){function t(e){var n;return Object(L.a)(this,t),(n=Object(D.a)(this,Object(E.a)(t).call(this,e)))._publishConfig=function(e){var t=n.props.locale,o=void 0===t?{}:t,r=Object(O.a)(n);n.codeValue=e,n.tenant=Object(B.b)("namespace")||"",n.serverId=Object(B.b)("serverId")||"center";var i={dataId:n.field.getValue("dataId"),appName:n.inApp?n.edasAppId:n.field.getValue("appName"),group:n.field.getValue("group"),desc:n.field.getValue("desc"),config_tags:n.state.config_tags.join(),type:n.state.configType,content:e,tenant:n.tenant};Object(B.c)({type:"post",contentType:"application/x-www-form-urlencoded",url:"v1/cs/configs",data:i,success:function(e){var t={};if(t.maintitle=o.toedittitle,t.title=K.a.createElement("div",null,o.toedit),t.content="",t.dataId=i.dataId,t.group=i.group,null!=e){t.isok=!0;var n=r.state.activeKey.split("-")[0];if("normal"===n&&!0===r.hasips){var a=(new Date).getTime();r.setState({tag:[{title:o.official,key:"normal-".concat(a)},{title:"BETA",key:"beta-".concat(a)}],hasbeta:!0,activeKey:"beta-".concat(a)}),i.betaIps=i.betaIps||i.ips,r.valueMap.beta=i,r.changeTab("beta-".concat(a))}"normal"===n&&!1===r.hasips&&(r.valueMap.normal=i),"beta"===n&&!0===r.hasips&&(r.valueMap.beta=i)}else t.isok=!1,t.message=e.message;r.successDialog.current.getInstance().openDialog(t)},error:function(){}})},n.diffEditorDialog=K.a.createRef(),n.successDialog=K.a.createRef(),n.edasAppName=Object(B.b)("edasAppName")||"",n.edasAppId=Object(B.b)("edasAppId")||"",n.inApp=n.edasAppName,n.field=new x.a(Object(O.a)(n)),n.dataId=Object(B.b)("dataId")||"yanlin",n.group=Object(B.b)("group")||"DEFAULT_GROUP",n.tenant=Object(B.b)("namespace")||"",n.state={configType:"text",codeValue:"",envname:"center",targetEnvName:"",envlist:[],envvalues:[],loading:!1,showmore:!1,activeKey:"normal",hasbeta:!1,ips:"",checkedBeta:!1,tagLst:[],config_tags:[],switchEncrypt:!1,tag:[]},n.codeValue="",n.mode="text",n.ips="",n.valueMap={},n.searchDataId=Object(B.b)("searchDataId")||"",n.searchGroup=Object(B.b)("searchGroup")||"",n}return Object(N.a)(t,e),Object(C.a)(t,[{key:"componentDidMount",value:function(){this.initData(),this.betaips=document.getElementById("betaips"),this.getDataDetail(),this.chontenttab=document.getElementById("chontenttab")}},{key:"initData",value:function(){var e=this.props.locale,t=void 0===e?{}:e;this.setState({tag:[{title:t.official,key:"normal"}]}),this.dataId.startsWith("cipher-")&&this.setState({switchEncrypt:!0})}},{key:"initMoacoEditor",value:function(e,t){var n=this;window.monaco?this.monacoEditor=window.monaco.editor.create(document.getElementById("container"),{value:t,language:this.state.configType,codeLens:!0,selectOnLineNumbers:!0,roundedSelection:!1,readOnly:!1,lineNumbersMinChars:!0,theme:"vs-dark",wordWrapColumn:120,folding:!1,showFoldingControls:"always",wordWrap:"wordWrapColumn",cursorStyle:"line",automaticLayout:!0}):window.importEditor(function(){n.monacoEditor=window.monaco.editor.create(document.getElementById("container"),{value:t,language:n.state.configType,codeLens:!0,selectOnLineNumbers:!0,roundedSelection:!1,readOnly:!1,lineNumbersMinChars:!0,theme:"vs-dark",wordWrapColumn:120,folding:!1,showFoldingControls:"always",wordWrap:"wordWrapColumn",cursorStyle:"line",automaticLayout:!0})})}},{key:"toggleMore",value:function(){this.setState({showmore:!this.state.showmore})}},{key:"navTo",value:function(e){this.serverId=Object(B.b)("serverId")||"",this.tenant=Object(B.b)("namespace")||"",this.props.history.push("".concat(e,"?serverId=").concat(this.serverId||"","&dataId=").concat(this.dataId,"&group=").concat(this.group,"&namespace=").concat(this.tenant))}},{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"getDataDetail",value:function(){var e=this.props.locale,o=void 0===e?{}:e,r=this;this.tenant=Object(B.b)("namespace")||"",this.serverId=Object(B.b)("serverId")||"center";var t="v1/cs/configs?show=all&dataId=".concat(this.dataId,"&group=").concat(this.group);Object(B.c)({url:t,beforeSend:function(){r.openLoading()},success:function(e){if(null!=e){var t=e;r.valueMap.normal=t,r.field.setValue("dataId",t.dataId),r.field.setValue("appName",r.inApp?r.edasAppName:t.appName),r.field.setValue("group",t.group),r.field.setValue("desc",t.desc),r.codeValue=t.content||"";var n=t.type||"text";if(r.setState({configType:n}),r.initMoacoEditor(n,r.codeValue),null!=t.configTags){var a=t.configTags.split(",");r.setConfigTags(a)}r.serverId={}.serverId,r.targetEnvs=[]}else S.a.alert({title:o.wrong,content:e.message})},complete:function(){r.closeLoading()}})}},{key:"goList",value:function(){var e=Object(B.b)("namespace");this.props.history.push("/configurationManagement?serverId=".concat(this.serverId,"&group=").concat(this.searchGroup,"&dataId=").concat(this.searchDataId,"&namespace=").concat(e))}},{key:"createCodeMirror",value:function(e,t){var n=this.refs.commoneditor;n.innerHTML="",this.commoneditor=window.CodeMirror(n,{value:t,mode:e,lineNumbers:!0,theme:"xq-light",lint:!0,gutters:["CodeMirror-lint-markers"],extraKeys:{F1:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)}}}),this.commoneditor.on("change",this.codemirrorValueChanged.bind(this))}},{key:"codemirrorValueChanged",value:function(e){this.diffeditor&&this.diffeditor.edit.doc.setValue(e.getValue())}},{key:"createDiffCodeMirror",value:function(e,t){var n=this.diffEditorDialog.current.getInstance();n.innerHTML="",this.diffeditor=window.CodeMirror.MergeView(n,{value:e||"",origLeft:null,orig:t||"",lineNumbers:!0,mode:this.mode,theme:"xq-light",highlightDifferences:!0,connect:"align",collapseIdentical:!1})}},{key:"changeConfig",value:function(e){0===e&&(this.createCodeMirror("text",this.codeValue),this.mode="text"),1===e&&(this.createCodeMirror("application/json",this.codeValue),this.mode="application/json"),2===e&&(this.createCodeMirror("xml",this.codeValue),this.mode="xml"),this.setState({configType:e})}},{key:"setCodeValue",value:function(e){this.setState({codeValue:e})}},{key:"toggleDiff",value:function(e){if(e){this.chontenttab.style.display="block";var t=this.commoneditor.doc.getValue();this.diffeditor||this.createDiffCodeMirror(t,this.codeValue)}else this.chontenttab.style.display="none"}},{key:"publishConfig",value:function(){var o=this,e=this.props.locale,r=void 0===e?{}:e;this.field.validate(function(e,t){if(!e){var n="",a=o.state.configType;(n=o.monacoEditor?o.monacoEditor.getValue():o.codeValue)?X.a.validate({content:n,type:a})?o._publishConfig(n):S.a.confirm({content:"配置信息可能有语法错误, 确定提交吗?",onOk:function(){o._publishConfig(n)}}):w.a.error({content:r.submitFailed,align:"cc cc"})}})}},{key:"validateChart",value:function(e,t,n){var a=this.props.locale,o=void 0===a?{}:a;/[@#\$%\^&\*]+/g.test(t)?n(o.vdchart):n()}},{key:"changeEnv",value:function(e){this.targetEnvs=e,this.setState({envvalues:e})}},{key:"changeBeta",value:function(e){this.betaips.style.display=e?"block":"none",this.setState({checkedBeta:e})}},{key:"getIps",value:function(e){this.ips=e,this.setState({ips:e})}},{key:"setConfigTags",value:function(n){5this.state.pageSize&&P.a.createElement("div",{style:{marginTop:10,textAlign:"right"}},P.a.createElement(b.a,{current:this.state.currentPage,total:this.state.total,pageSize:this.state.pageSize,onChange:function(e){return a.setState({currentPage:e},function(){return a.queryServiceList()})}}))),P.a.createElement(H.a,{ref:this.editServiceDialog,openLoading:function(){return a.openLoading()},closeLoading:function(){return a.closeLoading()},queryServiceList:function(){return a.setState({currentPage:1},function(){return a.queryServiceList()})}}))}}]),t}(P.a.Component),o.displayName="ServiceList",a=r))||a;t.a=V},function(e,t,n){"use strict";n(41);var a,o,r,i=n(25),s=n.n(i),l=(n(80),n(49)),u=n.n(l),c=(n(79),n(21)),d=n.n(c),f=(n(32),n(10)),p=n.n(f),h=(n(58),n(31)),m=n.n(h),g=(n(44),n(28)),y=n.n(g),_=n(60),v=n(14),b=n(15),M=n(16),w=n(17),k=n(22),S=n(18),T=(n(26),n(8)),x=n.n(T),L=(n(78),n(39)),C=n.n(L),D=(n(35),n(9)),E=n.n(D),O=n(0),N=n.n(O),Y=n(53),j=n(1),P=(n(564),E.a.Item),I=C.a.Row,A=C.a.Col,H=(0,x.a.config)((r=o=function(e){function t(e){var r;return Object(v.a)(this,t),(r=Object(M.a)(this,Object(w.a)(t).call(this,e))).queryTrackQuery=function(){var c=Object(k.a)(r),e="",d=r.getValue("type");if(1===d){var t=r.getValue("ip");e="v1/cs/listener?ip=".concat(t);var n=window.nownamespace||Object(j.b)("namespace")||"";n&&(e+="&tenant=".concat(n))}else{var a=r.getValue("dataId"),o=r.getValue("group");if(!a||!o)return!1;e="v1/cs/configs/listener?dataId=".concat(a,"&group=").concat(o)}Object(j.c)({url:e,beforeSend:function(){c.openLoading()},success:function(e){if(200===e.collectStatus){var t=[],n=e.lisentersGroupkeyStatus;for(var a in n)if(1===d){var o={},r=a.split("+"),i=Object(_.a)(r,2),s=i[0],l=i[1];o.dataId=s,o.group=l,o.md5=n[a],t.push(o)}else{var u={};u.ip=a,u.md5=n[a],t.push(u)}c.setState({dataSource:t||[],total:t.length||0})}},complete:function(){c.closeLoading()}})},r.changePage=function(e){r.setState({currentPage:e})},r.getQueryLater=function(){setTimeout(function(){r.queryTrackQuery()})},r.state={value:"",visible:!1,loading:!1,total:0,pageSize:10,currentPage:1,dataSource:[]},r.field=new y.a(Object(k.a)(r)),r.group=Object(j.b)("group")||"",r.dataId=Object(j.b)("dataId")||"",r.serverId=Object(j.b)("serverId")||"",r.tenant=Object(j.b)("namespace")||"",r}return Object(S.a)(t,e),Object(b.a)(t,[{key:"componentDidMount",value:function(){this.field.setValue("type",0),this.field.setValue("group",this.group),this.field.setValue("dataId",this.dataId)}},{key:"onSearch",value:function(){}},{key:"onChange",value:function(){}},{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"showMore",value:function(){}},{key:"resetSearch",value:function(){this.field.reset(),this.forceUpdate()}},{key:"renderStatus",value:function(e,t,n){var a=this.props.locale,o=void 0===a?{}:a;return N.a.createElement("div",null,!0===n.pushStatus?N.a.createElement("span",{style:{color:"green"}},o.success):N.a.createElement("span",{style:{color:"red"}},o.failure))}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=this.field,a=n.init,o=n.getValue;this.init=a,this.getValue=o;var r=[{label:t.configuration,value:0},{label:"IP",value:1}];return N.a.createElement("div",{style:{padding:10}},N.a.createElement(s.a,{shape:"flower",style:{position:"relative"},visible:this.state.loading,tip:"Loading...",color:"#333"},N.a.createElement(Y.a,{left:t.listenerQuery,namespaceCallBack:this.getQueryLater}),N.a.createElement(I,{className:"demo-row",style:{marginBottom:10,padding:0}},N.a.createElement(A,{span:"24"},N.a.createElement(E.a,{inline:!0,field:this.field},N.a.createElement(P,{label:"".concat(t.queryDimension,":")},N.a.createElement(m.a,Object.assign({dataSource:r,style:{width:200}},this.init("type")))),N.a.createElement(P,{label:"Data ID:",style:{display:0===this.getValue("type")?"":"none"},required:!0},N.a.createElement(p.a,Object.assign({placeholder:t.pleaseEnterTheDataId,style:{width:200}},this.init("dataId",{rules:[{required:!0,message:t.dataIdCanNotBeEmpty}]})))),N.a.createElement(P,{label:"Group:",style:{display:0===this.getValue("type")?"":"none"},required:!0},N.a.createElement(p.a,Object.assign({placeholder:t.pleaseInputGroup,style:{width:200}},this.init("group",{rules:[{required:!0,message:t.groupCanNotBeEmpty}]})))),N.a.createElement(P,{label:"IP:",style:{display:0===this.getValue("type")?"none":""}},N.a.createElement(p.a,Object.assign({placeholder:t.pleaseInputIp,style:{width:200,boxSize:"border-box"}},this.init("ip")))),N.a.createElement(P,{label:""},N.a.createElement(E.a.Submit,{validate:!0,type:"primary",onClick:this.queryTrackQuery,style:{marginRight:10}},t.query))))),N.a.createElement("div",{style:{position:"relative"}},N.a.createElement("h3",{style:{height:28,lineHeight:"28px",paddingLeft:10,borderLeft:"3px solid #09c",margin:0,marginBottom:10,fontSize:16}},t.queryResultsQuery,N.a.createElement("strong",{style:{fontWeight:"bold"}}," ",this.state.total," "),t.articleMeetRequirementsConfiguration)),N.a.createElement(I,{style:{padding:0}},N.a.createElement(A,{span:"24",style:{padding:0}},1===this.getValue("type")?N.a.createElement(d.a,{dataSource:this.state.dataSource,fixedHeader:!0,maxBodyHeight:500,locale:{empty:t.pubNoData}},N.a.createElement(d.a.Column,{title:"Data ID",dataIndex:"dataId"}),N.a.createElement(d.a.Column,{title:"Group",dataIndex:"group"}),N.a.createElement(d.a.Column,{title:"MD5",dataIndex:"md5"})):N.a.createElement(d.a,{dataSource:this.state.dataSource,fixedHeader:!0,maxBodyHeight:400,locale:{empty:t.pubNoData}},N.a.createElement(d.a.Column,{title:"IP",dataIndex:"ip"}),N.a.createElement(d.a.Column,{title:"MD5",dataIndex:"md5"})))),N.a.createElement("div",{style:{marginTop:10,textAlign:"right"}},N.a.createElement(u.a,{current:this.state.currentPage,total:this.state.total,pageSize:this.state.pageSize,onChange:this.changePage}),",")))}}]),t}(N.a.Component),o.displayName="ListeningToQuery",a=r))||a;t.a=H},function(e,t,n){"use strict";n(41);var a,o,r,i=n(25),s=n.n(i),l=(n(80),n(49)),u=n.n(l),c=(n(79),n(21)),d=n.n(c),f=(n(35),n(9)),p=n.n(f),h=(n(32),n(10)),m=n.n(h),g=(n(44),n(28)),y=n.n(g),_=n(14),v=n(15),b=n(16),M=n(17),w=n(22),k=n(18),S=(n(26),n(8)),T=n.n(S),x=n(0),L=n.n(x),C=n(53),D=n(1),E=(n(563),(0,T.a.config)((r=o=function(e){function a(e){var t;Object(_.a)(this,a),(t=Object(b.a)(this,Object(M.a)(a).call(this,e))).field=new y.a(Object(w.a)(t)),t.appName=Object(D.b)("appName")||"",t.preAppName=t.appName,t.group=Object(D.b)("group")||"",t.preGroup=t.group,t.dataId=Object(D.b)("dataId")||"",t.preDataId=t.dataId,t.serverId=Object(D.b)("serverId")||"",t.state={value:"",visible:!1,total:0,pageSize:10,currentPage:1,dataSource:[],fieldValue:[],showAppName:!1,showgroup:!1,dataId:t.dataId,group:t.group,appName:t.appName,selectValue:[],loading:!1};var n={dataId:t.dataId||"",group:t.preGroup||"",appName:t.appName||"",serverId:t.serverId||""};return Object(D.d)(n),t}return Object(k.a)(a,e),Object(v.a)(a,[{key:"componentDidMount",value:function(){this.field.setValue("group",this.group),this.field.setValue("dataId",this.dataId)}},{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"keyDownSearch",value:function(e){var t=e||window.event;return 13!==(t.keyCode||t.which||t.charCode)||(this.getData(),!1)}},{key:"UNSAFE_componentWillMount",value:function(){window.addEventListener("keydown",this.keyDownSearch.bind(this),!1)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("keydown",this.keyDownSearch.bind(this))}},{key:"onSearch",value:function(){}},{key:"onChange",value:function(){}},{key:"cleanAndGetData",value:function(){0=t.length?{value:void 0,done:!0}:(e=a(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var l=n(118),u=n(117);e.exports=function(s){return function(e,t){var n,a,o=String(u(e)),r=l(t),i=o.length;return r<0||i<=r?s?"":void 0:(n=o.charCodeAt(r))<55296||56319=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),r.Arguments=r.Array,a("keys"),a("values"),a("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){e.exports={default:n(388),__esModule:!0}},function(e,t,n){n(389),n(394),n(395),n(396),e.exports=n(63).Symbol},function(e,t,n){"use strict";var a=n(57),i=n(64),o=n(72),r=n(87),s=n(152),l=n(390).KEY,u=n(89),c=n(120),d=n(125),f=n(96),p=n(74),h=n(126),m=n(127),g=n(391),y=n(392),_=n(88),v=n(71),b=n(73),M=n(116),w=n(93),k=n(124),S=n(393),T=n(154),x=n(70),L=n(94),C=T.f,D=x.f,E=S.f,O=a.Symbol,N=a.JSON,Y=N&&N.stringify,j="prototype",P=p("_hidden"),I=p("toPrimitive"),A={}.propertyIsEnumerable,H=c("symbol-registry"),R=c("symbols"),z=c("op-symbols"),F=Object[j],W="function"==typeof O,V=a.QObject,K=!V||!V[j]||!V[j].findChild,B=o&&u(function(){return 7!=k(D({},"a",{get:function(){return D(this,"a",{value:7}).a}})).a})?function(e,t,n){var a=C(F,t);a&&delete F[t],D(e,t,n),a&&e!==F&&D(F,t,a)}:D,U=function(e){var t=R[e]=k(O[j]);return t._k=e,t},q=W&&"symbol"==typeof O.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof O},G=function(e,t,n){return e===F&&G(z,t,n),_(e),t=M(t,!0),_(n),i(R,t)?(n.enumerable?(i(e,P)&&e[P][t]&&(e[P][t]=!1),n=k(n,{enumerable:w(0,!1)})):(i(e,P)||D(e,P,w(1,{})),e[P][t]=!0),B(e,t,n)):D(e,t,n)},J=function(e,t){_(e);for(var n,a=g(t=b(t)),o=0,r=a.length;oo;)i(R,t=n[o++])||t==P||t==l||a.push(t);return a},Z=function(e){for(var t,n=e===F,a=E(n?z:b(e)),o=[],r=0;a.length>r;)!i(R,t=a[r++])||n&&!i(F,t)||o.push(R[t]);return o};W||(s((O=function(){if(this instanceof O)throw TypeError("Symbol is not a constructor!");var t=f(0te;)p(ee[te++]);for(var ne=L(p.store),ae=0;ne.length>ae;)m(ne[ae++]);r(r.S+r.F*!W,"Symbol",{for:function(e){return i(H,e+="")?H[e]:H[e]=O(e)},keyFor:function(e){if(!q(e))throw TypeError(e+" is not a symbol!");for(var t in H)if(H[t]===e)return t},useSetter:function(){K=!0},useSimple:function(){K=!1}}),r(r.S+r.F*!W,"Object",{create:function(e,t){return void 0===t?k(e):J(k(e),t)},defineProperty:G,defineProperties:J,getOwnPropertyDescriptor:Q,getOwnPropertyNames:X,getOwnPropertySymbols:Z}),N&&r(r.S+r.F*(!W||u(function(){var e=O();return"[null]"!=Y([e])||"{}"!=Y({a:e})||"{}"!=Y(Object(e))})),"JSON",{stringify:function(e){for(var t,n,a=[e],o=1;arguments.length>o;)a.push(arguments[o++]);if(n=t=a[1],(v(t)||void 0!==e)&&!q(e))return y(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!q(t))return t}),a[1]=t,Y.apply(N,a)}}),O[j][I]||n(69)(O[j],I,O[j].valueOf),d(O,"Symbol"),d(Math,"Math",!0),d(a.JSON,"JSON",!0)},function(e,t,n){var a=n(96)("meta"),o=n(71),r=n(64),i=n(70).f,s=0,l=Object.isExtensible||function(){return!0},u=!n(89)(function(){return l(Object.preventExtensions({}))}),c=function(e){i(e,a,{value:{i:"O"+ ++s,w:{}}})},d=e.exports={KEY:a,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!r(e,a)){if(!l(e))return"F";if(!t)return"E";c(e)}return e[a].i},getWeak:function(e,t){if(!r(e,a)){if(!l(e))return!0;if(!t)return!1;c(e)}return e[a].w},onFreeze:function(e){return u&&d.NEED&&l(e)&&!r(e,a)&&c(e),e}}},function(e,t,n){var s=n(94),l=n(122),u=n(97);e.exports=function(e){var t=s(e),n=l.f;if(n)for(var a,o=n(e),r=u.f,i=0;o.length>i;)r.call(e,a=o[i++])&&t.push(a);return t}},function(e,t,n){var a=n(149);e.exports=Array.isArray||function(e){return"Array"==a(e)}},function(e,t,n){var a=n(73),o=n(153).f,r={}.toString,i="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return i&&"[object Window]"==r.call(e)?function(e){try{return o(e)}catch(e){return i.slice()}}(e):o(a(e))}},function(e,t){},function(e,t,n){n(127)("asyncIterator")},function(e,t,n){n(127)("observable")},function(e,t,n){e.exports={default:n(398),__esModule:!0}},function(e,t,n){n(399),e.exports=n(63).Object.setPrototypeOf},function(e,t,n){var a=n(87);a(a.S,"Object",{setPrototypeOf:n(400).set})},function(e,t,o){var n=o(71),a=o(88),r=function(e,t){if(a(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,n,a){try{(a=o(144)(Function.call,o(154).f(Object.prototype,"__proto__").set,2))(e,[]),n=!(e instanceof Array)}catch(e){n=!0}return function(e,t){return r(e,t),n?e.__proto__=t:a(e,t),e}}({},!1):void 0),check:r}},function(e,t,n){e.exports={default:n(402),__esModule:!0}},function(e,t,n){n(403);var a=n(63).Object;e.exports=function(e,t){return a.create(e,t)}},function(e,t,n){var a=n(87);a(a.S,"Object",{create:n(124)})},function(e,t,n){"use strict"; +*/var l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(e){a[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},a)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),r=1;re.clientHeight&&0a.length&&a.every(function(e,t){return e===n[t]})},y.prototype.handleOpen=function(t,e,n,a){var o=this,r=void 0,i=this.props,s=i.mode,l=i.openMode,u=this.state.openKeys,c=u.indexOf(t);e&&-1===c?"inline"===s?"single"===l?(r=u.filter(function(e){return!o.isSibling(o.k2n[t].pos,o.k2n[e].pos)})).push(t):r=u.concat(t):(r=u.filter(function(e){return o.isAncestor(o.k2n[t].pos,o.k2n[e].pos)})).push(t):!e&&-1this.popupNode.offsetWidth&&y(this.popupNode,"width",p.offsetWidth+"px")}"outside"!==u||"hoz"===l&&1===n||(y(this.popupNode,"height",f.offsetHeight+"px"),y(this.popupNode,"overflow-y","scroll"));var h=this.popupProps;h.onOpen&&h.onOpen()},D.prototype.handlePopupClose=function(){var e=this.props.root.popupNodes,t=e.indexOf(this.popupNode);-1e.slidesToShow&&(t=e.slideWidth*e.slidesToShow*-1,o=e.slideHeight*e.slidesToShow*-1),e.slideCount%e.slidesToScroll!=0){var r=e.slideIndex+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow;if(e.rtl)r=(e.slideIndex>=e.slideCount?e.slideCount-e.slideIndex:e.slideIndex)+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow;r&&(o=e.slideIndex>e.slideCount?(t=(e.slidesToShow-(e.slideIndex-e.slideCount))*e.slideWidth*-1,(e.slidesToShow-(e.slideIndex-e.slideCount))*e.slideHeight*-1):(t=e.slideCount%e.slidesToScroll*e.slideWidth*-1,e.slideCount%e.slidesToScroll*e.slideHeight*-1))}}else e.slideCount%e.slidesToScroll!=0&&e.slideIndex+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow&&(t=(e.slidesToShow-e.slideCount%e.slidesToScroll)*e.slideWidth);if(e.centerMode&&(e.infinite?t+=e.slideWidth*Math.floor(e.slidesToShow/2):t=e.slideWidth*Math.floor(e.slidesToShow/2)),n=e.vertical?e.slideIndex*e.slideHeight*-1+o:e.slideIndex*e.slideWidth*-1+t,!0===e.variableWidth){var i=void 0;n=(a=e.slideCount<=e.slidesToShow||!1===e.infinite?s.default.findDOMNode(e.trackRef).childNodes[e.slideIndex]:(i=e.slideIndex+e.slidesToShow,s.default.findDOMNode(e.trackRef).childNodes[i]))?-1*a.offsetLeft:0,!0===e.centerMode&&(a=!1===e.infinite?s.default.findDOMNode(e.trackRef).children[e.slideIndex]:s.default.findDOMNode(e.trackRef).children[e.slideIndex+e.slidesToShow+1])&&(n=-1*a.offsetLeft+(e.listWidth-a.offsetWidth)/2)}return n}},function(e,t,n){"use strict";n(592)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.routerMiddleware=t.routerActions=t.goForward=t.goBack=t.go=t.replace=t.push=t.CALL_HISTORY_METHOD=t.routerReducer=t.LOCATION_CHANGE=t.syncHistoryWithStore=void 0;var a=n(293);Object.defineProperty(t,"LOCATION_CHANGE",{enumerable:!0,get:function(){return a.LOCATION_CHANGE}}),Object.defineProperty(t,"routerReducer",{enumerable:!0,get:function(){return a.routerReducer}});var o=n(294);Object.defineProperty(t,"CALL_HISTORY_METHOD",{enumerable:!0,get:function(){return o.CALL_HISTORY_METHOD}}),Object.defineProperty(t,"push",{enumerable:!0,get:function(){return o.push}}),Object.defineProperty(t,"replace",{enumerable:!0,get:function(){return o.replace}}),Object.defineProperty(t,"go",{enumerable:!0,get:function(){return o.go}}),Object.defineProperty(t,"goBack",{enumerable:!0,get:function(){return o.goBack}}),Object.defineProperty(t,"goForward",{enumerable:!0,get:function(){return o.goForward}}),Object.defineProperty(t,"routerActions",{enumerable:!0,get:function(){return o.routerActions}});var r=s(n(424)),i=s(n(425));function s(e){return e&&e.__esModule?e:{default:e}}t.syncHistoryWithStore=r.default,t.routerMiddleware=i.default},function(e,t,n){"use strict";function a(o){return function(e){var n=e.dispatch,a=e.getState;return function(t){return function(e){return"function"==typeof e?e(n,a,o):t(e)}}}}var o=a();o.withExtraArgument=a,t.a=o},function(e,t,n){"use strict";var a=n(140),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},d={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function f(e){return a.isMemo(e)?r:i[e.$$typeof]||o}i[a.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var p=Object.defineProperty,h=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols,g=Object.getOwnPropertyDescriptor,y=Object.getPrototypeOf,_=Object.prototype;e.exports=function e(t,n,a){if("string"==typeof n)return t;if(_){var o=y(n);o&&o!==_&&e(t,o,a)}var r=h(n);m&&(r=r.concat(m(n)));for(var i=f(t),s=f(n),l=0;l\n com.alibaba.nacos\n nacos-client\n ${version}\n \n*/\npackage com.alibaba.nacos.example;\n\nimport java.util.Properties;\nimport java.util.concurrent.Executor;\nimport com.alibaba.nacos.api.NacosFactory;\nimport com.alibaba.nacos.api.config.ConfigService;\nimport com.alibaba.nacos.api.config.listener.Listener;\nimport com.alibaba.nacos.api.exception.NacosException;\n\n/**\n * Config service example\n * \n * @author Nacos\n *\n */\npublic class ConfigExample {\n\n\tpublic static void main(String[] args) throws NacosException, InterruptedException {\n\t\tString serverAddr = "localhost";\n\t\tString dataId = "'.concat(e.dataId,'";\n\t\tString group = "').concat(e.group,'";\n\t\tProperties properties = new Properties();\n\t\tproperties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);\n\t\tConfigService configService = NacosFactory.createConfigService(properties);\n\t\tString content = configService.getConfig(dataId, group, 5000);\n\t\tSystem.out.println(content);\n\t\tconfigService.addListener(dataId, group, new Listener() {\n\t\t\t@Override\n\t\t\tpublic void receiveConfigInfo(String configInfo) {\n\t\t\t\tSystem.out.println("recieve:" + configInfo);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic Executor getExecutor() {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t});\n\t\t\n\t\tboolean isPublishOk = configService.publishConfig(dataId, group, "content");\n\t\tSystem.out.println(isPublishOk);\n\t\t\n\t\tThread.sleep(3000);\n\t\tcontent = configService.getConfig(dataId, group, 5000);\n\t\tSystem.out.println(content);\n\n\t\tboolean isRemoveOk = configService.removeConfig(dataId, group);\n\t\tSystem.out.println(isRemoveOk);\n\t\tThread.sleep(3000);\n\n\t\tcontent = configService.getConfig(dataId, group, 5000);\n\t\tSystem.out.println(content);\n\t\tThread.sleep(300000);\n\n\t}\n}\n')}},{key:"getNodejsCode",value:function(e){return"TODO"}},{key:"getCppCode",value:function(e){return"TODO"}},{key:"getShellCode",value:function(e){return"TODO"}},{key:"getPythonCode",value:function(e){return"TODO"}},{key:"openDialog",value:function(e){var t=this;this.setState({dialogvisible:!0}),this.record=e,setTimeout(function(){t.getData()})}},{key:"closeDialog",value:function(){this.setState({dialogvisible:!1})}},{key:"createCodeMirror",value:function(e,t){var n=this.refs.codepreview;n&&(n.innerHTML="",this.cm=window.CodeMirror(n,{value:t,mode:e,height:400,width:500,lineNumbers:!0,theme:"xq-light",lint:!0,tabMode:"indent",autoMatchParens:!0,textWrapping:!0,gutters:["CodeMirror-lint-markers"],extraKeys:{F1:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)}}}))}},{key:"changeTab",value:function(e,t){var n=this;setTimeout(function(){n[e]=!0,n.createCodeMirror("text/javascript",t)})}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=X.a.createElement("div",null);return X.a.createElement("div",null,X.a.createElement(H.a,{title:t.sampleCode,style:{width:"80%"},visible:this.state.dialogvisible,footer:n,onClose:this.closeDialog.bind(this)},X.a.createElement("div",{style:{height:500}},X.a.createElement(g.a,{tip:t.loading,style:{width:"100%"},visible:this.state.loading},X.a.createElement(re.a,{shape:"text",style:{height:40,paddingBottom:10}},X.a.createElement(ie,{title:"Java",key:1,onClick:this.changeTab.bind(this,"commoneditor1",this.defaultCode)}),X.a.createElement(ie,{title:"Spring Boot",key:2,onClick:this.changeTab.bind(this,"commoneditor2",this.sprigboot_code)}),X.a.createElement(ie,{title:"Spring Cloud",key:21,onClick:this.changeTab.bind(this,"commoneditor21",this.sprigcloud_code)}),X.a.createElement(ie,{title:"Node.js",key:3,onClick:this.changeTab.bind(this,"commoneditor3",this.nodejsCode)}),X.a.createElement(ie,{title:"C++",key:4,onClick:this.changeTab.bind(this,"commoneditor4",this.cppCode)}),X.a.createElement(ie,{title:"Shell",key:5,onClick:this.changeTab.bind(this,"commoneditor5",this.shellCode)}),X.a.createElement(ie,{title:"Python",key:6,onClick:this.changeTab.bind(this,"commoneditor6",this.pythonCode)})),X.a.createElement("div",{ref:"codepreview"})))))}}]),n}(X.a.Component),o.displayName="ShowCodeing",a=r))||a,le=(n(78),n(39)),ue=n.n(le),ce=(n(579),ue.a.Row),de=ue.a.Col,fe=(0,G.a.config)((l=s=function(e){function n(e){var t;return Object(F.a)(this,n),(t=Object(V.a)(this,Object(K.a)(n).call(this,e))).state={visible:!1,title:"",content:"",isok:!0,dataId:"",group:""},t}return Object(U.a)(n,e),Object(W.a)(n,[{key:"componentDidMount",value:function(){this.initData()}},{key:"initData",value:function(){var e=this.props.locale,t=void 0===e?{}:e;this.setState({title:t.confManagement})}},{key:"openDialog",value:function(e){this.setState({visible:!0,title:e.title,content:e.content,isok:e.isok,dataId:e.dataId,group:e.group,message:e.message})}},{key:"closeDialog",value:function(){this.setState({visible:!1})}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=X.a.createElement("div",{style:{textAlign:"right"}},X.a.createElement(b.a,{type:"primary",onClick:this.closeDialog.bind(this)},t.determine));return X.a.createElement("div",null,X.a.createElement(H.a,{visible:this.state.visible,footer:n,style:{width:555},onCancel:this.closeDialog.bind(this),onClose:this.closeDialog.bind(this),title:t.deletetitle},X.a.createElement("div",null,X.a.createElement(ce,null,X.a.createElement(de,{span:"4",style:{paddingTop:16}},X.a.createElement(j.a,{type:"".concat(this.state.isok?"success":"delete","-filling"),style:{color:this.state.isok?"green":"red"},size:"xl"})),X.a.createElement(de,{span:"20"},X.a.createElement("div",null,X.a.createElement("h3",null,this.state.isok?t.deletedSuccessfully:t.deleteFailed),X.a.createElement("p",null,X.a.createElement("span",{style:{color:"#999",marginRight:5}},"Data ID:"),X.a.createElement("span",{style:{color:"#c7254e"}},this.state.dataId)),X.a.createElement("p",null,X.a.createElement("span",{style:{color:"#999",marginRight:5}},"Group:"),X.a.createElement("span",{style:{color:"#c7254e"}},this.state.group)),this.state.isok?"":X.a.createElement("p",{style:{color:"red"}},this.state.message)))))))}}]),n}(X.a.Component),s.displayName="DeleteDialog",i=l))||i,pe=(n(580),n(345)),he=n.n(pe),me=(0,G.a.config)((d=c=function(e){function t(){return Object(F.a)(this,t),Object(V.a)(this,Object(K.a)(t).apply(this,arguments))}return Object(U.a)(t,e),Object(W.a)(t,[{key:"render",value:function(){var e=this.props,t=e.data,n=void 0===t?{}:t,a=e.height,o=e.locale,r=void 0===o?{}:o;return X.a.createElement("div",null,"notice"===n.modeType?X.a.createElement("div",{"data-spm-click":"gostr=/aliyun;locaid=notice"},X.a.createElement(he.a,{style:{marginBottom:1l?P.a.createElement($.a,{className:"pagination",total:s.count,pageSize:l,onChange:function(e){return a.onChangePage(e)}}):null,P.a.createElement(Z,{ref:this.editInstanceDialog,serviceName:r,clusterName:n,openLoading:function(){return a.openLoading()},closeLoading:function(){return a.closeLoading()},getInstanceList:function(){return a.getInstanceList()}})):null}}]),n}(P.a.Component),c.displayName="InstanceTable",u=d))||u,te=(n(593),Y.a.Item),ne={labelCol:{fixedSpan:10},wrapperCol:{span:14}},ae=(0,O.a.config)((h=p=function(e){function n(e){var t;return Object(T.a)(this,n),(t=Object(L.a)(this,Object(C.a)(n).call(this,e))).editServiceDialog=P.a.createRef(),t.editClusterDialog=P.a.createRef(),t.state={serviceName:Object(q.a)(e.location.search,"name"),groupName:Object(q.a)(e.location.search,"groupName"),loading:!1,currentPage:1,clusters:[],instances:{},service:{},pageSize:10,pageNum:{}},t}return Object(D.a)(n,e),Object(x.a)(n,[{key:"componentDidMount",value:function(){this.state.serviceName?this.getServiceDetail():this.props.history.goBack()}},{key:"getServiceDetail",value:function(){var r=this,e=this.state,t=e.serviceName,n=e.groupName;Object(I.c)({url:"v1/ns/catalog/service?serviceName=".concat(t,"&groupName=").concat(n),beforeSend:function(){return r.openLoading()},success:function(e){var t=e.clusters,n=void 0===t?[]:t,a=e.service,o=void 0===a?{}:a;return r.setState({service:o,clusters:n})},error:function(e){return k.a.error(e.responseText||"error")},complete:function(){return r.closeLoading()}})}},{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"openEditServiceDialog",value:function(){this.editServiceDialog.current.getInstance().show(this.state.service)}},{key:"openClusterDialog",value:function(e){this.editClusterDialog.current.getInstance().show(e)}},{key:"render",value:function(){var t=this,e=this.props.locale,n=void 0===e?{}:e,a=this.state,o=a.serviceName,r=a.loading,i=a.service,s=void 0===i?{}:i,l=a.clusters,u=s.metadata,c=void 0===u?{}:u,d=s.selector,f=void 0===d?{}:d,p=Object(q.b)(B.c)(c);return P.a.createElement("div",{className:"main-container service-detail"},P.a.createElement(g.a,{shape:"flower",tip:"Loading...",className:"loading",visible:r,color:"#333"},P.a.createElement("h1",{style:{position:"relative",width:"100%"}},n.serviceDetails,P.a.createElement(M.a,{type:"primary",className:"header-btn",onClick:function(){return t.props.history.goBack()}},n.back),P.a.createElement(M.a,{type:"normal",className:"header-btn",onClick:function(){return t.openEditServiceDialog()}},n.editService)),P.a.createElement(Y.a,ne,P.a.createElement(te,{label:"".concat(n.serviceName,":")},P.a.createElement(S.a,{value:s.name,readOnly:!0})),P.a.createElement(te,{label:"".concat(n.groupName,":")},P.a.createElement(S.a,{value:s.groupName,readOnly:!0})),P.a.createElement(te,{label:"".concat(n.protectThreshold,":")},P.a.createElement(S.a,{value:s.protectThreshold,readOnly:!0})),P.a.createElement(te,{label:"".concat(n.metadata,":")},P.a.createElement(U.a,{language:"properties",width:"100%",height:200,value:p,options:B.e})),P.a.createElement(te,{label:"".concat(n.type,":")},P.a.createElement(S.a,{value:f.type,readOnly:!0})),"label"===s.type&&P.a.createElement(te,{label:"".concat(n.selector,":")},P.a.createElement(S.a,{value:f.selector,readOnly:!0}))),l.map(function(e){return P.a.createElement(_.a,{key:e.name,className:"cluster-card",title:"".concat(n.cluster,":"),subTitle:e.name,contentHeight:"auto",extra:P.a.createElement(M.a,{type:"normal",onClick:function(){return t.openClusterDialog(e)}},n.editCluster)},P.a.createElement(ee,{clusterName:e.name,serviceName:o}))})),P.a.createElement(A.a,{ref:this.editServiceDialog,openLoading:function(){return t.openLoading()},closeLoading:function(){return t.closeLoading()},getServiceDetail:function(){return t.getServiceDetail()}}),P.a.createElement(G,{ref:this.editClusterDialog,openLoading:function(){return t.openLoading()},closeLoading:function(){return t.closeLoading()},getServiceDetail:function(){return t.getServiceDetail()}}))}}]),n}(P.a.Component),p.displayName="ServiceDetail",f=h))||f;t.a=ae},function(e,t,n){"use strict";n(41);var a,o,r,i,s,l,u=n(25),c=n.n(u),d=(n(29),n(19)),f=n.n(d),p=(n(330),n(110)),h=n.n(p),m=(n(30),n(23)),g=n.n(m),y=(n(58),n(31)),_=n.n(y),v=(n(32),n(10)),b=n.n(v),M=(n(50),n(27)),w=n.n(M),k=(n(33),n(20)),S=n.n(k),T=(n(44),n(28)),x=n.n(T),L=n(14),C=n(15),D=n(16),E=n(17),O=n(22),N=n(18),Y=(n(26),n(8)),j=n.n(Y),P=(n(98),n(81)),I=n.n(P),A=(n(35),n(9)),H=n.n(A),R=(n(138),n(56)),z=n.n(R),F=n(42),W=n.n(F),V=n(0),K=n.n(V),B=n(1),U=(n(78),n(39)),q=n.n(U),G=(n(557),q.a.Row),J=q.a.Col,$=(0,j.a.config)((r=o=function(e){function n(e){var t;return Object(L.a)(this,n),(t=Object(D.a)(this,Object(E.a)(n).call(this,e))).diffeditor=K.a.createRef(),t.state={dialogvisible:!1},t}return Object(N.a)(n,e),Object(C.a)(n,[{key:"openDialog",value:function(e,t){var n=this;this.setState({dialogvisible:!0}),setTimeout(function(){n.createDiffCodeMirror(e,t)})}},{key:"closeDialog",value:function(){this.setState({dialogvisible:!1})}},{key:"createDiffCodeMirror",value:function(e,t){var n=this.diffeditor.current;n.innerHTML="",this.diffeditor=window.CodeMirror.MergeView(n,{value:e||"",readOnly:!0,origLeft:null,orig:t||"",lineNumbers:!0,mode:this.mode,theme:"xq-light",highlightDifferences:!0,connect:"align",collapseIdentical:!1})}},{key:"confirmPub",value:function(){this.closeDialog(),this.props.publishConfig()}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=K.a.createElement("div",null," ",K.a.createElement(f.a,{type:"primary",onClick:this.confirmPub.bind(this)},t.publish));return K.a.createElement("div",null,K.a.createElement(S.a,{title:t.contents,style:{width:"80%"},visible:this.state.dialogvisible,footer:n,onClose:this.closeDialog.bind(this)},K.a.createElement("div",{style:{height:400}},K.a.createElement("div",null,K.a.createElement(G,null,K.a.createElement(J,{style:{textAlign:"center"}},t.currentArea),K.a.createElement(J,{style:{textAlign:"center"}},t.originalValue))),K.a.createElement("div",{style:{clear:"both",height:480},ref:this.diffeditor}))))}}]),n}(K.a.Component),o.displayName="DiffEditorDialog",a=r))||a,Q=n(83),X=n(111),Z=(n(558),z.a.Item),ee=H.a.Item,te=I.a.Group,ne=(0,j.a.config)((l=s=function(e){function t(e){var n;return Object(L.a)(this,t),(n=Object(D.a)(this,Object(E.a)(t).call(this,e)))._publishConfig=function(e){var t=n.props.locale,o=void 0===t?{}:t,r=Object(O.a)(n);n.codeValue=e,n.tenant=Object(B.b)("namespace")||"",n.serverId=Object(B.b)("serverId")||"center";var i={dataId:n.field.getValue("dataId"),appName:n.inApp?n.edasAppId:n.field.getValue("appName"),group:n.field.getValue("group"),desc:n.field.getValue("desc"),config_tags:n.state.config_tags.join(),type:n.state.configType,content:e,tenant:n.tenant};Object(B.c)({type:"post",contentType:"application/x-www-form-urlencoded",url:"v1/cs/configs",data:i,success:function(e){var t={};if(t.maintitle=o.toedittitle,t.title=K.a.createElement("div",null,o.toedit),t.content="",t.dataId=i.dataId,t.group=i.group,null!=e){t.isok=!0;var n=r.state.activeKey.split("-")[0];if("normal"===n&&!0===r.hasips){var a=(new Date).getTime();r.setState({tag:[{title:o.official,key:"normal-".concat(a)},{title:"BETA",key:"beta-".concat(a)}],hasbeta:!0,activeKey:"beta-".concat(a)}),i.betaIps=i.betaIps||i.ips,r.valueMap.beta=i,r.changeTab("beta-".concat(a))}"normal"===n&&!1===r.hasips&&(r.valueMap.normal=i),"beta"===n&&!0===r.hasips&&(r.valueMap.beta=i)}else t.isok=!1,t.message=e.message;r.successDialog.current.getInstance().openDialog(t)},error:function(){}})},n.diffEditorDialog=K.a.createRef(),n.successDialog=K.a.createRef(),n.edasAppName=Object(B.b)("edasAppName")||"",n.edasAppId=Object(B.b)("edasAppId")||"",n.inApp=n.edasAppName,n.field=new x.a(Object(O.a)(n)),n.dataId=Object(B.b)("dataId")||"yanlin",n.group=Object(B.b)("group")||"DEFAULT_GROUP",n.tenant=Object(B.b)("namespace")||"",n.state={configType:"text",codeValue:"",envname:"center",targetEnvName:"",envlist:[],envvalues:[],loading:!1,showmore:!1,activeKey:"normal",hasbeta:!1,ips:"",checkedBeta:!1,tagLst:[],config_tags:[],switchEncrypt:!1,tag:[]},n.codeValue="",n.mode="text",n.ips="",n.valueMap={},n.searchDataId=Object(B.b)("searchDataId")||"",n.searchGroup=Object(B.b)("searchGroup")||"",n}return Object(N.a)(t,e),Object(C.a)(t,[{key:"componentDidMount",value:function(){this.initData(),this.betaips=document.getElementById("betaips"),this.getDataDetail(),this.chontenttab=document.getElementById("chontenttab")}},{key:"initData",value:function(){var e=this.props.locale,t=void 0===e?{}:e;this.setState({tag:[{title:t.official,key:"normal"}]}),this.dataId.startsWith("cipher-")&&this.setState({switchEncrypt:!0})}},{key:"initMoacoEditor",value:function(e,t){var n=this;window.monaco?this.monacoEditor=window.monaco.editor.create(document.getElementById("container"),{value:t,language:this.state.configType,codeLens:!0,selectOnLineNumbers:!0,roundedSelection:!1,readOnly:!1,lineNumbersMinChars:!0,theme:"vs-dark",wordWrapColumn:120,folding:!1,showFoldingControls:"always",wordWrap:"wordWrapColumn",cursorStyle:"line",automaticLayout:!0}):window.importEditor(function(){n.monacoEditor=window.monaco.editor.create(document.getElementById("container"),{value:t,language:n.state.configType,codeLens:!0,selectOnLineNumbers:!0,roundedSelection:!1,readOnly:!1,lineNumbersMinChars:!0,theme:"vs-dark",wordWrapColumn:120,folding:!1,showFoldingControls:"always",wordWrap:"wordWrapColumn",cursorStyle:"line",automaticLayout:!0})})}},{key:"toggleMore",value:function(){this.setState({showmore:!this.state.showmore})}},{key:"navTo",value:function(e){this.serverId=Object(B.b)("serverId")||"",this.tenant=Object(B.b)("namespace")||"",this.props.history.push("".concat(e,"?serverId=").concat(this.serverId||"","&dataId=").concat(this.dataId,"&group=").concat(this.group,"&namespace=").concat(this.tenant))}},{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"getDataDetail",value:function(){var e=this.props.locale,o=void 0===e?{}:e,r=this;this.tenant=Object(B.b)("namespace")||"",this.serverId=Object(B.b)("serverId")||"center";var t="v1/cs/configs?show=all&dataId=".concat(this.dataId,"&group=").concat(this.group);Object(B.c)({url:t,beforeSend:function(){r.openLoading()},success:function(e){if(null!=e){var t=e;r.valueMap.normal=t,r.field.setValue("dataId",t.dataId),r.field.setValue("appName",r.inApp?r.edasAppName:t.appName),r.field.setValue("group",t.group),r.field.setValue("desc",t.desc),r.codeValue=t.content||"";var n=t.type||"text";if(r.setState({configType:n}),r.initMoacoEditor(n,r.codeValue),null!=t.configTags){var a=t.configTags.split(",");r.setConfigTags(a)}r.serverId={}.serverId,r.targetEnvs=[]}else S.a.alert({title:o.wrong,content:e.message})},complete:function(){r.closeLoading()}})}},{key:"goList",value:function(){var e=Object(B.b)("namespace");this.props.history.push("/configurationManagement?serverId=".concat(this.serverId,"&group=").concat(this.searchGroup,"&dataId=").concat(this.searchDataId,"&namespace=").concat(e))}},{key:"createCodeMirror",value:function(e,t){var n=this.refs.commoneditor;n.innerHTML="",this.commoneditor=window.CodeMirror(n,{value:t,mode:e,lineNumbers:!0,theme:"xq-light",lint:!0,gutters:["CodeMirror-lint-markers"],extraKeys:{F1:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)}}}),this.commoneditor.on("change",this.codemirrorValueChanged.bind(this))}},{key:"codemirrorValueChanged",value:function(e){this.diffeditor&&this.diffeditor.edit.doc.setValue(e.getValue())}},{key:"createDiffCodeMirror",value:function(e,t){var n=this.diffEditorDialog.current.getInstance();n.innerHTML="",this.diffeditor=window.CodeMirror.MergeView(n,{value:e||"",origLeft:null,orig:t||"",lineNumbers:!0,mode:this.mode,theme:"xq-light",highlightDifferences:!0,connect:"align",collapseIdentical:!1})}},{key:"changeConfig",value:function(e){0===e&&(this.createCodeMirror("text",this.codeValue),this.mode="text"),1===e&&(this.createCodeMirror("application/json",this.codeValue),this.mode="application/json"),2===e&&(this.createCodeMirror("xml",this.codeValue),this.mode="xml"),this.setState({configType:e})}},{key:"setCodeValue",value:function(e){this.setState({codeValue:e})}},{key:"toggleDiff",value:function(e){if(e){this.chontenttab.style.display="block";var t=this.commoneditor.doc.getValue();this.diffeditor||this.createDiffCodeMirror(t,this.codeValue)}else this.chontenttab.style.display="none"}},{key:"publishConfig",value:function(){var o=this,e=this.props.locale,r=void 0===e?{}:e;this.field.validate(function(e,t){if(!e){var n="",a=o.state.configType;(n=o.monacoEditor?o.monacoEditor.getValue():o.codeValue)?X.a.validate({content:n,type:a})?o._publishConfig(n):S.a.confirm({content:"配置信息可能有语法错误, 确定提交吗?",onOk:function(){o._publishConfig(n)}}):w.a.error({content:r.submitFailed,align:"cc cc"})}})}},{key:"validateChart",value:function(e,t,n){var a=this.props.locale,o=void 0===a?{}:a;/[@#\$%\^&\*]+/g.test(t)?n(o.vdchart):n()}},{key:"changeEnv",value:function(e){this.targetEnvs=e,this.setState({envvalues:e})}},{key:"changeBeta",value:function(e){this.betaips.style.display=e?"block":"none",this.setState({checkedBeta:e})}},{key:"getIps",value:function(e){this.ips=e,this.setState({ips:e})}},{key:"setConfigTags",value:function(n){5this.state.pageSize&&P.a.createElement("div",{style:{marginTop:10,textAlign:"right"}},P.a.createElement(b.a,{current:this.state.currentPage,total:this.state.total,pageSize:this.state.pageSize,onChange:function(e){return a.setState({currentPage:e},function(){return a.queryServiceList()})}}))),P.a.createElement(H.a,{ref:this.editServiceDialog,openLoading:function(){return a.openLoading()},closeLoading:function(){return a.closeLoading()},queryServiceList:function(){return a.setState({currentPage:1},function(){return a.queryServiceList()})}}))}}]),t}(P.a.Component),o.displayName="ServiceList",a=r))||a;t.a=V},function(e,t,n){"use strict";n(41);var a,o,r,i=n(25),s=n.n(i),l=(n(80),n(49)),u=n.n(l),c=(n(79),n(21)),d=n.n(c),f=(n(32),n(10)),p=n.n(f),h=(n(58),n(31)),m=n.n(h),g=(n(44),n(28)),y=n.n(g),_=n(60),v=n(14),b=n(15),M=n(16),w=n(17),k=n(22),S=n(18),T=(n(26),n(8)),x=n.n(T),L=(n(78),n(39)),C=n.n(L),D=(n(35),n(9)),E=n.n(D),O=n(0),N=n.n(O),Y=n(53),j=n(1),P=(n(564),E.a.Item),I=C.a.Row,A=C.a.Col,H=(0,x.a.config)((r=o=function(e){function t(e){var r;return Object(v.a)(this,t),(r=Object(M.a)(this,Object(w.a)(t).call(this,e))).queryTrackQuery=function(){var c=Object(k.a)(r),e="",d=r.getValue("type");if(1===d){var t=r.getValue("ip");e="v1/cs/listener?ip=".concat(t);var n=window.nownamespace||Object(j.b)("namespace")||"";n&&(e+="&tenant=".concat(n))}else{var a=r.getValue("dataId"),o=r.getValue("group");if(!a||!o)return!1;e="v1/cs/configs/listener?dataId=".concat(a,"&group=").concat(o)}Object(j.c)({url:e,beforeSend:function(){c.openLoading()},success:function(e){if(200===e.collectStatus){var t=[],n=e.lisentersGroupkeyStatus;for(var a in n)if(1===d){var o={},r=a.split("+"),i=Object(_.a)(r,2),s=i[0],l=i[1];o.dataId=s,o.group=l,o.md5=n[a],t.push(o)}else{var u={};u.ip=a,u.md5=n[a],t.push(u)}c.setState({dataSource:t||[],total:t.length||0})}},complete:function(){c.closeLoading()}})},r.changePage=function(e){r.setState({currentPage:e})},r.getQueryLater=function(){setTimeout(function(){r.queryTrackQuery()})},r.state={value:"",visible:!1,loading:!1,total:0,pageSize:10,currentPage:1,dataSource:[]},r.field=new y.a(Object(k.a)(r)),r.group=Object(j.b)("group")||"",r.dataId=Object(j.b)("dataId")||"",r.serverId=Object(j.b)("serverId")||"",r.tenant=Object(j.b)("namespace")||"",r}return Object(S.a)(t,e),Object(b.a)(t,[{key:"componentDidMount",value:function(){this.field.setValue("type",0),this.field.setValue("group",this.group),this.field.setValue("dataId",this.dataId)}},{key:"onSearch",value:function(){}},{key:"onChange",value:function(){}},{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"showMore",value:function(){}},{key:"resetSearch",value:function(){this.field.reset(),this.forceUpdate()}},{key:"renderStatus",value:function(e,t,n){var a=this.props.locale,o=void 0===a?{}:a;return N.a.createElement("div",null,!0===n.pushStatus?N.a.createElement("span",{style:{color:"green"}},o.success):N.a.createElement("span",{style:{color:"red"}},o.failure))}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=this.field,a=n.init,o=n.getValue;this.init=a,this.getValue=o;var r=[{label:t.configuration,value:0},{label:"IP",value:1}];return N.a.createElement("div",{style:{padding:10}},N.a.createElement(s.a,{shape:"flower",style:{position:"relative"},visible:this.state.loading,tip:"Loading...",color:"#333"},N.a.createElement(Y.a,{left:t.listenerQuery,namespaceCallBack:this.getQueryLater}),N.a.createElement(I,{className:"demo-row",style:{marginBottom:10,padding:0}},N.a.createElement(A,{span:"24"},N.a.createElement(E.a,{inline:!0,field:this.field},N.a.createElement(P,{label:"".concat(t.queryDimension,":")},N.a.createElement(m.a,Object.assign({dataSource:r,style:{width:200}},this.init("type")))),N.a.createElement(P,{label:"Data ID:",style:{display:0===this.getValue("type")?"":"none"},required:!0},N.a.createElement(p.a,Object.assign({placeholder:t.pleaseEnterTheDataId,style:{width:200}},this.init("dataId",{rules:[{required:!0,message:t.dataIdCanNotBeEmpty}]})))),N.a.createElement(P,{label:"Group:",style:{display:0===this.getValue("type")?"":"none"},required:!0},N.a.createElement(p.a,Object.assign({placeholder:t.pleaseInputGroup,style:{width:200}},this.init("group",{rules:[{required:!0,message:t.groupCanNotBeEmpty}]})))),N.a.createElement(P,{label:"IP:",style:{display:0===this.getValue("type")?"none":""}},N.a.createElement(p.a,Object.assign({placeholder:t.pleaseInputIp,style:{width:200,boxSize:"border-box"}},this.init("ip")))),N.a.createElement(P,{label:""},N.a.createElement(E.a.Submit,{validate:!0,type:"primary",onClick:this.queryTrackQuery,style:{marginRight:10}},t.query))))),N.a.createElement("div",{style:{position:"relative"}},N.a.createElement("h3",{style:{height:28,lineHeight:"28px",paddingLeft:10,borderLeft:"3px solid #09c",margin:0,marginBottom:10,fontSize:16}},t.queryResultsQuery,N.a.createElement("strong",{style:{fontWeight:"bold"}}," ",this.state.total," "),t.articleMeetRequirementsConfiguration)),N.a.createElement(I,{style:{padding:0}},N.a.createElement(A,{span:"24",style:{padding:0}},1===this.getValue("type")?N.a.createElement(d.a,{dataSource:this.state.dataSource,fixedHeader:!0,maxBodyHeight:500,locale:{empty:t.pubNoData}},N.a.createElement(d.a.Column,{title:"Data ID",dataIndex:"dataId"}),N.a.createElement(d.a.Column,{title:"Group",dataIndex:"group"}),N.a.createElement(d.a.Column,{title:"MD5",dataIndex:"md5"})):N.a.createElement(d.a,{dataSource:this.state.dataSource,fixedHeader:!0,maxBodyHeight:400,locale:{empty:t.pubNoData}},N.a.createElement(d.a.Column,{title:"IP",dataIndex:"ip"}),N.a.createElement(d.a.Column,{title:"MD5",dataIndex:"md5"})))),N.a.createElement("div",{style:{marginTop:10,textAlign:"right"}},N.a.createElement(u.a,{current:this.state.currentPage,total:this.state.total,pageSize:this.state.pageSize,onChange:this.changePage}),",")))}}]),t}(N.a.Component),o.displayName="ListeningToQuery",a=r))||a;t.a=H},function(e,t,n){"use strict";n(41);var a,o,r,i=n(25),s=n.n(i),l=(n(80),n(49)),u=n.n(l),c=(n(79),n(21)),d=n.n(c),f=(n(35),n(9)),p=n.n(f),h=(n(32),n(10)),m=n.n(h),g=(n(44),n(28)),y=n.n(g),_=n(14),v=n(15),b=n(16),M=n(17),w=n(22),k=n(18),S=(n(26),n(8)),T=n.n(S),x=n(0),L=n.n(x),C=n(53),D=n(1),E=(n(563),(0,T.a.config)((r=o=function(e){function a(e){var t;Object(_.a)(this,a),(t=Object(b.a)(this,Object(M.a)(a).call(this,e))).field=new y.a(Object(w.a)(t)),t.appName=Object(D.b)("appName")||"",t.preAppName=t.appName,t.group=Object(D.b)("group")||"",t.preGroup=t.group,t.dataId=Object(D.b)("dataId")||"",t.preDataId=t.dataId,t.serverId=Object(D.b)("serverId")||"",t.state={value:"",visible:!1,total:0,pageSize:10,currentPage:1,dataSource:[],fieldValue:[],showAppName:!1,showgroup:!1,dataId:t.dataId,group:t.group,appName:t.appName,selectValue:[],loading:!1};var n={dataId:t.dataId||"",group:t.preGroup||"",appName:t.appName||"",serverId:t.serverId||""};return Object(D.d)(n),t}return Object(k.a)(a,e),Object(v.a)(a,[{key:"componentDidMount",value:function(){this.field.setValue("group",this.group),this.field.setValue("dataId",this.dataId)}},{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"keyDownSearch",value:function(e){var t=e||window.event;return 13!==(t.keyCode||t.which||t.charCode)||(this.getData(),!1)}},{key:"UNSAFE_componentWillMount",value:function(){window.addEventListener("keydown",this.keyDownSearch.bind(this),!1)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("keydown",this.keyDownSearch.bind(this))}},{key:"onSearch",value:function(){}},{key:"onChange",value:function(){}},{key:"cleanAndGetData",value:function(){0=t.length?{value:void 0,done:!0}:(e=a(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var l=n(118),u=n(117);e.exports=function(s){return function(e,t){var n,a,o=String(u(e)),r=l(t),i=o.length;return r<0||i<=r?s?"":void 0:(n=o.charCodeAt(r))<55296||56319=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),r.Arguments=r.Array,a("keys"),a("values"),a("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){e.exports={default:n(388),__esModule:!0}},function(e,t,n){n(389),n(394),n(395),n(396),e.exports=n(63).Symbol},function(e,t,n){"use strict";var a=n(57),i=n(64),o=n(72),r=n(87),s=n(152),l=n(390).KEY,u=n(89),c=n(120),d=n(125),f=n(96),p=n(74),h=n(126),m=n(127),g=n(391),y=n(392),_=n(88),v=n(71),b=n(73),M=n(116),w=n(93),k=n(124),S=n(393),T=n(154),x=n(70),L=n(94),C=T.f,D=x.f,E=S.f,O=a.Symbol,N=a.JSON,Y=N&&N.stringify,j="prototype",P=p("_hidden"),I=p("toPrimitive"),A={}.propertyIsEnumerable,H=c("symbol-registry"),R=c("symbols"),z=c("op-symbols"),F=Object[j],W="function"==typeof O,V=a.QObject,K=!V||!V[j]||!V[j].findChild,B=o&&u(function(){return 7!=k(D({},"a",{get:function(){return D(this,"a",{value:7}).a}})).a})?function(e,t,n){var a=C(F,t);a&&delete F[t],D(e,t,n),a&&e!==F&&D(F,t,a)}:D,U=function(e){var t=R[e]=k(O[j]);return t._k=e,t},q=W&&"symbol"==typeof O.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof O},G=function(e,t,n){return e===F&&G(z,t,n),_(e),t=M(t,!0),_(n),i(R,t)?(n.enumerable?(i(e,P)&&e[P][t]&&(e[P][t]=!1),n=k(n,{enumerable:w(0,!1)})):(i(e,P)||D(e,P,w(1,{})),e[P][t]=!0),B(e,t,n)):D(e,t,n)},J=function(e,t){_(e);for(var n,a=g(t=b(t)),o=0,r=a.length;oo;)i(R,t=n[o++])||t==P||t==l||a.push(t);return a},Z=function(e){for(var t,n=e===F,a=E(n?z:b(e)),o=[],r=0;a.length>r;)!i(R,t=a[r++])||n&&!i(F,t)||o.push(R[t]);return o};W||(s((O=function(){if(this instanceof O)throw TypeError("Symbol is not a constructor!");var t=f(0te;)p(ee[te++]);for(var ne=L(p.store),ae=0;ne.length>ae;)m(ne[ae++]);r(r.S+r.F*!W,"Symbol",{for:function(e){return i(H,e+="")?H[e]:H[e]=O(e)},keyFor:function(e){if(!q(e))throw TypeError(e+" is not a symbol!");for(var t in H)if(H[t]===e)return t},useSetter:function(){K=!0},useSimple:function(){K=!1}}),r(r.S+r.F*!W,"Object",{create:function(e,t){return void 0===t?k(e):J(k(e),t)},defineProperty:G,defineProperties:J,getOwnPropertyDescriptor:Q,getOwnPropertyNames:X,getOwnPropertySymbols:Z}),N&&r(r.S+r.F*(!W||u(function(){var e=O();return"[null]"!=Y([e])||"{}"!=Y({a:e})||"{}"!=Y(Object(e))})),"JSON",{stringify:function(e){for(var t,n,a=[e],o=1;arguments.length>o;)a.push(arguments[o++]);if(n=t=a[1],(v(t)||void 0!==e)&&!q(e))return y(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!q(t))return t}),a[1]=t,Y.apply(N,a)}}),O[j][I]||n(69)(O[j],I,O[j].valueOf),d(O,"Symbol"),d(Math,"Math",!0),d(a.JSON,"JSON",!0)},function(e,t,n){var a=n(96)("meta"),o=n(71),r=n(64),i=n(70).f,s=0,l=Object.isExtensible||function(){return!0},u=!n(89)(function(){return l(Object.preventExtensions({}))}),c=function(e){i(e,a,{value:{i:"O"+ ++s,w:{}}})},d=e.exports={KEY:a,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!r(e,a)){if(!l(e))return"F";if(!t)return"E";c(e)}return e[a].i},getWeak:function(e,t){if(!r(e,a)){if(!l(e))return!0;if(!t)return!1;c(e)}return e[a].w},onFreeze:function(e){return u&&d.NEED&&l(e)&&!r(e,a)&&c(e),e}}},function(e,t,n){var s=n(94),l=n(122),u=n(97);e.exports=function(e){var t=s(e),n=l.f;if(n)for(var a,o=n(e),r=u.f,i=0;o.length>i;)r.call(e,a=o[i++])&&t.push(a);return t}},function(e,t,n){var a=n(149);e.exports=Array.isArray||function(e){return"Array"==a(e)}},function(e,t,n){var a=n(73),o=n(153).f,r={}.toString,i="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return i&&"[object Window]"==r.call(e)?function(e){try{return o(e)}catch(e){return i.slice()}}(e):o(a(e))}},function(e,t){},function(e,t,n){n(127)("asyncIterator")},function(e,t,n){n(127)("observable")},function(e,t,n){e.exports={default:n(398),__esModule:!0}},function(e,t,n){n(399),e.exports=n(63).Object.setPrototypeOf},function(e,t,n){var a=n(87);a(a.S,"Object",{setPrototypeOf:n(400).set})},function(e,t,o){var n=o(71),a=o(88),r=function(e,t){if(a(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,n,a){try{(a=o(144)(Function.call,o(154).f(Object.prototype,"__proto__").set,2))(e,[]),n=!(e instanceof Array)}catch(e){n=!0}return function(e,t){return r(e,t),n?e.__proto__=t:a(e,t),e}}({},!1):void 0),check:r}},function(e,t,n){e.exports={default:n(402),__esModule:!0}},function(e,t,n){n(403);var a=n(63).Object;e.exports=function(e,t){return a.create(e,t)}},function(e,t,n){var a=n(87);a(a.S,"Object",{create:n(124)})},function(e,t,n){"use strict"; /** @license React v16.8.3 * react.production.min.js *