2 lines
18 KiB
JavaScript
2 lines
18 KiB
JavaScript
|
webpackJsonp([1],{0:function(t,e){},1:function(t,e){},2:function(t,e){},"4KX4":function(t,e){},"7QVd":function(t,e){},"8HRc":function(t,e){},NHnr:function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=s("7+uW"),n={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"app"},[e("router-view")],1)},staticRenderFns:[]},r=s("VU/8")({name:"App"},n,!1,null,null,null).exports,a=s("/ocq"),i=s("b3L9"),c=s.n(i),l=(s("7QVd"),{render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"page404"},[e("div",{staticClass:"content"},[e("h1",[this._v("404")]),this._v(" "),e("p",[this._v("Oops! The page you're looking for doesn't exist.")]),this._v(" "),e("router-link",{staticClass:"home-link",attrs:{to:"/"}},[this._v("Go Back Home")])],1)])},staticRenderFns:[]});var u=s("VU/8")({name:"Page404"},l,!1,function(t){s("4KX4")},"data-v-406aa924",null).exports,p=s("fZjL"),_=s.n(p),d=s("pFYg"),g=s.n(d),v=s("XLwt"),m=(s("OWql"),s("XReE"));v.a([m.a]);var f={name:"Dashboard",components:{},watch:{selected_config:{handler:function(t,e){this.config_data=this.convertToTree(this.configs[t]),this.config_data=Array.isArray(this.config_data)?this.config_data:[this.config_data]},immediate:!0}},computed:{},data:function(){return{root_path:"",running_apps:[],show_app_panel:!1,components:{},comments:{},applications:{},configs:{},selected_config:"",config_data:[],curr_status:{},last_status:{},progress:{},logs:[],cpu:{},memory:{},gpus:{}}},mounted:function(){console.log("mounted"),this.get_project_structure(),this.startStatusCheck()},methods:{get_progress_color:function(t){return t<50?"green":t<70?"orange":"red"},convertToTree:function(t){var e=this;return"object"!==(void 0===t?"undefined":g()(t))||null===t?t:_()(t).map(function(s){var o={title:s},n=e.convertToTree(t[s]);return n&&Array.isArray(n)?(o.children=n,o.expand=!0):null!==n&&(o.title=o.title+" : "+String(n)),o})},get_project_structure:function(){var t=this;this.$ajax.postjson("/project/structure",{}).then(function(e){t.root_path=e.root_path,t.components=e.components,t.comments=e.comments,t.applications=e.applications,t.configs=e.configs,t.selected_config=_()(t.configs)[0]})},run_app:function(t){var e=this,s={app_name:t};this.$ajax.postjson("/project/run_app",s).then(function(t){"success"==t.status?(e.$Message.success(t.message),e.startStatusCheck()):e.$Message.error(t.message)})},get_status:function(){var t=this;this.last_status=this.curr_status,this.$ajax.postjson("/project/get_status",{}).then(function(e){t.curr_status=e.curr_status,t.logs=e.logs,t.progress=e.progress,t.running_apps=e.running_apps,t.cpu=e.cpu,t.memory=e.memory,t.gpus=e.gpus,console.log("cpu-----------------",t.cpu),t.logs.length>0&&(t.show_app_panel=!0)})},startStatusCheck:function(){var t=this;this.stopStatusCheck(),this.statusInterval=setInterval(function(){t.get_status()},1e3)},stopStatusCheck:function(){this.statusInterval&&(clearInterval(this.statusInterval),this.statusInterval=null)},isAllProgressFull:function(t,e){var s=this.progress[t][e];return _()(s).every(function(t){return s[t][0]===s[t][1]})}}},h={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticStyle:{padding:"20px"}},[t._m(0),t._v(" "),s("Divider"),t._v(" "),s("Row",{staticStyle:{"margin-top":"20px"}},[s("Col",{attrs:{span:"11"}},[s("Card",{ref:"logContainer",staticStyle:{width:"100%","margin-bottom":"10px"}},[s("p",{staticStyle:{"font-size":"18px","font-weight":"bold",color:"#464c5b"},attrs:{slot:"title"},slot:"title"},[s("Icon",{staticStyle:{color:"#464c5b"},attrs:{type:"ios-list",size:"20"}}),t._v("\n Logs\n ")],1),t._v(" "),s("div",{staticStyle:{"overflow-y":"auto","max-height":"200px"}},t._l(t.logs.slice().reverse(),function(e,o){return s("div",{key:o},[s("Alert",{attrs:{type:e[1],"show-icon":""}},[s("span",{staticStyle:{"font-weight":"bold"}},[t._v("("+t._s(e[0])+") ")]),t._v(t._s(e[2]))])],1)}),0)]),t._v(" "),s("Card",{staticStyle:{width:"100%"}},[s("p",{staticStyle:{"font-size":"18px","font-weigh
|
||
|
//# sourceMappingURL=app.8949624cb924b785d433.js.map
|