You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

2 lines
38 KiB

(function(t){function e(e){for(var s,n,r=e[0],i=e[1],c=e[2],u=0,h=[];u<r.length;u++)n=r[u],Object.prototype.hasOwnProperty.call(a,n)&&a[n]&&h.push(a[n][0]),a[n]=0;for(s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);d&&d(e);while(h.length)h.shift()();return l.push.apply(l,c||[]),o()}function o(){for(var t,e=0;e<l.length;e++){for(var o=l[e],s=!0,r=1;r<o.length;r++){var i=o[r];0!==a[i]&&(s=!1)}s&&(l.splice(e--,1),t=n(n.s=o[0]))}return t}var s={},a={app:0},l=[];function n(e){if(s[e])return s[e].exports;var o=s[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=s,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(o,s,function(e){return t[e]}.bind(null,s));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/";var r=window["webpackJsonp"]=window["webpackJsonp"]||[],i=r.push.bind(r);r.push=e,r=r.slice();for(var c=0;c<r.length;c++)e(r[c]);var d=i;l.push([0,"chunk-vendors"]),o()})({0:function(t,e,o){t.exports=o("56d7")},"034f":function(t,e,o){"use strict";o("85ec")},"0f03":function(t,e,o){"use strict";o("e086")},"56d7":function(t,e,o){"use strict";o.r(e);var s=o("2b0e"),a=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{attrs:{id:"app"}},[o("b-navbar",{staticClass:"navbar-secondary",attrs:{toggleable:"md"}},[o("b-navbar-toggle",{attrs:{target:"nav_collapse"}}),o("b-navbar-brand",{staticClass:"logo simple-text ti-swarmlab text-secondary"},[t._v(" Swarmlab.io Playground ")]),o("b-collapse",{attrs:{"is-nav":"",id:"nav_collapse"}},[o("b-navbar-nav"),o("b-navbar-nav",{staticClass:"ml-auto"},[o("b-nav-item",{attrs:{href:"https://git.swarmlab.io:3000",target:"_swarmlabgit"}},[t._v(" Swarmlab_git ")]),o("b-nav-item",[t._v(" | ")]),o("b-nav-item",{attrs:{href:"https://api-client.swarmlab.io:8088/?token="+t.token,target:"_swarmlab"}},[t._v(" Lab_onDemand ")]),o("b-nav-item",[t._v(" | ")])],1)],1)],1),o("b-row",[o("b-col",{attrs:{cols:"12"}},[o("doc-live",{staticStyle:{"background-color":"#f8f9fa"}})],1)],1),o("b-row",[o("b-col",{attrs:{cols:"12"}},[o("doc-grep",{staticStyle:{"background-color":"#f8f9fa"}})],1)],1)],1)},l=[],n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("div",{directives:[{name:"show",rawName:"v-show",value:1==t.showmenou,expression:"showmenou == 1"}],staticClass:"row"},[o("div",{staticClass:"col-3"},[o("div",{staticClass:"input-group-append"},["0"==t.columnviewdefault?o("button",{staticClass:"ti-layout-sidebar-none btn btn-outline-info btn-sm",attrs:{type:"button",round:""},on:{click:function(e){return t.fullscreen("max")}}},[t._v(" Max-Notebook View ")]):t._e(),"1"==t.columnviewdefault?o("button",{staticClass:"ti-layout-sidebar-right btn btn-outline-info btn-sm",attrs:{type:"button",round:""},on:{click:function(e){return t.fullscreen("min")}}},[t._v(" Min-Notebook View")]):t._e()])]),t._m(0),o("div",{staticClass:"col-3"},[o("div",{staticClass:"input-group-prepend"},["0"==t.columncodedefault?o("button",{staticClass:"ti-layout-sidebar-none btn btn-outline-info btn-sm",staticStyle:{float:"right"},attrs:{type:"button",round:""},on:{click:function(e){return t.fullscreen("codemax")}}},[t._v(" Max-Code View ")]):t._e(),"1"==t.columncodedefault?o("button",{staticClass:"ti-layout-sidebar-left btn btn-outline-info btn-sm",staticStyle:{float:"right"},attrs:{type:"button",round:""},on:{click:function(e){return t.fullscreen("codemin")}}},[t._v(" Min-Code View")]):t._e()])])]),o("div",{staticClass:"row"},[o("div",{class:t.columnview},[o("ad-hoc",{staticStyle:{"background-color":"#f8f9fa"}})],1),o("div",{class:t.columncode},[o("run-llo",{staticStyle:{"background-color":"#f8f9fa"}})],1)])])},r=[function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"col-6"},[o("span")])}],i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[t._m(0),o("div",{staticClass:"row"},[o("div",{staticClass:"col-6"},[o("div",{staticClass:"input-group input-group-sm sm-6"},[o("div",{staticClass:"input-group input-group-sm mb-3"},[t._m(1),o("date-picker",{attrs:{type:"date",autocomplete:"off",format:"YYYY-MM-DD",lang:"en"},model:{value:t.search.datestart,callback:function(e){t.$set(t.search,"datestart",e)},expression:"search.datestart"}})],1)])]),t._v(" "),o("div",{staticClass:"col-6"},[o("div",{staticClass:"input-group input-group-sm sm-6"},[o("div",{staticClass:"input-group input-group-sm mb-3"},[t._m(2),o("date-picker",{attrs:{type:"date",autocomplete:"off",format:"YYYY-MM-DD",lang:"en"},model:{value:t.search.dateend,callback:function(e){t.$set(t.search,"dateend",e)},expression:"search.dateend"}}),o("div",{staticClass:"input-group-append"},[o("button",{staticClass:"btn btn-outline-primary",attrs:{round:"",type:"button"},on:{click:t.setFilter}},[t._v(" Go")])])],1)])])]),t._v(" "),o("div",{staticClass:"row"},[o("div",{staticClass:"col-6"},[o("div",{staticClass:"input-group input-group-sm sm-6"},[o("div",{staticClass:"input-group-prepend"},[o("div",{staticClass:"form-control custom-control custom-switch custom-control-inline"},[o("input",{directives:[{name:"model",rawName:"v-model",value:t.logcheck.error,expression:"logcheck.error"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"log_logerror"},domProps:{checked:Array.isArray(t.logcheck.error)?t._i(t.logcheck.error,null)>-1:t.logcheck.error},on:{change:function(e){var o=t.logcheck.error,s=e.target,a=!!s.checked;if(Array.isArray(o)){var l=null,n=t._i(o,l);s.checked?n<0&&t.$set(t.logcheck,"error",o.concat([l])):n>-1&&t.$set(t.logcheck,"error",o.slice(0,n).concat(o.slice(n+1)))}else t.$set(t.logcheck,"error",a)}}}),o("label",{staticClass:"custom-control-label",attrs:{for:"log_logerror"}},[t._v("Error")])]),o("div",{staticClass:"form-control custom-control custom-switch custom-control-inline"},[o("input",{directives:[{name:"model",rawName:"v-model",value:t.logcheck.output,expression:"logcheck.output"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"log_output","data-size":"large","data-toggle":"toggle"},domProps:{checked:Array.isArray(t.logcheck.output)?t._i(t.logcheck.output,null)>-1:t.logcheck.output},on:{change:function(e){var o=t.logcheck.output,s=e.target,a=!!s.checked;if(Array.isArray(o)){var l=null,n=t._i(o,l);s.checked?n<0&&t.$set(t.logcheck,"output",o.concat([l])):n>-1&&t.$set(t.logcheck,"output",o.slice(0,n).concat(o.slice(n+1)))}else t.$set(t.logcheck,"output",a)}}}),o("label",{staticClass:"custom-control-label",attrs:{for:"log_output"}},[t._v("Output")])]),o("div",{staticClass:"form-control custom-control custom-switch custom-control-inline"},[o("input",{directives:[{name:"model",rawName:"v-model",value:t.logcheck.log,expression:"logcheck.log"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"log_log"},domProps:{checked:Array.isArray(t.logcheck.log)?t._i(t.logcheck.log,null)>-1:t.logcheck.log},on:{change:function(e){var o=t.logcheck.log,s=e.target,a=!!s.checked;if(Array.isArray(o)){var l=null,n=t._i(o,l);s.checked?n<0&&t.$set(t.logcheck,"log",o.concat([l])):n>-1&&t.$set(t.logcheck,"log",o.slice(0,n).concat(o.slice(n+1)))}else t.$set(t.logcheck,"log",a)}}}),o("label",{staticClass:"custom-control-label",attrs:{for:"log_log"}},[t._v("Log")])])])])]),t._v(" "),o("div",{staticClass:"col-5"},[o("div",{staticClass:"input-group input-group-sm sm-5 justify-content-end "},[o("div",{staticClass:"input-group-prepend"},[o("div",{staticClass:"input-group-append"},[o("button",{staticClass:"btn btn-outline-warning",attrs:{round:"",type:"button"},on:{click:t.Clearlog}},[t._v(" Clear")])]),o("div",{staticClass:"input-group-append"},[o("button",{staticClass:"btn btn-outline-primary",attrs:{round:"",type:"button"},on:{click:t.Hotlog}},[t._v(" Hot_log")])])])])]),t._v(" "),o("div",{staticClass:"col-1"})]),t._v(" "),o("div",{staticClass:"row rowlog overflow-auto"},t._l(t.log_path,(function(e){return o("div",{staticClass:"col-12"},[!0===t.logview(e)?o("b-row",{staticClass:"border-bottom"},[o("b-col",{attrs:{cols:"2"}},[o("span",{staticClass:"badge badge-danger badge-pill",staticStyle:{cursor:"pointer"},on:{click:function(e){return t.clearLog()}}},[t._v("Clear")])]),o("b-col",{staticStyle:{cursor:"pointer"},attrs:{cols:"8"},on:{click:function(o){return t.selectPath(e)}}},[t._v(" "+t._s(e)+" ")]),o("b-col",{attrs:{cols:"2"}},[t.log_path_lenght[e]==t.log_path_lenghtstatus[e]?o("span",{staticClass:"badge badge-secondary badge-pill"},[t._v(t._s(t.log_path_lenght[e]))]):o("span",{staticClass:"badge badge-primary badge-pill"},[t._v(t._s(t.log_path_lenght[e]))])])],1):t._e()],1)})),0)])},c=[function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"row"},[o("div",{staticClass:"col-12 d-flex justify-content-center text-center"},[o("h4",{staticClass:"text-info"},[t._v(" Search ")])])])},function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"input-group-prepend"},[o("button",{staticClass:"btn btn-outline-secondary",attrs:{type:"button"}},[t._v("Start date ")])])},function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"input-group-prepend"},[o("button",{staticClass:"btn btn-outline-secondary",attrs:{type:"button"}},[t._v("End date ")])])}],d=o("2f62"),u=o("5f5b"),h=o("bc3a"),p=o.n(h),m={namespaced:!0,state:{token:"",llo:{},log:[],mongolog:[],socketid:"",restapi:"off"},getters:{getrestapi(t,e){return t.restapi},getmongolog(t,e){return t.mongolog},getlog(t,e){return t.log},gettoken(t,e){return t.token},getllosrc(t,e){return t.llo},getsocketid(t,e){return t.socketid}},mutations:{add_log(t,e){t.log.push(e)},setrestapi(t,e){t.restapi=e},set_token(t,e){t.token=e},rm_log(t,e){t.log=t.log.filter(t=>t.tailed_path!==e),console.log("js1 setrm "+JSON.stringify(t.log))},tail_log(t,e){t.log=t.log.filter(t=>t.tailed_path!==e).splice(0,4),console.log("js1 setrmrmrmrmrmrmrmrm "+JSON.stringify(t.log))},setmongolog(t,e){t.mongolog.push(e)},rmmongolog(t,e){t.mongolog=[]},setllo(t,e){t.llo=e},setsocketid(t,e){t.socketid=e}},actions:{RMmongolog({commit:t},e){t("rmmongolog")},addlog({commit:t},e){var o={};o.message=e.log.log.message,o.tailed_path=e.log.log.tailed_path,o.date=e.log.date,t("add_log",o)},setRestapi({commit:t},e){t("setrestapi",e.restapi)},settoken({commit:t},e){t("set_token",e.token)},rmlog({commit:t},e){t("rm_log",e.path)},taillog({commit:t},e){console.log("containerirm "+e),t("tail_log",e.path)},async get_data({commit:t,rootGetters:e},o){try{let t=await p.a.get("https://factory.swarmlab.io:55527/run",{timeout:45e3,params:{code:o.code}});return console.log("paramp "+JSON.stringify(t)),b.dispatch("pipelineLLO/setScriptllo",t),t}catch(a){if("Request failed with status code 401"!=a.message&&!/401/i.test(a.message)){var s={ERROR_str:a,ERROR:"yes"};return s}window.location.href="https://api-login.swarmlab.io:8089"}},async get_log({commit:t,rootGetters:e},o){try{var s=b.getters["pipelineLLO/gettoken"];let t=await p.a.get("https://factory.swarmlab.io:55527/get_log",{timeout:45e3,params:{token:s,start:o.datestart,end:o.dateend,swarmlabname:o.swarmlabname}});return console.log("paramp-------------------------- "+JSON.stringify(o)),b.dispatch("pipelineLLO/set_mongolog",t),t}catch(l){if("Request failed with status code 401"!=l.message&&!/401/i.test(l.message)){var a={ERROR_str:l,ERROR:"yes"};return a}window.location.href="https://api-login.swarmlab.io:8089"}},async hotreload({commit:t,rootGetters:e},o){try{var s=o.token,a={swarmlabname:o.swarmlabname},l={headers:{"content-type":"application/x-www-form-urlencoded",Authorization:"Bearer "+s}},n=await p.a.post("https://api.swarmlab.io/swarmlabrunhotreload",a,l);"invalid_token"==n.error&&(console.log(n),console.log(JSON.stringify(n))),console.log(JSON.stringify(n))}catch(i){if("Request failed with status code 401"!=i.message&&!/401/i.test(i.message)){var r={ERROR_str:i,ERROR:"yes"};return r}window.location.href="https://api-login.swarmlab.io:8089"}},set_mongolog({commit:t},e){for(let s of e.data.data){var o={};o.message=s.message,o.tailed_path=s.tailed_path,o.date=s.time,t("setmongolog",o)}},setScriptllo({commit:t},e){t("setllo",e)},setsocketllo({commit:t},e){t("setsocketid",e)},setScriptCodlogAction({commit:t},e){t("setScriptCodelog",e)}}},g=o("ecee"),f=o("c074"),v=o("f2d1"),_=o("ad3d");o("f9e3"),o("2dd8");s["default"].use(d["a"]),s["default"].use(u["a"]),s["default"].component("font-awesome-icon",_["a"]),g["d"].add(f["d"],f["e"],f["c"],f["b"],f["a"],v["b"],v["c"],v["d"],f["f"],v["a"]),g["b"].watch();var b=new d["a"].Store({modules:{pipelineLLO:m},state:{},getters:{},mutations:{}}),k=(o("c4e3"),o("ec45")),y=(o("411c"),o("1315")),w=(o("21a6"),{components:{DatePicker:k["a"]},data(){return{log_path:[],log_path_lenght:[],log_path_lenghtstatus:[],loglenghttotal:32,search:{datestart:"",dateend:"",log:"",output:"",error:""},logcheck:{log:!0,error:!0,output:!0},selected:[],showlloedit:!0,issocket:"close",socketdata:"",logintoken:"",code:[],logdata:[]}},methods:{Hotlog(){this.Clearlog();var t="off";b.dispatch("pipelineLLO/setRestapi",{restapi:t})},Clearlog(){b.dispatch("pipelineLLO/RMmongolog");this.log_path=[]},logview(t){return!(!this.logcheck.log||!t.endsWith("-log"))||(!(!this.logcheck.error||!t.endsWith("-error"))||(!(!this.logcheck.output||!t.endsWith("-output"))||void 0))},async selectPath(t){console.log("path "+JSON.stringify(t));var e=this.log_path_lenght[t];s["default"].set(this.log_path_lenghtstatus,t,e),this.$root.$emit("playground_log_in",t)},async clearLog(t){console.log("path "+JSON.stringify(t)),s["default"].set(this.log_path_lenght,t,0),s["default"].set(this.log_path_lenghtstatus,t,0);b.dispatch("pipelineLLO/rmlog",{path:t})},async setFilter(){console.log(JSON.stringify(this.search));var t=JSON.stringify(this.search.datestart);t=t.replace(/"/g,"");var e=y["DateTime"].fromISO(t,{zone:"Europe/Athens"}),o=JSON.stringify(this.search.dateend);o=o.replace(/"/g,"");var a=y["DateTime"].fromISO(o,{zone:"Europe/Athens"}),l="on",n=(await b.dispatch("pipelineLLO/setRestapi",{restapi:l}),new URL(location.href).searchParams.get("pipelinename")),r=(await b.dispatch("pipelineLLO/get_log",{datestart:e.toISODate(),dateend:a.toISODate(),swarmlabname:n}),b.getters["pipelineLLO/getmongolog"]);console.log("paramp "+JSON.stringify(r)),this.log_path=[...new Set(r.map(t=>t.tailed_path))];var i="";for(let c of this.log_path)if(i=r.filter(t=>t.tailed_path===c).length,s["default"].set(this.log_path_lenght,c,i),i>this.loglenghttotal)b.dispatch("pipelineLLO/taillog",{path:c})},async resetFilter(){console.log(JSON.stringify(this.logdata))},async socketopen(){this.$socket.client.open()},async socketauthenticate(){var t=b.getters["pipelineLLO/gettoken"];this.$socket.client.emit("authenticate",t)},async socketreconnect(){await this.socketopen();this.socketauthenticate()},async socketclose(){this.$socket.client.close()}},computed:{},beforeMount(){this.socketauthenticate(),console.log("send")},mounted(){this.$root.$on("SERVER_socket_connect",t=>{this.$nextTick((function(){this.socketreconnect()}))})},beforeDestroy(){this.$root.$off("SERVER_socket_socket")},created(){this.socketopen();var t=new URL(location.href).searchParams.get("token");b.dispatch("pipelineLLO/settoken",{token:t})},sockets:{connect(){this.$socket.client.emit("authenticate","logintoken"),this.$socket.client.emit("socket_id_get","socketdatasend"),console.log("socket connected socketdatasend"),this.issocket="open",this.$root.$emit("SERVER_socket_status","on")},error(t){console.log("socket error "+JSON.stringify(t)),this.issocket="close",this.$root.$emit("SERVER_socket_status","off")},connect_error(t){console.log("socket connect_error "+JSON.stringify(t)),this.issocket="close",this.$root.$emit("SERVER_socket_status","off"),this.socketreconnect()},disconnect(t){console.log("socket disconnect "+JSON.stringify(t)),this.issocket="close",this.$root.$emit("SERVER_socket_status","off"),this.socketreconnect()},connect_timeout(t){console.log("socket timeout "+JSON.stringify(t)),this.issocket="close",this.$root.$emit("SERVER_socket_status","off"),this.socketreconnect()},reconnect(t){console.log("socket reconnect attemptNumber "+JSON.stringify(t)),this.$root.$emit("SERVER_socket_status","off"),this.socketreconnect()},reconnect_attempt(t){console.log("socket reconnect_attempt "+JSON.stringify(t)),this.$root.$emit("SERVER_socket_status","off"),this.socketreconnect()},reconnecting(t){console.log("socket reconnecting "+JSON.stringify(t)),this.$root.$emit("SERVER_socket_status","off"),this.socketreconnect()},reconnect_error(t){console.log("socket reconnect_error "+JSON.stringify(t)),this.issocket="close",this.$root.$emit("SERVER_socket_status","off"),this.socketreconnect()},unauthorized(t){console.log("socket unauthorized "+JSON.stringify(t)),this.issocket="close",this.$root.$emit("SERVER_socket_status","off")},socket_id_emit(t){console.log("socket id from server "+JSON.stringify(t)),console.log("socket id from serveri saved "+JSON.stringify(socketsave)),this.issocket="open"},async logdata(t){console.log(" socket from logdata "+JSON.stringify(t));b.dispatch("pipelineLLO/addlog",{log:t});this.$root.$emit("GREP_on_data",t),this.$root.$emit("SERVER_socket_status","on");var e=b.getters["pipelineLLO/getlog"];this.log_path=[...new Set(e.map(t=>t.tailed_path))];var o="";for(let a of this.log_path)if(o=e.filter(t=>t.tailed_path===a).length,s["default"].set(this.log_path_lenght,a,o),o>this.loglenghttotal)b.dispatch("pipelineLLO/taillog",{path:a})},async message(t){console.log(" socket message "+JSON.stringify(t))}}}),C=w,x=(o("0f03"),o("2877")),$=Object(x["a"])(C,i,c,!1,null,null,null),O=$.exports,S=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[t.showlloedit?o("b-row",{attrs:{"no-gutters":"","w-100":"","h-100":""}},[o("b-col",{attrs:{cols:"12",sm:"12",md:"12"}},[o("b-row",[o("b-col",{attrs:{cols:"4"}},[o("div",{staticClass:"input-group input-group-sm sm-3"})]),o("b-col",{attrs:{cols:"3"}},[o("div",{staticClass:"input-group input-group-sm sm-3"},[t.socketonline?o("button",{staticClass:"btn btn-outline-info btn-sm",attrs:{type:"button",round:"",disable:""},on:{click:t.socketconnect}},[t._v(" online ")]):o("button",{staticClass:"btn btn-outline-info btn-sm",attrs:{type:"button",round:""},on:{click:t.socketconnect}},[t._v(" socket disconnected")]),t.socketonline?o("button",{staticClass:"btn btn-outline-info btn-sm",attrs:{type:"button",round:""},on:{click:function(e){return t.hotreload()}}},[t._v(" Hot_Reload")]):t._e()])]),o("b-col",{attrs:{cols:"5"}},[o("div",{staticClass:"input-group input-group-sm d-flex justify-content-end"}),o("div",{staticClass:"input-group input-group-sm d-flex justify-content-end"},[o("div",{staticClass:"input-group-append"},[t.socketonline?o("button",{staticClass:"btn btn-outline-warning btn-sm",attrs:{type:"button",round:""},on:{click:function(e){return t.infoHotreload()}}},[t._v(" Hot_Reload_HowTo")]):t._e()]),o("div",{staticClass:"input-group-append"},[t.tryConsole?o("button",{staticClass:"btn btn-outline-warning btn-sm",attrs:{type:"button",round:""},on:{click:function(e){return t.clear()}}},[t._v(" Clear")]):t._e()]),o("div",{staticClass:"input-group-append"},["sublime"==t.cmOptions.keyMap?o("button",{staticClass:"btn btn-outline-info btn-sm",attrs:{type:"button",round:""},on:{click:t.infoFilter}},[t._v(" i")]):t._e()])])])],1),o("div",{staticClass:"codemirror"},[o("codemirror",{ref:"myCm",attrs:{value:t.code,options:t.cmOptions},on:{cursorActivity:t.onCmCursorActivity,ready:t.onCmReady,focus:t.onCmFocus,input:t.onCmCodeChange}})],1)],1)],1):t._e()],1)},L=[],R=o("8f94"),E=(o("a7be"),o("bbca"),o("281e"),o("31c5"),o("9b74"),o("f6b6"),o("3c98"),o("9c7b"),o("715d"),o("b933"),o("23de"),o("02f0"),o("8c33"),o("7289"),o("2aed"),o("d72f"),o("0b6c"),o("9a48"),o("75f8"),o("697e"),o("aedd"),o("164b"),o("4895"),o("cbc8"),o("8d70"),o("9f09"),o("a2c1"),o("56b3"),o("d7d5"),{components:{codemirror:R["codemirror"]},data(){return{socketonline:!1,tryConsole:!1,ssl:{},getinfo:"",token:"",swarmlabname:"",code:"",editchoice:"",optionsedit:[{text:"code",value:"code"},{text:"text",value:"text"}],llodesc:[{llo_url:"",llo_name:"",llo_author:"",llo_intro:""}],llo:[{id:0,rm:!1,data_info:"Asciidoc \n",data_code:"#Your source code",data_service:"",code_datafile:"url",code_name:"",code_exec:"",code_options:"",code_mime:"",code_info:"",code_code:"",code_codeout:"",code_codeoutput:"console",points:"",challenge_question:"",code_challenge_question:"",challenge_answer:"",challenge_answer_hint:"",code_challenge_answer_hint:"",challenge_answer_source:"",challenge_answer_code_out:"",challenge_answer_code:"",code_challenge_answer_code:""}],searchLLO:[],searchLLOactive:!1,ADOC_html_code:"",challenge:[],action:"",tryLLO:[],service:"os2",active:0,activecount:0,remove:"",activeField:"",bootstrap:!1,firstbootstrap:0,htmlasciitmp:"",datafile:"https://git.swarmlab.io:3000/labs/examples-mpi2/raw/branch/master/0_netstat/data",datadir:"0_netstat/data",LearningObject:"",showllo:!0,showlloedit:!0,selected:"sublime",options:[{text:"vim",value:"vim"},{text:"sublime",value:"sublime"}],optionsmime:[{text:"sh",value:"bash"},{text:"javascript",value:"javascript"},{text:"python",value:"python"},{text:"php",value:"php"},{text:"sql",value:"sq;"},{text:"xml",value:"xml"},{text:"c",value:"c"}],pValidate:!1,cmOptions:{tabSize:2,styleActiveLine:!0,lineNumbers:!0,lineSeparator:"\n",line:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],highlightSelectionMatches:{showToken:/\w/,annotateScrollbar:!0},styleSelectedText:!0,mode:"shell",hintOptions:{completeSingle:!1},keyMap:"sublime",matchBrackets:!0,showCursorWhenSelecting:!0,indentUnit:this.ADOC_html_code,lineWrapping:!0,theme:"paraiso-light",refresh:!0,readOnly:!0,autofocus:!1,extraKeys:{Ctrl:"autocomplete"}},ADOC_html:[]}},methods:{socketconnect(){this.$root.$emit("SERVER_socket_connect")},clear(){this.tryConsole=!1,this.code=""},async getdata(){var t=this.getinfo;await b.dispatch("pipelineLLO/get_data",{code:t})},async showactive(t){this.topwindow(t)},onCmReady(t){t.on("change",(t,e)=>{}),t.on("keypress",()=>{t.showHint({completeSingle:!1})})},onCmCursorActivity(t,e,o){},onCmFocus(t){},onCmCodeChange(t){this.code=t},handleChange(){},setKeymap(){this.cmOptions.keyMap=this.selected},infoFilter(){var t="<h3>Playbook Images</h3>",e='<table class="table table-striped table-sm "><tr><td class="text-left">Shift-Tab</td> <td class="text-left">indentLess</td></tr><tr><td class="text-left">Alt-Q</td> <td class="text-left">wrapLines</td></tr><tr><td class="text-left">Ctrl-Up</td> <td class="text-left">scrollLineUp</td></tr><tr><td class="text-left">Ctrl-Down</td> <td class="text-left">scrollLineDown</td></tr><tr><td class="text-left">Ctrl-L</td> <td class="text-left">selectLine</td></tr><tr><td class="text-left">Esc</td> <td class="text-left">singleSelectionTop</td></tr><tr><td class="text-left">Ctrl-Enter</td> <td class="text-left">insertLineAfter</td></tr><tr><td class="text-left">Ctrl-D</td> <td class="text-left">selectNextOccurrence</td></tr><tr><td class="text-left">Shift-Ctrl-Space</td> <td class="text-left">selectScope</td></tr><tr><td class="text-left">Shift-Ctrl-M</td> <td class="text-left">selectBetweenBrackets</td></tr><tr><td class="text-left">Ctrl-M</td> <td class="text-left">goToBracket</td></tr><tr><td class="text-left">Ctrl-K Ctrl-Y</td> <td class="text-left">sublimeYank</td></tr><tr><td class="text-left">Ctrl-K Ctrl-C</td> <td class="text-left">showInCenter</td></tr><tr><td class="text-left">Ctrl-K Ctrl-G</td> <td class="text-left">clearBookmarks</td></tr><tr><td class="text-left">Ctrl-K Ctrl-Backspace</td> <td class="text-left">delLineLeft</td></tr><tr><td class="text-left">Ctrl-K Ctrl-0</td> <td class="text-left">unfoldAll</td></tr><tr><td class="text-left">Ctrl-K Ctrl-J</td> <td class="text-left">unfoldAll</td></tr><tr><td class="text-left">Ctrl-Alt-Up</td> <td class="text-left">addCursorToPrevLine</td></tr><tr><td class="text-left">Ctrl-Alt-Down</td> <td class="text-left">addCursorToNextLine</td></tr><tr><td class="text-left">Ctrl-F3</td> <td class="text-left">findUnder</td></tr><tr><td class="text-left">Shift-Ctrl-F3</td> <td class="text-left">findUnderPrevious</td></tr><tr><td class="text-left">Shift-Ctrl-[</td> <td class="text-left">fold</td></tr><tr><td class="text-left">Shift-Ctrl-]</td> <td class="text-left">unfold</td></tr><tr><td class="text-left">Ctrl-F</td> <td class="text-left">find</td></tr></table>',o=(t="","");this.$swal({title:"<strong>Key bindings</strong>",type:"info",html:e+t+o,showCloseButton:!0,showLoaderOnConfirm:!1,allowOutsideClick:!1})},async hotreload(){this.getinfo,await b.dispatch("pipelineLLO/hotreload",{token:this.token,swarmlabname:this.swarmlabname})},infoHotreload(){var t=` <div style="overflow-x: auto;"> <table class="table table-striped table-sm ">\n <thead>\n <tr>\n <th></th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td class="text-left" >Download</td>\n <td class="text-left">https://git.swarmlab.io:3000/labs/swarmlab-playground-client/raw/branch/master/hot_reload.sh</td>\n </tr>\n <tr>\n <td class="text-center" colspan="2"><b>and add the proper values</b></td> \n </tr>\n <tr>\n <td class="text-left">token</td> \n <td class="text-left">${this.token}</td>\n </tr>\n <tr>\n <td class="text-left">swarmlabname</td> \n <td class="text-left">${this.swarmlabname}</td>\n </tr>\n <tr>\n <td class="text-center" colspan="2"><b>OR set the variables before exec</b></td> \n </tr>\n <tr>\n <td class="text-left" colspan="2">export SWARMLAB_token=${this.token}</td>\n </tr>\n <tr>\n <td class="text-left" colspan="2">export SWARMLAB_name=${this.swarmlabname}</td>\n </tr>\n <tr>\n <td class="text-center" colspan="2"><b>Ready!</b<</td> \n </tr>\n <tr>\n <td class="text-left" colspan="2"><i>Execute script every time you run git push</i></td>\n </tr>\n</tbody>\n</table></div>`;this.$swal({title:"<strong>HowTo</strong>",type:"info",html:t,showCloseButton:!0,showLoaderOnConfirm:!1,allowOutsideClick:!1})}},computed:{codemirror(){return this.$refs.myCm.codemirror}},mounted(){this.$root.$on("SERVER_socket_status",t=>{this.$nextTick((function(){"off"==t?this.socketonline=!1:"on"==t&&(this.socketonline=!0)}))}),this.$root.$on("playground_log_in",t=>{var e=b.getters["pipelineLLO/getrestapi"];if("off"==e)var o=b.getters["pipelineLLO/getlog"];else if("on"==e)o=b.getters["pipelineLLO/getmongolog"];console.log("logtmp-roi "+JSON.stringify(o));var s="";this.code="",s=o.filter(e=>e.tailed_path===t),console.log("logtmp22 "+JSON.stringify(s));for(let a of s)this.code+=a.message+" "+a.tailed_path+" "+a.date,this.code+="\n";this.$refs.myCm.codemirror.setCursor(this.$refs.myCm.codemirror.lineCount(),0),this.tryConsole=!0})},beforeDestroy(){this.$root.$off("SERVER_socket_status"),this.$root.$off("playground_log_in")},created(){this.token=new URL(location.href).searchParams.get("token"),this.swarmlabname=new URL(location.href).searchParams.get("pipelinename")}}),A=E,N=(o("9767"),Object(x["a"])(A,S,L,!1,null,null,null)),M=N.exports,D={name:"DocLive",props:{},components:{RunLlo:O,AdHoc:M},data(){return{loading:!1,showhistory:0,productIndex:1,showmenou:1,columnviewdefault:0,columncodedefault:0,columnview:"col-7 order-first",columncode:"col-5 order-last",tutorMenou:"student"}},created:function(){},mounted(){this.$root.$on("LLOshowmenounotebooks",()=>{this.showmenou=1}),this.$root.$on("lloshowchallengehistory",(t,e)=>{this.showhistory=1})},beforeDestroy(){this.$root.$off("LLOshowmenounotebooks"),this.$root.$off("lloshowchallengehistory")},methods:{fullscreen(t){"max"==t?(this.columnview="col-11 order-first",this.columncode="col-1 order-last",this.columnviewdefault=1,this.columncodedefault=0,this.$root.$emit("LLOresizemenounotebooks","max"),console.log(this.columnview)):"min"==t?(this.columnview="col-7 order-first",this.columncode="col-5 order-last",this.columnviewdefault=0,this.columncodedefault=1,this.$root.$emit("LLOresizemenounotebooks","min"),console.log(this.columnview)):"codemax"==t?(this.columnview="col-1 order-first",this.columncode="col-11 order-last",this.columnviewdefault=0,this.columncodedefault=1,console.log(this.columnview)):"codemin"==t&&(this.columnview="col-7 order-first",this.columncode="col-5 order-last",this.columnviewdefault=1,this.columncodedefault=0,this.$root.$emit("LLOresizemenounotebooks","min"),console.log(this.columnview))},async onAction(t){this.tutorMenou="tutor"}}},P=D,j=Object(x["a"])(P,n,r,!1,null,"8e77a300",null),J=j.exports,T=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("div",{staticClass:"row"},[o("div",{class:t.columnview},[o("ad-grep",{staticStyle:{"background-color":"#f8f9fa"}})],1),o("div",{class:t.columncode},[o("run-grep",{staticStyle:{"background-color":"#f8f9fa"}})],1)])])},V=[],G=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"runGrep"},[o("div",{staticClass:"row"},[o("div",{staticClass:"col-12"},[o("div",{staticClass:"input-group mb-2"},[t._m(0),o("input",{directives:[{name:"model",rawName:"v-model",value:t.search.regex,expression:"search.regex"}],staticClass:"form-control",attrs:{type:"text",placeholder:"regex"},domProps:{value:t.search.regex},on:{input:function(e){e.target.composing||t.$set(t.search,"regex",e.target.value)}}}),o("div",{staticClass:"input-group-append"},[o("div",{staticClass:"input-group-text"},[t._v("/")]),o("div",{staticClass:"form-control custom-switch"},[o("input",{directives:[{name:"model",rawName:"v-model",value:t.search.case,expression:"search.case"}],staticClass:"custom-control-input",attrs:{id:"customSwitch1",type:"checkbox"},domProps:{checked:Array.isArray(t.search.case)?t._i(t.search.case,null)>-1:t.search.case},on:{change:function(e){var o=t.search.case,s=e.target,a=!!s.checked;if(Array.isArray(o)){var l=null,n=t._i(o,l);s.checked?n<0&&t.$set(t.search,"case",o.concat([l])):n>-1&&t.$set(t.search,"case",o.slice(0,n).concat(o.slice(n+1)))}else t.$set(t.search,"case",a)}}}),o("label",{staticClass:"custom-control-label",attrs:{for:"customSwitch1"}},[t._v("Ignore case")])])])])])]),t._v(" "),o("div",{staticClass:"row"},[o("div",{staticClass:"col-9"},[o("div",{staticClass:"input-group mb-2"},[t._m(1),o("input",{directives:[{name:"model",rawName:"v-model",value:t.search.log,expression:"search.log"}],staticClass:"form-control",attrs:{type:"text",placeholder:"file"},domProps:{value:t.search.log},on:{input:function(e){e.target.composing||t.$set(t.search,"log",e.target.value)}}}),o("input",{directives:[{name:"model",rawName:"v-model",value:t.search.desc,expression:"search.desc"}],staticClass:"form-control",attrs:{type:"text",placeholder:"desc"},domProps:{value:t.search.desc},on:{input:function(e){e.target.composing||t.$set(t.search,"desc",e.target.value)}}})])]),t._v(" "),o("div",{staticClass:"col-3"},[o("button",{staticClass:"btn btn-outline-secondary",attrs:{round:"",type:"button"},on:{click:t.setregex}},[t._v(" Search ")])])]),t._v(" "),o("div",{staticClass:"row"},[o("div",{staticClass:"col-12 viewGrep"},[o("table",{staticClass:"table table-hover"},[t._m(2),t._l(t.log,(function(e){return o("tbody",[o("tr",[o("td",[o("span",{staticClass:"badge badge-danger badge-pill",staticStyle:{cursor:"pointer"},on:{click:function(o){return t.removeregex(e.id)}}},[t._v("Remove")])]),o("td",{staticStyle:{cursor:"pointer"}},[t._v(t._s(e.log))]),o("td",{staticStyle:{cursor:"pointer"}},[t._v(t._s(e.regex))]),o("td",{staticStyle:{cursor:"pointer"}},[t._v(t._s(e.case))]),o("td",{staticStyle:{cursor:"pointer"}},[t._v(t._s(e.desc))])])])}))],2)])])])},z=[function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"input-group-prepend"},[o("div",{staticClass:"input-group-text"},[t._v("/")])])},function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"input-group-prepend"},[o("div",{staticClass:"input-group-text"},[t._v("Log")])])},function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("thead",[o("tr",[o("th",{attrs:{scope:"col"}},[t._v("Action")]),o("th",{attrs:{scope:"col"}},[t._v("Log")]),o("th",{attrs:{scope:"col"}},[t._v("Regex")]),o("th",{attrs:{scope:"col"}},[t._v("IC")]),o("th",{attrs:{scope:"col"}},[t._v("Desc")])])])}],F={components:{},data(){return{search:{log:"",regex:"",desc:"",case:!0},obj:1,log:[]}},methods:{removeregex(t){let e=this.log.map(t=>t.id).indexOf(t);this.log.splice(e,1)},setregex(){var t={};t.id=this.obj++,t.log=this.search.log,t.regex=this.search.regex,t.case=this.search.case,t.desc=this.search.desc,this.log.push(t)}},mounted(){this.$root.$on("GREP_on_data",t=>{this.$nextTick((function(){var e=this.log.filter(e=>e.log===t.log.tailed_path),o="",s=!1;if(s=!(!Array.isArray(e)||!e.length),s){var a=t.log.message;o+="";for(let s of e){if(s.case)var l=new RegExp(s.regex,"i");else l=new RegExp(s.regex);l.test(a)?(o+=a+" "+t.log.tailed_path,o+="\n",this.$root.$emit("GREP_view_data",o)):console.log("Not found")}}}))})},beforeDestroy(){this.$root.$off("GREP_on_data")}},U=F,B=(o("61e9"),Object(x["a"])(U,G,z,!1,null,null,null)),H=B.exports,I=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[t.showlloedit?o("b-row",{attrs:{"no-gutters":"","w-100":"","h-100":""}},[o("b-col",{attrs:{cols:"12",sm:"12",md:"12"}},[t.tryConsole?t._e():o("hr"),o("div",{staticClass:"input-group input-group-sm d-flex justify-content-end"},[o("div",{staticClass:"input-group-append"},[t.tryConsole?o("button",{staticClass:"btn btn-outline-warning btn-sm",attrs:{type:"button",round:""},on:{click:function(e){return t.clear()}}},[t._v(" Clear")]):t._e()])]),o("div",{staticClass:"CodeMirrorGrep"},[o("codemirror",{ref:"myCm",attrs:{value:t.code,options:t.cmOptions},on:{cursorActivity:t.onCmCursorActivity,ready:t.onCmReady,focus:t.onCmFocus,input:t.onCmCodeChange}})],1)])],1):t._e()],1)},K=[],Y={components:{codemirror:R["codemirror"]},data(){return{tryConsole:!1,getinfo:"",code:"",optionsedit:[{text:"code",value:"code"},{text:"text",value:"text"}],searchLLO:[],searchLLOactive:!1,showllo:!0,showlloedit:!0,selected:"sublime",options:[{text:"vim",value:"vim"},{text:"sublime",value:"sublime"}],optionsmime:[{text:"sh",value:"bash"},{text:"javascript",value:"javascript"},{text:"python",value:"python"},{text:"php",value:"php"},{text:"sql",value:"sq;"},{text:"xml",value:"xml"},{text:"c",value:"c"}],pValidate:!1,cmOptions:{tabSize:2,styleActiveLine:!0,lineNumbers:!0,lineSeparator:"\n",line:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],highlightSelectionMatches:{showToken:/\w/,annotateScrollbar:!0},styleSelectedText:!0,mode:"shell",hintOptions:{completeSingle:!1},keyMap:"sublime",matchBrackets:!0,showCursorWhenSelecting:!0,indentUnit:this.ADOC_html_code,lineWrapping:!0,theme:"paraiso-light",refresh:!0,readOnly:!0,autofocus:!1,extraKeys:{Ctrl:"autocomplete"}},ADOC_html_code:""}},methods:{socketconnect(){},clear(){this.tryConsole=!1,this.code=""},async getdata(){},async showactive(t){this.topwindow(t)},onCmReady(t){t.on("change",(t,e)=>{}),t.on("keypress",()=>{t.showHint({completeSingle:!1})})},onCmCursorActivity(t,e,o){},onCmFocus(t){},onCmCodeChange(t){this.code=t},handleChange(){},setKeymap(){this.cmOptions.keyMap=this.selected}},computed:{codemirror(){return this.$refs.myCm.codemirror}},mounted(){this.$root.$on("GREP_view_data",t=>{this.$nextTick((function(){this.code+=t,this.tryConsole=!0}))}),this.$refs.myCm.codemirror.setSize(null,"350")},beforeDestroy(){this.$root.$off("GREP_view_data")},created(){}},q=Y,W=Object(x["a"])(q,I,K,!1,null,null,null),Q=W.exports,X={name:"DocGrep",props:{},components:{RunGrep:H,AdGrep:Q},data(){return{loading:!1,showhistory:0,productIndex:1,showmenou:1,columnviewdefault:0,columncodedefault:0,columnview:"col-7 order-first",columncode:"col-5 order-last",tutorMenou:"student"}},created:function(){},mounted(){this.$root.$on("LLOshowmenounotebooks",()=>{this.showmenou=1}),this.$root.$on("lloshowchallengehistory",(t,e)=>{this.showhistory=1})},beforeDestroy(){this.$root.$off("LLOshowmenounotebooks"),this.$root.$off("lloshowchallengehistory")},methods:{fullscreen(t){"max"==t?(this.columnview="col-11 order-first",this.columncode="col-1 order-last",this.columnviewdefault=1,this.columncodedefault=0,this.$root.$emit("LLOresizemenounotebooks","max"),console.log(this.columnview)):"min"==t?(this.columnview="col-7 order-first",this.columncode="col-5 order-last",this.columnviewdefault=0,this.columncodedefault=1,this.$root.$emit("LLOresizemenounotebooks","min"),console.log(this.columnview)):"codemax"==t?(this.columnview="col-1 order-first",this.columncode="col-11 order-last",this.columnviewdefault=0,this.columncodedefault=1,console.log(this.columnview)):"codemin"==t&&(this.columnview="col-7 order-first",this.columncode="col-5 order-last",this.columnviewdefault=1,this.columncodedefault=0,this.$root.$emit("LLOresizemenounotebooks","min"),console.log(this.columnview))},async onAction(t){this.tutorMenou="tutor"}}},Z=X,tt=Object(x["a"])(Z,T,V,!1,null,"bbfc2d24",null),et=tt.exports,ot=(o("e454"),{name:"app",components:{DocLive:J,DocGrep:et},data(){return{show:!0,token:"",SwarmabAsciiLabTemplate:""}},mounted(){},created(){var t=window.location.href,e=new URL(t);this.token=e.searchParams.get("token"),console.log("token "+this.token)},methods:{saveDocLive(){this.$root.$emit("asciilive_save","save")},async connect_to_iot(t){"mesh"==t&&(this.SwarmabAsciiLabTemplate={iot5:{id:5,name:"auto5",img:"rinse.png",Servicios:[{model:"Sentra",doors:4},{model:"Maxima",doors:4},{model:"Skyline",doors:2}]}})}}}),st=ot,at=(o("034f"),Object(x["a"])(st,a,l,!1,null,null,null)),lt=at.exports,nt=o("5886"),rt=o("f87c"),it=o("8e27"),ct=o.n(it);s["default"].use(nt["default"]);const dt=ct()("https://factory.swarmlab.io:55527",{autoConnect:!1,reconnection:!0,reconnectionDelay:500,maxReconnectionAttempts:1/0,pingInterval:25e3,pingTimeout:6e4,transports:["websocket","polling"],secure:!0,rejectUnauthorized:!1});s["default"].use(rt["a"],dt),s["default"].use(u["b"]),s["default"].config.productionTip=!1,new s["default"]({el:"#app",store:b,render:t=>t(lt)})},"61e9":function(t,e,o){"use strict";o("ad34")},"85ec":function(t,e,o){},9767:function(t,e,o){"use strict";o("e1be")},ad34:function(t,e,o){},e086:function(t,e,o){},e1be:function(t,e,o){},e454:function(t,e,o){}});
//# sourceMappingURL=app.b3a7cf99.js.map