main.6c188247.chunk.js 15.1 KB
(this.webpackJsonpreactts=this.webpackJsonpreactts||[]).push([[0],{199:function(e,t,a){e.exports=a(376)},204:function(e,t,a){},205:function(e,t,a){},376:function(e,t,a){"use strict";a.r(t);var n=a(0),o=a.n(n),i=a(16),l=a.n(i),r=(a(204),a(205),a(61)),c=a(62),s=a(64),d=a(63),u=a(191),m=a(379),h=a(381),f=a(385),p=a(100),v=a(36),g=a(382),k=a(384),y=a(383),E=a(386),b=a(387),S=a(388),x=a(389),C=a(165),_=a.n(C).a.create({}),w=function(e,t,a){var n={params:{},headers:{}};return t&&(n.params=t),a&&(n.headers=a),_.get(e,n)},O=function(e,t,a,n){var o={params:{},headers:{}};return n&&(o.params=n),a&&(o.headers=a),_.post(e,t,o)},M="http://40.73.59.185:18768",L=function(e,t){return w("".concat(M,"/eureka/apps"),e,t)},j=function(e,t,a){return O("".concat(M,"/api/v1/manage/docking"),e,t,a)},D=function(e,t,a){return O("".concat(M,"/api/v1/manage/docking_start"),e,t,a)},T=function(e,t){return w("".concat(M,"/api/v1/manage/docking_config"),e,t)},I=function(e,t,a){return O("".concat(M,"/api/v1/manage/docking_config"),e,t,a)},H=function(e,t){return w("".concat(M,"/api/v1/manage/docking_list"),e,t)},P=function(e,t,a){return w("".concat(e,"api/v1/dock_today"),t,a)},B=function(e,t,a){return w("".concat(e,"api/v1/dock_detail"),t,a)},R=(m.a.Column,m.a.ColumnGroup,h.a.Dragger,f.a.TextArea),W=p.a.Option,z=function(e){Object(s.a)(a,e);var t=Object(d.a)(a);function a(e){var n;return Object(r.a)(this,a),(n=t.call(this,e)).state={dataSource:[],showRichText:!1,editortContent:"",editorStates:void 0,status:"stop",dockList:[],curedit:""},n.handleClearContent=function(){n.setState({editorState:""})},n.handleGetText=function(){n.setState({showRichText:!0})},n.onEditorChange=function(e){n.setState({editortContent:e})},n.onEditorStateChange=function(e){n.setState({editorState:e})},n}return Object(c.a)(a,[{key:"render",value:function(){var e=this,t=this.state,a=(t.editorStates,t.editortContent,t.dockList),n=t.curedit;return o.a.createElement("div",null,o.a.createElement(v.a,{type:"primary",style:{margin:15},onClick:this.showModal.bind(this)},"\u6dfb\u52a0\u670d\u52a1"),o.a.createElement("div",{style:Y.cardbox},a.map((function(t){var a;return a="stop"==t.status?o.a.createElement(E.a,{key:"ellipsis",onClick:e.startServer.bind(e,t)}):o.a.createElement(b.a,{key:"stop",onClick:e.startServer.bind(e,t)}),o.a.createElement("div",{key:t.id,style:{width:300,margin:"0 10px"}},o.a.createElement(g.a,{title:t.name,bordered:!1,style:{width:300,margin:"10px auto",boxShadow:"3px 3px 6px 2px #888888"},actions:[o.a.createElement(S.a,{key:"edit",onClick:e.editServer.bind(e,t)}),a]},o.a.createElement("p",null,t.describe)))}))),o.a.createElement("div",null,o.a.createElement(A,{ref:"supload"}),o.a.createElement(G,{curedit:n,ref:"editmodal"})))}},{key:"getDockList",value:function(){var e=this;H().then((function(t){e.setState({dockList:t.data})}))}},{key:"editServer",value:function(e){this.refs.editmodal.sershowModal(e)}},{key:"startServer",value:function(e){var t=e.status,a={id:e.id,status:t};a.status="stop"===t?"open":"stop",D(a).then((function(e){200===e.data.ecode&&k.b.success(e.data.enote)}))}},{key:"handleChange",value:function(){}},{key:"showModal",value:function(){this.refs.supload.sershowModal()}},{key:"componentDidMount",value:function(){}},{key:"componentWillMount",value:function(){this.getDockList()}}]),a}(o.a.Component),Y={addbtn:{mrgin:10},cardbox:{flexDirection:"row",display:"flex",margin:"0 10px"}},A=function(e){Object(s.a)(a,e);var t=Object(d.a)(a);function a(e){var n;return Object(r.a)(this,a),(n=t.call(this,e)).state={visible:!1,confirmLoading:!1,name:"",factory:"",prot:"http",data_type:"",describe:"",fileList:[]},n.handleOk=function(){var e=n.state,t=e.fileList,a=e.name,o=e.factory,i=e.prot,l=new FormData;console.log(i),l.append("name",a),l.append("factory",o),l.append("prot",i),t.forEach((function(e){console.log(e),e.name.indexOf(".jar")>-1&&l.append("file_packge",e),e.name.indexOf(".properties")>-1&&l.append("file_config",e)})),j(l,{"Content-Type":"multipart/form-data"},{}).then((function(e){console.log(e)})),n.setState({visible:!1})},n.handleCancel=function(){n.setState({visible:!1})},n}return Object(c.a)(a,[{key:"render",value:function(){var e=this,t=this.state,a=t.visible,n=t.confirmLoading,i=t.name,l=t.factory,r=t.prot,c=(t.data_type,t.describe),s=(t.fileList,{name:"file_packge",multiple:!0,data:{},beforeUpload:function(t){return e.setState((function(e){return{fileList:[].concat(Object(u.a)(e.fileList),[t])}})),!1}});return o.a.createElement("div",null,o.a.createElement(y.a,{title:"\u670d\u52a1\u6587\u4ef6\u4e0a\u4f20",visible:a,width:"40%",onOk:this.handleOk,confirmLoading:n,onCancel:this.handleCancel.bind(this),okText:"\u786e\u5b9a",cancelText:"\u53d6\u6d88"},o.a.createElement(f.a,{placeholder:"\u670d\u52a1\u540d\u79f0",style:{marginBottom:10},value:i,onChange:function(t){var a=t.target.value;e.setState({name:a})}}),o.a.createElement(f.a,{placeholder:"\u670d\u52a1\u5382\u5bb6",style:{marginBottom:10},value:l,onChange:function(t){var a=t.target.value;e.setState({factory:a})}}),o.a.createElement(p.a,{defaultValue:"http",style:{marginBottom:10,width:"100%"},value:r,onChange:function(t){e.setState({prot:t})}},o.a.createElement(W,{value:"http"},"HTTP"),o.a.createElement(W,{value:"webservice"},"WEBSERVICE")),o.a.createElement(R,{style:{marginBottom:10},value:c,onChange:this.onChange,placeholder:"\u63cf\u8ff0",autoSize:{minRows:3,maxRows:5}}),o.a.createElement(h.a,s,o.a.createElement(v.a,null,o.a.createElement(x.a,null)," \u670d\u52a1\u4e0a\u4f20"))))}},{key:"uploadfile",value:function(e){console.log(e)}},{key:"onChange",value:function(){}},{key:"sershowModal",value:function(){this.setState({visible:!0})}}]),a}(o.a.Component),G=function(e){Object(s.a)(a,e);var t=Object(d.a)(a);function a(e){var n;return Object(r.a)(this,a),(n=t.call(this,e)).state={visible:!1,value:"",curData:"",confirmLoading:!1},n.onChange=function(e){var t=e.target.value;n.setState({value:t})},n.handleOk=function(){var e={id:n.state.curData.id,config:n.state.value};I(e).then((function(e){})),n.setState({visible:!1})},n.handleCancel=function(){n.setState({visible:!1})},n}return Object(c.a)(a,[{key:"render",value:function(){var e=this.state,t=e.visible,a=e.confirmLoading,n=e.value;return o.a.createElement("div",null,o.a.createElement(y.a,{title:"\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6",visible:t,width:"40%",onOk:this.handleOk,confirmLoading:a,onCancel:this.handleCancel.bind(this),okText:"\u786e\u5b9a",cancelText:"\u53d6\u6d88"},o.a.createElement(R,{value:n,onChange:this.onChange,placeholder:"Controlled autosize",autoSize:{minRows:3,maxRows:5}})))}},{key:"sershowModal",value:function(e){this.getDockConfig(e),this.setState({visible:!0,curData:e})}},{key:"getDockConfig",value:function(e){var t=this,a={id:e.id};T(a).then((function(e){200==e.data.ecode&&t.setState({value:e.data.config})}))}}]),a}(o.a.Component),U=z,F=a(377),N=a(380),V=a(90),J=a(56),K=a(55),$=a.n(K),q=m.a.Column,Q=(m.a.ColumnGroup,N.a.RangePicker),X=function(e){Object(s.a)(a,e);var t=Object(d.a)(a);function a(e){var n;return Object(r.a)(this,a),(n=t.call(this,e)).state={dataSource:[],timer:[],confirmLoading:!1,send_today_data:0,send_today_success:0,send_today_error:0,last_send_dt:""},n.handleOk=function(){n.setState({ModalText:"The modal will be closed after two seconds",confirmLoading:!0}),n.props.closeModal()},n.handleCancel=function(){console.log("Clicked cancel button"),n.props.closeModal()},n}return Object(c.a)(a,[{key:"initData",value:function(e){this.getalldock(e),this.getDockDetail(e)}},{key:"getalldock",value:function(e){var t=this;console.log(e),P(e.service_url).then((function(e){if(200===e.data.ecode){var a=e.data.data;t.setState({last_send_dt:a.last_send_dt,send_today_success:a.send_today_success,send_today_data:a.send_today_data,send_today_error:a.send_today_error})}}))}},{key:"getDockDetail",value:function(e){var t=this;B(e.service_url,{start_dt:"2020-08-03 00:00:00",end_dt:"2020-08-03 23:59:59",limit:100,offset:0}).then((function(e){if(200===e.data.ecode){var a=e.data.data;t.setState({dataSource:a})}}))}},{key:"render",value:function(){var e=this.state.confirmLoading;return o.a.createElement("div",null,o.a.createElement(y.a,{title:"\u63a5\u6536\u670d\u52a1\u6570\u636e\u8be6\u60c5",visible:this.props.movisible,width:"95%",onOk:this.handleOk,confirmLoading:e,onCancel:this.handleCancel.bind(this),okText:"\u786e\u5b9a",cancelText:"\u53d6\u6d88"},o.a.createElement("div",null,o.a.createElement(V.a,{style:Z.headerbox},o.a.createElement(J.a,{span:6},o.a.createElement("span",{style:Z.label},"\u5f53\u65e5\u7d2f\u8ba1\u53d1\u9001\u6570\u636e"),o.a.createElement("span",{style:Z.info},this.state.send_today_data)),o.a.createElement(J.a,{span:6},o.a.createElement("span",{style:Z.label},"\u5f53\u65e5\u6210\u529f\u6570\u636e"),o.a.createElement("span",{style:Z.info},this.state.send_today_success)),o.a.createElement(J.a,{span:6},o.a.createElement("span",{style:Z.label},"\u5f53\u65e5\u5931\u8d25\u6570\u636e"),o.a.createElement("span",{style:Z.info},this.state.send_today_error)),o.a.createElement(J.a,{span:6},o.a.createElement("span",{style:Z.label},"\u5f53\u65e5\u5931\u8d25\u6570\u636e"),o.a.createElement("span",{style:Z.info},this.state.last_send_dt)))),o.a.createElement("div",{style:{marginBottom:15}},o.a.createElement(Q,{placeholder:["\u5f00\u59cb\u65f6\u95f4","\u7ed3\u675f\u65f6\u95f4"],onChange:this.timerchange.bind(this),showTime:{hideDisabledOptions:!0,defaultValue:[$()("00:00:00","HH:mm:ss"),$()("11:59:59","HH:mm:ss")]},format:"YYYY-MM-DD HH:mm:ss"}),"  ",o.a.createElement(v.a,{type:"primary",style:{marginLeft:15}},"\u67e5\u8be2")),o.a.createElement(m.a,{dataSource:this.state.dataSource.send_data,onChange:this.changePage.bind(this)},o.a.createElement(q,{title:"#",dataIndex:"index",key:"index"}),o.a.createElement(q,{title:"\u6570\u636eID",dataIndex:"name",key:"manufactorName"}),o.a.createElement(q,{title:"\u6570\u636e\u6765\u6e90",width:"400px",dataIndex:"status",key:"dockUrl"}),o.a.createElement(q,{title:"\u6570\u636e\u7c7b\u578b",dataIndex:"runtime",key:"dockProtocol"}),o.a.createElement(q,{title:"\u53d1\u9001\u72b6\u6001",dataIndex:"runtime",key:"dockProtocol"}),o.a.createElement(q,{title:"\u5931\u8d25\u539f\u56e0",dataIndex:"runtime",key:"dockProtocol"}),o.a.createElement(q,{title:"\u53d1\u9001\u65f6\u95f4",dataIndex:"runtime",key:"dockProtocol"}),o.a.createElement(q,{title:"\u5b57\u6bb5\u8be6\u60c5",dataIndex:"runtime",key:"dockProtocol"}))))}},{key:"timerchange",value:function(e,t){this.setState({timer:t})}},{key:"changePage",value:function(e){}},{key:"componentDidMount",value:function(){this.setState({visible:this.props.movisible})}}]),a}(o.a.Component),Z={label:{paddingRight:10,color:"#303030"},info:{fontSize:16},headerbox:{marginBottom:"20px"}},ee=X,te=m.a.Column,ae=(m.a.ColumnGroup,[{path:"/dockingservice",component:function(e){Object(s.a)(a,e);var t=Object(d.a)(a);function a(e){var n;return Object(r.a)(this,a),(n=t.call(this,e)).state={dataSource:[],visible:!1,confirmLoading:!1,curservice:""},n.showModal=function(e){n.setState({visible:!0,curservice:e}),n.refs.detail.initData(e)},n.handleOk=function(){n.setState({ModalText:"The modal will be closed after two seconds",confirmLoading:!0}),setTimeout((function(){n.setState({visible:!1,confirmLoading:!1})}),2e3)},n.handleCancel=function(){console.log("Clicked cancel button"),n.setState({visible:!1})},n}return Object(c.a)(a,[{key:"render",value:function(){var e=this,t=this.state;t.visible,t.confirmLoading;return o.a.createElement("div",{style:{width:"100%"}},o.a.createElement(m.a,{dataSource:this.state.dataSource},o.a.createElement(te,{title:"#",dataIndex:"index",key:"index"}),o.a.createElement(te,{title:"\u63a5\u6536\u5e73\u53f0",dataIndex:"name",key:"manufactorName"}),o.a.createElement(te,{title:"\u8fd0\u884c\u72b6\u6001",width:"400px",dataIndex:"status",key:"dockUrl"}),o.a.createElement(te,{title:"\u542f\u52a8\u65f6\u95f4",dataIndex:"runtime",key:"dockProtocol"}),o.a.createElement(te,{title:"\u67e5\u770b\u8be6\u60c5",key:"Action",render:function(t,a){return o.a.createElement(F.a,{size:"middle"},o.a.createElement("a",{onClick:e.showModal.bind(e,t,a)},"\u67e5\u770b"))}})),";",o.a.createElement(ee,{movisible:this.state.visible,curservice:this.state.curservice,closeModal:function(){return e.closemodal()},ref:"detail"}))}},{key:"closemodal",value:function(){this.setState({visible:!1})}},{key:"setTimer",value:function(e){var t=new Date(e);return t.getFullYear()+"-"+(t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1)+"-"+(t.getDate()<10?"0"+t.getDate():t.getDate())+" "+(t.getHours()<10?"0"+t.getHours():t.getHours())+":"+(t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes())+":"+(t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds())}},{key:"componentWillMount",value:function(){var e=this;console.log(this.props.location.pathname),L().then((function(t){var a=t.data.applications.application,n=[];a.forEach((function(t,a){var o={index:a+1,name:t.name,status:t.instance[0].status,runtime:e.setTimer(t.instance[0].leaseInfo.registrationTimestamp),service_url:t.instance[0].homePageUrl};n.push(o)})),e.setState({dataSource:n})}))}}]),a}(o.a.Component),exact:!0},{path:"/manage",component:U,exact:!0}]),ne=a(126),oe=a(35),ie=a(378),le=a(79),re=a(390),ce=a(391),se=ie.a.Header,de=(ie.a.Footer,ie.a.Sider),ue=ie.a.Content,me=(le.a.SubMenu,function(e){Object(s.a)(a,e);var t=Object(d.a)(a);function a(e){var n;return Object(r.a)(this,a),(n=t.call(this,e)).state={collapsed:!1},n.toggleCollapsed=function(){n.setState({collapsed:!n.state.collapsed})},n}return Object(c.a)(a,[{key:"render",value:function(){var e=this.props;e.name,e.enthusiasmLevel;return n.createElement(ie.a,null,n.createElement(se,{style:{textAlign:"left",color:"#fff",fontSize:"20px",fontWeight:"bold",letterSpacing:"2px"}},"\u661f\u6cb3\u5bf9\u63a5\u5e73\u53f0"),n.createElement("div",null,n.createElement(ne.a,null,n.createElement(ie.a,null,n.createElement(de,{style:{overflow:"auto",height:"100vh"}},n.createElement(le.a,{defaultSelectedKeys:["1"],defaultOpenKeys:["sub1"],mode:"inline",theme:"dark",inlineCollapsed:this.state.collapsed},n.createElement(le.a.Item,{key:"1",icon:n.createElement(re.a,null)},n.createElement(ne.b,{to:"/dockingservice"},n.createElement("span",null,n.createElement("span",null,"\u5bf9\u63a5\u8be6\u60c5")))),n.createElement(le.a.Item,{key:"3",icon:n.createElement(ce.a,null)},n.createElement(ne.b,{to:"/manage"},n.createElement("span",null,n.createElement("span",null,"\u7ba1\u7406\u914d\u7f6e")))))),n.createElement(ue,{style:{overflow:"auto"}},n.createElement("div",null,n.createElement(oe.d,null,ae.map((function(e,t){return n.createElement(oe.b,{path:e.path,key:t,exact:e.exact,component:e.component})})),n.createElement(oe.b,{path:"/",render:function(){return n.createElement(oe.a,{to:ae[0].path})}}))))))))}},{key:"routerWillLeave",value:function(){}},{key:"componentWillMount",value:function(){}}]),a}(n.Component));a(375);var he=function(){return o.a.createElement("div",{className:"App"},o.a.createElement(me,{name:"home"}))};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));l.a.render(o.a.createElement(o.a.StrictMode,null,o.a.createElement(he,null)),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)}))}},[[199,1,2]]]);
//# sourceMappingURL=main.6c188247.chunk.js.map