main.js
17.4 KB
webpackJsonp([7],{177:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=i(r),a=n(10),u=i(a),l=n(70),s=i(l);t.default=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new s.default(function(i,r){u.default.callApi((0,o.default)({url:"/api/"+e+"/"+t},n)).then(function(e){if(!e.hasOwnProperty("api_status"))return i(e);e.api_status?i(e.data):r(e.api_errormsg)})})}}},178:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.APP="edc/app",t.DATA="edc/data",t.Table="ec/dev/table",t.WIDGET="board/widget"},255:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(177),r=function(e){return e&&e.__esModule?e:{default:e}}(i),o=n(178),a=(0,r.default)(o.APP);t.default={getApps:function(){return a("list")},getBoard:function(e){return a("getBoardInfoWithApp",{params:{appid:e}})},getDatas:function(e,t){return a("getDatas",{params:{dataKey:e,current:t},method:"post"})}}},748:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var r=n(10),o=i(r),a=n(9),u=n(0),l=i(u),s=n(797),c=n(17),d=n(11),f=n(798),p=i(f);n(817),window.getLabel=o.default.getLabel;var h={AppList:(0,s.asyncComponent)({resolve:function(){return n.e(4).then(n.bind(null,1262))}}),AppAnalysis:(0,s.asyncComponent)({resolve:function(){return n.e(3).then(n.bind(null,1263))}})},v=function(){return l.default.createElement(a.Provider,p.default,l.default.createElement(d.HashRouter,null,l.default.createElement(d.Route,{name:"home",path:"/",render:function(e){return l.default.createElement(d.Switch,null,l.default.createElement(d.Route,{name:"appList",path:"/app/list",component:h.AppList}),l.default.createElement(d.Route,{name:"appAnalysis",path:"/app/analysis/:id",component:h.AppAnalysis}),l.default.createElement(d.Redirect,{to:"/app/list"}))}})))};(0,c.render)(l.default.createElement(v,null),document.getElementById("root"))},797:function(e,t,n){"use strict";function i(e){return e&&"object"===typeof e&&"default"in e?e.default:e}function r(e){var t,n,i=e.name,r=e.resolve,o=e.autoResolveES2015Default,d=void 0===o||o,v=e.serverMode,b=void 0===v?"resolve":v,m=e.LoadingComponent,g=e.ErrorComponent;if(-1===y.indexOf(b))throw new Error("Invalid serverMode provided to asyncComponent");var C=["node","browser"].indexOf(e.env)>-1?e.env:"undefined"===typeof window?"node":"browser",_={id:null,module:null,error:null,resolver:null,resolving:!1,asyncComponents:null,asyncComponentsAncestor:null},z=function(){return null==_.module&&null==_.error&&!_.resolving&&"undefined"!==typeof window},w=function(e){return d&&null!=e&&("function"===typeof e||"object"===("undefined"===typeof e?"undefined":l(e)))&&e.default?e.default:e},x=function(){if(null==_.resolver){_.resolving=!0;try{_.resolver=Promise.resolve(r())}catch(e){_.resolver=Promise.reject(e)}}return _.resolver};return n=t=function(e){function t(){return s(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return p(t,e),c(t,[{key:"getChildContext",value:function(){return{asyncComponentsAncestor:null==_.asyncComponents?null:{isBoundary:"boundary"===b}}}},{key:"componentWillMount",value:function(){null!=this.context.asyncComponents&&(_.asyncComponents=this.context.asyncComponents,_.asyncComponentsAncestor=this.context.asyncComponentsAncestor,_.id||(_.id=this.context.asyncComponents.getNextId()))}},{key:"bootstrap",value:function(){var e=this,t=function(){return e.resolveModule().then(function(e){return void 0!==e&&void 0})};if("browser"===C){var n=_.asyncComponents,i=n.shouldRehydrate,r=n.getError,o=r(_.id);return o?(_.error=o,!1):!!i(_.id)&&t()}var a=null!=_.asyncComponentsAncestor&&_.asyncComponentsAncestor.isBoundary;return"defer"!==b&&!a&&t()}},{key:"componentDidMount",value:function(){z()&&this.resolveModule()}},{key:"resolveModule",value:function(){var e=this;return x().then(function(e){return null!=_.asyncComponents&&_.asyncComponents.resolved(_.id),_.module=e,_.error=null,_.resolving=!1,e}).catch(function(e){var t=e.message,n=e.stack,i={message:t,stack:n};null!=_.asyncComponents&&_.asyncComponents.failed(_.id,i),_.error=i,_.resolving=!1,g||console.error(i)}).then(function(t){if(!e.unmounted)return e.context.reactAsyncBootstrapperRunning||"browser"!==C||e.forceUpdate(),t})}},{key:"componentWillUnmount",value:function(){this.unmounted=!0}},{key:"render",value:function(){var e=_.module,t=_.error;if(t)return g?a.createElement(g,f({},this.props,{error:t})):null;var n=w(e);return n?a.createElement(n,this.props):m?a.createElement(m,this.props):null}}]),t}(a.Component),t.displayName=i||"AsyncComponent",t.contextTypes={asyncComponentsAncestor:u.shape({isBoundary:u.bool}),asyncComponents:u.shape({getNextId:u.func.isRequired,resolved:u.func.isRequired,shouldRehydrate:u.func.isRequired})},t.childContextTypes={asyncComponentsAncestor:u.shape({isBoundary:u.bool})},n}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=i(o),u=i(n(16)),l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},p=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},h=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t},v=function(){var e=0,t={},n={};return{getNextId:function(){return e+=1},resolved:function(e){t[e]=!0},failed:function(e,t){n[e]=t},getState:function(){return{resolved:Object.keys(t).reduce(function(e,t){return Object.assign(e,d({},t,!0))},{}),errors:n}}}},b=function(e){function t(){return s(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return p(t,e),c(t,[{key:"componentWillMount",value:function(){this.asyncContext=this.props.asyncContext||v(),this.rehydrateState=this.props.rehydrateState}},{key:"getChildContext",value:function(){var e=this;return{asyncComponents:{getNextId:this.asyncContext.getNextId,resolved:this.asyncContext.resolved,failed:this.asyncContext.failed,shouldRehydrate:function(t){var n=e.rehydrateState.resolved[t];return delete e.rehydrateState.resolved[t],n},getError:function(t){return e.rehydrateState.errors&&e.rehydrateState.errors[t]}}}}},{key:"render",value:function(){return a.Children.only(this.props.children)}}]),t}(o.Component);b.propTypes={children:u.node.isRequired,asyncContext:u.shape({getNextId:u.func.isRequired,resolved:u.func.isRequired,failed:u.func.isRequired,getState:u.func.isRequired}),rehydrateState:u.shape({resolved:u.object})},b.defaultProps={asyncContext:void 0,rehydrateState:{resolved:{}}},b.childContextTypes={asyncComponents:u.shape({getNextId:u.func.isRequired,resolved:u.func.isRequired,failed:u.func.isRequired,shouldRehydrate:u.func.isRequired,getError:u.func.isRequired}).isRequired};var y=["resolve","defer","boundary"];t.AsyncComponentProvider=b,t.createAsyncContext=v,t.asyncComponent=r},798:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(799),o=i(r),a=n(811),u=i(a);t.default={appListStore:new o.default,appAnalysisStore:new u.default}},799:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n,i){n&&(0,f.default)(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(i):void 0})}function o(e,t,n,i,r){var o={};return Object.keys(i).forEach(function(e){o[e]=i[e]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce(function(n,i){return i(e,t,n)||n},o),r&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(r):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,u,l,s,c,d=n(20),f=i(d),p=n(1),h=i(p),v=n(12),b=n(255),y=i(b),m=(a=function e(){(0,h.default)(this,e),r(this,"apps",u,this),r(this,"searchText",l,this),r(this,"init",s,this),r(this,"onSearchTextChange",c,this)},u=o(a.prototype,"apps",[v.observable],{enumerable:!0,initializer:function(){return null}}),l=o(a.prototype,"searchText",[v.observable],{enumerable:!0,initializer:function(){return""}}),s=o(a.prototype,"init",[v.action],{enumerable:!0,initializer:function(){var e=this;return function(){y.default.getApps().then(function(t){e.apps=t})}}}),c=o(a.prototype,"onSearchTextChange",[v.action],{enumerable:!0,initializer:function(){var e=this;return function(t){e.searchText=t}}}),a);t.default=m},811:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n,i){n&&(0,h.default)(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(i):void 0})}function o(e,t,n,i,r){var o={};return Object.keys(i).forEach(function(e){o[e]=i[e]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce(function(n,i){return i(e,t,n)||n},o),r&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(r):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,u,l,s,c,d,f,p=n(20),h=i(p),v=n(1),b=i(v),y=n(12),m=n(812),g=i(m),C=n(814),_=i(C),z=(a=function e(){(0,b.default)(this,e),r(this,"selectedIndex",u,this),r(this,"dataStore",l,this),r(this,"chartStore",s,this),r(this,"init",c,this),r(this,"onSelectedIndexChange",d,this),r(this,"initState",f,this)},u=o(a.prototype,"selectedIndex",[y.observable],{enumerable:!0,initializer:function(){return 0}}),l=o(a.prototype,"dataStore",[y.observable],{enumerable:!0,initializer:function(){return new _.default}}),s=o(a.prototype,"chartStore",[y.observable],{enumerable:!0,initializer:function(){return new g.default}}),c=o(a.prototype,"init",[y.action],{enumerable:!0,initializer:function(){var e=this;return function(t){e.dataStore.init(t),e.chartStore.init(t)}}}),d=o(a.prototype,"onSelectedIndexChange",[y.action],{enumerable:!0,initializer:function(){var e=this;return function(t){e.selectedIndex=t}}}),f=o(a.prototype,"initState",[y.action],{enumerable:!0,initializer:function(){var e=this;return function(){e.selectedIndex=0,e.dataStore.initState(),e.chartStore.initState()}}}),a);t.default=z},812:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n,i){n&&(0,h.default)(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(i):void 0})}function o(e,t,n,i,r){var o={};return Object.keys(i).forEach(function(e){o[e]=i[e]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce(function(n,i){return i(e,t,n)||n},o),r&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(r):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,u,l,s,c,d,f,p=n(20),h=i(p),v=n(1),b=i(v),y=n(4),m=i(y),g=n(12),C=n(255),_=i(C),z=n(813),w=i(z),x=(a=function(){function e(){(0,b.default)(this,e),r(this,"widgets",u,this),r(this,"datas",l,this),r(this,"noChart",s,this),r(this,"isInit",c,this),r(this,"init",d,this),r(this,"initState",f,this)}return(0,m.default)(e,[{key:"getWidgets",value:function(e){var t=this;return w.default.list(e).then(function(e){e.forEach(function(e){return t.getData(e.id)}),t.widgets=e,0===e.length&&(t.noChart=!0)})}},{key:"getData",value:function(e){var t=this;w.default.getData(e).then(function(n){var i=(0,g.toJS)(t.datas);i[e]=n,t.datas=i})}}]),e}(),u=o(a.prototype,"widgets",[g.observable],{enumerable:!0,initializer:function(){return[]}}),l=o(a.prototype,"datas",[g.observable],{enumerable:!0,initializer:function(){return{}}}),s=o(a.prototype,"noChart",[g.observable],{enumerable:!0,initializer:function(){return!1}}),c=o(a.prototype,"isInit",[g.observable],{enumerable:!0,initializer:function(){return!1}}),d=o(a.prototype,"init",[g.action],{enumerable:!0,initializer:function(){var e=this;return function(t){e.isInit=!1,_.default.getBoard(t).then(function(t){if(e.isInit=!0,!t)return void(e.noChart=!0);e.getWidgets(t.dashboardId)})}}}),f=o(a.prototype,"initState",[g.action],{enumerable:!0,initializer:function(){var e=this;return function(){e.isInit=!1,e.widgets=[],e.datas={},e.noChart=!1}}}),a);t.default=x},813:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(178),r=n(177),o=function(e){return e&&e.__esModule?e:{default:e}}(r),a=(0,o.default)(i.WIDGET);t.default={list:function(e){return a("list",{params:{board:e}})},getData:function(e){return a("getData",{params:{id:e}})}}},814:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n,i){n&&(0,b.default)(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(i):void 0})}function o(e,t,n,i,r){var o={};return Object.keys(i).forEach(function(e){o[e]=i[e]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce(function(n,i){return i(e,t,n)||n},o),r&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(r):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,u,l,s,c,d,f,p,h,v=n(20),b=i(v),y=n(1),m=i(y),g=n(4),C=i(g),_=n(12),z=n(815),w=i(z),x=n(816),S=i(x),O=n(255),j=i(O),I={table:{loading:!1,columns:[],datas:[]},pagination:null},P=(a=function(){function e(){(0,m.default)(this,e),r(this,"dataKey",u,this),r(this,"table",l,this),r(this,"pagination",s,this),r(this,"noForm",c,this),r(this,"isInit",d,this),r(this,"init",f,this),r(this,"getDatas",p,this),r(this,"initState",h,this)}return(0,C.default)(e,[{key:"getCounts",value:function(){var e=this;S.default.getCounts(this.dataKey).then(function(t){var n=t.count,i={current:1,total:Math.ceil(n/10),onChange:e.onCurrentChange.bind(e)};e.pagination&&(i.current=e.pagination.current),e.pagination=i})}},{key:"onCurrentChange",value:function(e){this.pagination.current=e,this.getDatas(e),this.getCounts()}}]),e}(),u=o(a.prototype,"dataKey",[_.observable],{enumerable:!0,initializer:function(){return null}}),l=o(a.prototype,"table",[_.observable],{enumerable:!0,initializer:function(){return I.table}}),s=o(a.prototype,"pagination",[_.observable],{enumerable:!0,initializer:function(){return I.pagination}}),c=o(a.prototype,"noForm",[_.observable],{enumerable:!0,initializer:function(){return!1}}),d=o(a.prototype,"isInit",[_.observable],{enumerable:!0,initializer:function(){return!1}}),f=o(a.prototype,"init",[_.action],{enumerable:!0,initializer:function(){var e=this;return function(t){e.isInit=!1,w.default.getDataKey(t).then(function(e){return e&&e.datas}).then(function(t){if(e.isInit=!0,!t)return void(e.noForm=!0);e.dataKey=t,e.getDatas(),e.getCounts()})}}}),p=o(a.prototype,"getDatas",[_.action],{enumerable:!0,initializer:function(){var e=this;return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;e.table.loading=!0,j.default.getDatas(e.dataKey,t).then(function(t){var n=t.columns,i=t.datas,r=n.map(function(e){return e.dataIndex}),o={loading:!1};o.columns=n.map(function(e){var t={hide:e.hide,title:e.title,key:e.dataIndex,dataIndex:e.dataIndex};return"creator"===e.dataIndex&&(t.width=140),t}),o.datas=i.map(function(e,t){var n={key:String(t),checked:!1};return r.forEach(function(t){n[t]=e[t+"span"]}),n}),e.table=o})}}}),h=o(a.prototype,"initState",[_.action],{enumerable:!0,initializer:function(){var e=this;return function(){e.dataKey=null,e.noForm=!1,e.table=I.table,e.pagination=I.pagination}}}),a);t.default=P},815:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(177),r=function(e){return e&&e.__esModule?e:{default:e}}(i),o=n(178),a=(0,r.default)(o.DATA);t.default={getDataKey:function(e){return a("getAppData",{params:{appid:e,data:1}})}}},816:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(177),r=function(e){return e&&e.__esModule?e:{default:e}}(i),o=n(178),a=(0,r.default)(o.Table);t.default={getCounts:function(e){return a("counts",{params:{dataKey:e},method:"post"})}}},817:function(e,t,n){"use strict";n(818),n(819),n(820),n(821),n(822),n(823),n(824)},818:function(e,t){},819:function(e,t){},820:function(e,t){},821:function(e,t){},822:function(e,t){},823:function(e,t){},824:function(e,t){}},[748]);
//# sourceMappingURL=main.js.map?v=ad3a5b19