Description
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.
 
 

1 lines
20 KiB

{"remainingRequest":"/home/lefos/repos/swarmlab-playground-client/node_modules/vue-loader/lib/index.js??vue-loader-options!/home/lefos/repos/swarmlab-playground-client/src/components/doclive/AdhocView.vue?vue&type=style&index=0&lang=css&","dependencies":[{"path":"/home/lefos/repos/swarmlab-playground-client/src/components/doclive/AdhocView.vue","mtime":1615930840866},{"path":"/home/lefos/repos/swarmlab-playground-client/node_modules/css-loader/dist/cjs.js","mtime":499162500000},{"path":"/home/lefos/repos/swarmlab-playground-client/node_modules/vue-loader/lib/loaders/stylePostLoader.js","mtime":499162500000},{"path":"/home/lefos/repos/swarmlab-playground-client/node_modules/postcss-loader/src/index.js","mtime":499162500000},{"path":"/home/lefos/repos/swarmlab-playground-client/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/home/lefos/repos/swarmlab-playground-client/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKLkNvZGVNaXJyb3IgewoKCiAgICBmb250LWZhbWlseTogbW9ub3NwYWNlOwogICAgaGVpZ2h0OiA1NTBweDsKfQoK"},{"version":3,"sources":["AdhocView.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8fA;;;AAGA;AACA;AACA","file":"AdhocView.vue","sourceRoot":"src/components/doclive","sourcesContent":["<template>\n <div>\n\n <b-row no-gutters w-100 h-100 \n v-if=\"showlloedit\"\n >\n <b-col cols=\"12\" sm=\"12\" md=\"12\" >\n\n <b-row >\n <b-col cols=\"4\">\n <div class=\"input-group input-group-sm sm-3\">\n<!--\n <select\n class=\"custom-select custom-select-sm \"\n @change=\"setKeymap\"\n v-model=\"selected\">\n <option \n v-for=\"option in options\" \n v-bind:value=\"option.value\">\n {{ option.text }}\n </option>\n </select>\n <div class=\"input-group-append\">\n <button type=\"button\"\n round\n class=\"btn btn-outline-info btn-sm\"\n v-if=\"cmOptions.keyMap == 'sublime'\"\n @click=\"infoFilter\">\n i</button>\n </div>\n-->\n </div>\n </b-col>\n\n <b-col cols=\"3\">\n <div class=\"input-group input-group-sm sm-3\">\n <button type=\"button\"\n round\n disable\n class=\"btn btn-outline-info btn-sm\"\n v-if=\"socketonline\"\n @click=\"socketconnect\"\n >\n online </button>\n <button type=\"button\"\n round\n class=\"btn btn-outline-info btn-sm\"\n v-else\n @click=\"socketconnect\"\n >\n socket disconnected</button>\n <button type=\"button\"\n round\n class=\"btn btn-outline-info btn-sm\"\n v-if=\"socketonline\"\n @click=\"hotreload()\">\n Hot_Reload</button>\n </div>\n </b-col>\n\n <b-col cols=\"5\" >\n <div class=\"input-group input-group-sm d-flex justify-content-end\">\n </div>\n <div class=\"input-group input-group-sm d-flex justify-content-end\">\n <div class=\"input-group-append\">\n <button type=\"button\"\n round\n class=\"btn btn-outline-warning btn-sm\"\n v-if=\"socketonline\"\n @click=\"infoHotreload()\">\n Hot_Reload_HowTo</button>\n </div>\n <div class=\"input-group-append\">\n <button type=\"button\"\n round\n class=\"btn btn-outline-warning btn-sm\"\n v-if=\"tryConsole\"\n @click=\"clear()\">\n Clear</button>\n </div>\n <div class=\"input-group-append\">\n <button type=\"button\"\n round\n class=\"btn btn-outline-info btn-sm\"\n v-if=\"cmOptions.keyMap == 'sublime'\"\n @click=\"infoFilter\">\n i</button>\n </div>\n<!--\n <div class=\"input-group-append\">\n <button \n type=\"button\"\n class=\"btn btn-outline-dark btn-sm\"\n v-if=\"tryLLO[active]\"\n @click=\"addlloasciisource\"\n >Create task!</button>\n </div>\n-->\n </div>\n </b-col>\n </b-row>\n\n <div class=\"codemirror\" >\n <codemirror\n ref=\"myCm\"\n :value=\"code\"\n :options=\"cmOptions\"\n @cursorActivity=\"onCmCursorActivity\"\n @ready=\"onCmReady\"\n @focus=\"onCmFocus\"\n @input=\"onCmCodeChange\"\n ></codemirror>\n </div>\n </b-col>\n </b-row>\n\n\n\n\t</div>\n</template>\n<script>\nimport {mapState, mapGetters, mapActions,dispatch} from 'vuex'\nimport Vue from 'vue'\nimport store from '@/store/index' \n\n\nimport { codemirror } from 'vue-codemirror'\nimport JSZip from 'jszip';\nimport FileSaver from 'file-saver';\nimport 'codemirror/lib/codemirror.css'\nimport 'codemirror/theme/neat.css'\n import 'codemirror/theme/paraiso-light.css'\nimport'codemirror/addon/selection/active-line.js'\n\nimport'codemirror/addon/hint/show-hint.js'\nimport'codemirror/addon/hint/show-hint.css'\nimport'codemirror/addon/hint/javascript-hint.js'\nimport'codemirror/addon/selection/active-line.js'\nimport'codemirror/addon/scroll/annotatescrollbar.js'\nimport'codemirror/addon/search/matchesonscrollbar.js'\nimport'codemirror/addon/search/searchcursor.js'\nimport'codemirror/addon/search/match-highlighter.js'\n\nimport'codemirror/mode/shell/shell.js'\nimport'codemirror/addon/edit/matchbrackets.js'\nimport'codemirror/addon/comment/comment.js'\nimport'codemirror/addon/dialog/dialog.js'\nimport'codemirror/addon/dialog/dialog.css'\nimport'codemirror/addon/search/searchcursor.js'\nimport'codemirror/addon/search/search.js'\nimport'codemirror/keymap/sublime.js'\nimport'codemirror/keymap/vim.js'\n\nimport'codemirror/addon/fold/foldgutter.css'\nimport'codemirror/addon/fold/brace-fold.js'\nimport'codemirror/addon/fold/comment-fold.js'\nimport'codemirror/addon/fold/foldcode.js'\nimport'codemirror/addon/fold/foldgutter.js'\nimport'codemirror/addon/fold/indent-fold.js'\nimport'codemirror/addon/fold/markdown-fold.js'\nimport'codemirror/addon/fold/xml-fold.js'\nimport 'codemirror/lib/codemirror';\nimport 'codemirror/addon/display/placeholder';\n\nexport default {\n components: {\n\t\t\tcodemirror\n },\n data () {\n return {\n socketonline:false,\n tryConsole:false,\n ssl:{},\n getinfo:'',\n token:'',\n swarmlabname:'',\n\n code: '',\n editchoice: '',\n optionsedit: [\n { text: 'code', value: 'code' },\n { text: 'text', value: 'text' }\n ],\n llodesc:[{\n llo_url : '',\n llo_name : '',\n llo_author : '',\n llo_intro : ''\n }],\n llo:[{\n id : 0,\n rm : false,\n data_info : 'Asciidoc \\n',\n data_code : '#Your source code',\n data_service : '',\n code_datafile : 'url',\n code_name : '',\n code_exec : '',\n code_options : '',\n code_mime : '',\n code_info : '',\n code_code : '',\n code_codeout : '',\n code_codeoutput : 'console',\n points : '',\n challenge_question : '',\n code_challenge_question : '',\n challenge_answer : '',\n challenge_answer_hint : '',\n code_challenge_answer_hint : '',\n challenge_answer_source : '',\n challenge_answer_code_out : '',\n challenge_answer_code : '',\n code_challenge_answer_code : ''\n }],\n\t\t searchLLO: [],\n searchLLOactive : false,\n ADOC_html_code:'',\n challenge:[],\n action:'',\n tryLLO:[],\n service:'os2',\n active:0,\n activecount:0,\n remove:'',\n activeField:'',\n bootstrap:false,\n firstbootstrap:0,\n htmlasciitmp:'',\n datafile: 'https://git.swarmlab.io:3000/labs/examples-mpi2/raw/branch/master/0_netstat/data',\n datadir: '0_netstat/data',\n LearningObject:'',\n showllo:true,\n showlloedit:true,\n \t\tselected: 'sublime',\n options: [\n { text: 'vim', value: 'vim' },\n { text: 'sublime', value: 'sublime' }\n ],\n optionsmime: [\n { text: 'sh', value: 'bash' },\n { text: 'javascript', value: 'javascript' },\n { text: 'python', value: 'python' },\n { text: 'php', value: 'php' },\n { text: 'sql', value: 'sq;' },\n { text: 'xml', value: 'xml' },\n { text: 'c', value: 'c' }\n ],\n pValidate: false,\n cmOptions: {\n tabSize: 2,\n styleActiveLine: true,\n lineNumbers: true,\n lineSeparator:'\\n',\n line: true,\n foldGutter: true,\n gutters: [\"CodeMirror-linenumbers\", \"CodeMirror-foldgutter\"],\n highlightSelectionMatches: { showToken: /\\w/, annotateScrollbar: true },\n styleSelectedText: true,\n mode: 'shell',\n hintOptions:{\n completeSingle: false\n },\n keyMap: \"sublime\",\n //keyMap: \"vim\",\n matchBrackets: true,\n showCursorWhenSelecting: true,\n indentUnit:this.ADOC_html_code,\n lineWrapping: true,\n //theme: 'neat',\n theme: 'paraiso-light',\n refresh:true,\n readOnly: true,\n autofocus: false,\n extraKeys: { \"Ctrl\": \"autocomplete\" }\n },\n ADOC_html:[]\n }\n },\n methods: {\n\n socketconnect () {\n // send to runLLO\n this.$root.$emit('SERVER_socket_connect')\n },\n clear () {\n this.tryConsole = false\n this.code = ''\n },\n async getdata () {\n\n var field = this.getinfo\n var log = await store.dispatch(\"pipelineLLO/get_data\",{\n code:field \n })\n\n },\n\n async showactive(index) {\n this.topwindow(index)\n\t\t},\n onCmReady(cm) {\n cm.on('change', (cm, chg) => {\n }),\n cm.on('keypress', () => {\n cm.showHint({completeSingle:false})\n })\n },\n onCmCursorActivity(a, b, c) {\n },\n onCmFocus(cm) {\n },\n onCmCodeChange(newCode) {\n this.code = newCode\n //this.$root.$emit('socket_add',this.code)\n },\n handleChange() {\n },\n setKeymap () {\n this.cmOptions.keyMap = this.selected\n },\n\t\tinfoFilter() {\n\t\t\t\tvar title1='<h3>Playbook Images</h3>'\n\t\t\t\t\tvar winfop='<table class=\"table table-striped table-sm \">'+\n '<tr><td class=\"text-left\">Shift-Tab</td> <td class=\"text-left\">indentLess</td></tr>'+\n '<tr><td class=\"text-left\">Alt-Q</td> <td class=\"text-left\">wrapLines</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-Up</td> <td class=\"text-left\">scrollLineUp</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-Down</td> <td class=\"text-left\">scrollLineDown</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-L</td> <td class=\"text-left\">selectLine</td></tr>'+\n '<tr><td class=\"text-left\">Esc</td> <td class=\"text-left\">singleSelectionTop</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-Enter</td> <td class=\"text-left\">insertLineAfter</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-D</td> <td class=\"text-left\">selectNextOccurrence</td></tr>'+\n '<tr><td class=\"text-left\">Shift-Ctrl-Space</td> <td class=\"text-left\">selectScope</td></tr>'+\n '<tr><td class=\"text-left\">Shift-Ctrl-M</td> <td class=\"text-left\">selectBetweenBrackets</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-M</td> <td class=\"text-left\">goToBracket</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-K Ctrl-Y</td> <td class=\"text-left\">sublimeYank</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-K Ctrl-C</td> <td class=\"text-left\">showInCenter</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-K Ctrl-G</td> <td class=\"text-left\">clearBookmarks</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-K Ctrl-Backspace</td> <td class=\"text-left\">delLineLeft</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-K Ctrl-0</td> <td class=\"text-left\">unfoldAll</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-K Ctrl-J</td> <td class=\"text-left\">unfoldAll</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-Alt-Up</td> <td class=\"text-left\">addCursorToPrevLine</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-Alt-Down</td> <td class=\"text-left\">addCursorToNextLine</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-F3</td> <td class=\"text-left\">findUnder</td></tr>'+\n '<tr><td class=\"text-left\">Shift-Ctrl-F3</td> <td class=\"text-left\">findUnderPrevious</td></tr>'+\n '<tr><td class=\"text-left\">Shift-Ctrl-[</td> <td class=\"text-left\">fold</td></tr>'+\n '<tr><td class=\"text-left\">Shift-Ctrl-]</td> <td class=\"text-left\">unfold</td></tr>'+\n '<tr><td class=\"text-left\">Ctrl-F</td> <td class=\"text-left\">find</td></tr>'+\n'</table>'\n\t\t\t\t\t\n\t\t\t\t\tvar title1=''\n\t\t\t\t\tvar winfo=''\n\t\t\t\tthis.$swal({\n\t\t\t\t\ttitle: '<strong>Key bindings</strong>',\n\t\t\t\t\ttype: 'info',\n\t\t\t\t\thtml: winfop+title1+winfo,\n\t\t\t\t\tshowCloseButton: true,\n\t\t\t\t\tshowLoaderOnConfirm: false,\n\t\t\t\t\tallowOutsideClick: false\n\t\t\t\t})\n\t\t},\n async hotreload() {\n var field = this.getinfo\n var log = await store.dispatch(\"pipelineLLO/hotreload\",{\n token:this.token,\n swarmlabname:this.swarmlabname \n })\n },\n\t\tinfoHotreload() {\n var html1 = ` <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>`\n\n\n\n\t\t\t\tthis.$swal({\n\t\t\t\t\ttitle: '<strong>HowTo</strong>',\n\t\t\t\t\ttype: 'info',\n\t\t\t\t\thtml: html1,\n\t\t\t\t\tshowCloseButton: true,\n\t\t\t\t\tshowLoaderOnConfirm: false,\n\t\t\t\t\tallowOutsideClick: false\n\t\t\t\t})\n\t\t}\n\n },\n computed: {\n codemirror() {\n return this.$refs.myCm.codemirror\n }\n\n\t},\n\tmounted() {\n // from runLLO\n\t\tthis.$root.$on('SERVER_socket_status', (v) => {\n\t\t\tthis.$nextTick(function () {\n if(v == 'off'){\n this.socketonline = false\n }else if(v == 'on'){\n this.socketonline = true\n }\n\t\t\t})\n\t\t})\n // from runLLO\n\t\tthis.$root.$on('playground_log_in', (path) => {\n\t\t\t//this.$nextTick(function () {\n var restapi = store.getters['pipelineLLO/getrestapi'];\n if(restapi == \"off\"){ // rest off ara socket\n var logtmp = store.getters['pipelineLLO/getlog'];\n }else if(restapi == \"on\"){ // rest on ara read from rest not from socket\n var logtmp = store.getters['pipelineLLO/getmongolog'];\n }\n console.log('logtmp-roi '+ JSON.stringify(logtmp))\n var itemlog = ''\n this.code = ''\n itemlog = logtmp.filter(item1 => item1.tailed_path === path);\n //Vue.set(this.log_path_lenght, item, loglenght);\n console.log('logtmp22 '+ JSON.stringify(itemlog))\n for (let iteml of itemlog) {\n this.code += iteml.message \n + ' '\n + iteml.tailed_path \n + ' '\n + iteml.date \n\n this.code += \"\\n\"\n }\n /* \n for (let itemlog of logtmp) {\n //console.log('logtmp '+ JSON.stringify(itemlog))\n this.code += itemlog.message \n + ' '\n + itemlog.tailed_path \n + ' '\n + itemlog.date \n\n // + itemlog.date.year\n // + ' '\n // + itemlog.date.month \n // + ' '\n // + itemlog.date.day \n // + ' '\n // + itemlog.date.hours \n // + ' '\n // + itemlog.date.seconds \n // + ' '\n // + itemlog.date.milliseconds \n\n this.code += \"\\n\"\n }\n */\n\n //this.code += v\n //this.code += \"\\n\"\n this.$refs.myCm.codemirror.setCursor(this.$refs.myCm.codemirror.lineCount(), 0);\n this.tryConsole=true\n\t\t\t//})\n\t\t})\n\n\t},\n beforeDestroy () {\n\t\tthis.$root.$off('SERVER_socket_status')\n\t\tthis.$root.$off('playground_log_in')\n },\n\n\t\tcreated () {\n this.token = new URL(location.href).searchParams.get('token');\n this.swarmlabname = new URL(location.href).searchParams.get('pipelinename');\n\t\t}\n};\n</script>\n\n<style>\n.CodeMirror {\n\n\n font-family: monospace;\n height: 550px;\n}\n\n</style>\n"]}]}