Browse Source

console

master
zeus 4 years ago
parent
commit
9f77eface8
  1. 2
      dist/css/app.f156ca1a.css
  2. 2
      dist/css/chunk-vendors.7ca8a1ff.css
  3. 2
      dist/index.html
  4. 2
      dist/js/app.e7f4c8fe.js
  5. 1
      dist/js/app.e7f4c8fe.js.map
  6. 2
      dist/js/app.f56fe913.js
  7. 1
      dist/js/app.f56fe913.js.map
  8. 1
      dist/js/chunk-vendors.8243ef5d.js.map
  9. 34
      dist/js/chunk-vendors.fca5894b.js
  10. 1
      dist/js/chunk-vendors.fca5894b.js.map
  11. 6
      run.yml
  12. 66
      src-local/llo/new.js
  13. 803
      src-local/package-lock.json
  14. 9
      src-local/package.json
  15. 1
      src-local/swarmlab-sec
  16. 12
      src/components/mynetwork.vue
  17. 470
      src/components/mynetwork/AdhocView.vue
  18. 50
      src/components/mynetwork/mytable.vue

2
dist/css/app.e5c9f9a1.css → dist/css/app.f156ca1a.css

File diff suppressed because one or more lines are too long

2
dist/css/chunk-vendors.f194a2fd.css → dist/css/chunk-vendors.7ca8a1ff.css

File diff suppressed because one or more lines are too long

2
dist/index.html

@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vue App</title><link href="/css/app.e5c9f9a1.css" rel="preload" as="style"><link href="/css/chunk-vendors.f194a2fd.css" rel="preload" as="style"><link href="/js/app.f56fe913.js" rel="preload" as="script"><link href="/js/chunk-vendors.8243ef5d.js" rel="preload" as="script"><link href="/css/chunk-vendors.f194a2fd.css" rel="stylesheet"><link href="/css/app.e5c9f9a1.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/chunk-vendors.8243ef5d.js"></script><script src="/js/app.f56fe913.js"></script></body></html> <!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vue App</title><link href="/css/app.f156ca1a.css" rel="preload" as="style"><link href="/css/chunk-vendors.7ca8a1ff.css" rel="preload" as="style"><link href="/js/app.e7f4c8fe.js" rel="preload" as="script"><link href="/js/chunk-vendors.fca5894b.js" rel="preload" as="script"><link href="/css/chunk-vendors.7ca8a1ff.css" rel="stylesheet"><link href="/css/app.f156ca1a.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/chunk-vendors.fca5894b.js"></script><script src="/js/app.e7f4c8fe.js"></script></body></html>

2
dist/js/app.e7f4c8fe.js

File diff suppressed because one or more lines are too long

1
dist/js/app.e7f4c8fe.js.map

File diff suppressed because one or more lines are too long

2
dist/js/app.f56fe913.js

File diff suppressed because one or more lines are too long

1
dist/js/app.f56fe913.js.map

File diff suppressed because one or more lines are too long

1
dist/js/chunk-vendors.8243ef5d.js.map

File diff suppressed because one or more lines are too long

34
dist/js/chunk-vendors.8243ef5d.js → dist/js/chunk-vendors.fca5894b.js

File diff suppressed because one or more lines are too long

1
dist/js/chunk-vendors.fca5894b.js.map

File diff suppressed because one or more lines are too long

6
run.yml

@ -32,13 +32,15 @@ services:
order: stop-first order: stop-first
ports: ports:
- "55543:443" - "55543:443"
- "3000:3000" #- "3000:3000"
networks: networks:
hybrid-net: hybrid-net:
volumes: volumes:
- ${nodepath}/ecosystem.config.js:/home/node/swarmlab-app/ecosystem.config.js - ${nodepath}/ecosystem.config.js:/home/node/swarmlab-app/ecosystem.config.js
- ${nodepath}/dist:/home/node/swarmlab-app/dist - ${nodepath}/dist:/home/node/swarmlab-app/dist
- ${nodepath}/src-local/llo/new.js:/home/node/server/llo/new.js #- ${nodepath}/src-local/llo/new.js:/home/node/server/llo/new.js
- ${nodepath}/src-local/llo:/home/node/server/llo
#- ${nodepath}/hybrid/swarmlab-sec:/home/node/server/hybrid
# proxy # proxy
- ${nodepath}/nginx/swarmlab-stats-proxy-server.conf:/etc/nginx/conf.d/default.conf - ${nodepath}/nginx/swarmlab-stats-proxy-server.conf:/etc/nginx/conf.d/default.conf
- ${nodepath}/keys/swarmlab.crt:/etc/nginx/swarmlab.crt - ${nodepath}/keys/swarmlab.crt:/etc/nginx/swarmlab.crt

66
src-local/llo/new.js

@ -14,12 +14,74 @@ var serverPort = 3000;
var server = https.createServer(options, app); var server = https.createServer(options, app);
var io = require('socket.io')(server); var io = require('socket.io')(server);
const { spawn } = require('child_process')
io.on('connection', function(socket) { io.on('connection', function(socket) {
console.log('new connection'); console.log('new connection');
socket.on('s1', () => { socket.on('start', () => {
//const childstart = spawn('/bin/sh ./swarmlab-sec/hybrid//start.sh');
const start = spawn('/bin/sh ./start.sh', {
stdio: 'pipe',
shell: true,
cwd: './swarmlab-sec/hybrid'
});
start.stdout.on('data', function (data) {
var n = {}
n.data = data.toString()
io.emit('message_out', n);
});
start.stderr.on('data', function (data) {
var n = {}
n.data = data.toString()
io.emit('message_err', n);
});
start.on('close', function (code) {
var n = {}
n.data = code.toString()
io.emit('message_close', n);
});
/*
// Async Iteration available since Node 10
childstart.on('data', (data) => {
var n = {}
n.data = data.toString()
io.emit('message', n);
console.log('stdout from the child: ' + data);
});
*/
console.log('hi from server'); console.log('hi from server');
}); });
//socket.emit('message', 'This is a message from the dark side.');
socket.on('stop', () => {
const stop = spawn('/bin/sh ./stop.sh', {
stdio: 'pipe',
shell: true,
cwd: './swarmlab-sec/hybrid'
});
stop.stdout.on('data', function (data) {
var n = {}
n.data = data.toString()
io.emit('message_out', n);
});
stop.stderr.on('data', function (data) {
var n = {}
n.data = data.toString()
io.emit('message_err', n);
});
stop.on('close', function (code) {
var n = {}
n.data = code.toString()
io.emit('message_close', n);
});
stop.kill('SIGHUP');
});
}); });
server.listen(serverPort, function() { server.listen(serverPort, function() {

803
src-local/package-lock.json

File diff suppressed because it is too large

9
src-local/package.json

@ -8,9 +8,16 @@
}, },
"dependencies": { "dependencies": {
"async": "^3.2.0", "async": "^3.2.0",
"axios": "^0.21.1",
"bufferutil": "^4.0.2",
"chai": "^4.2.0", "chai": "^4.2.0",
"express": "^4.17.1", "express": "^4.17.1",
"helmet": "^4.1.1", "helmet": "^4.1.1",
"url-exist-sync": "^1.0.2" "https": "^1.0.0",
"socket.io": "^3.0.4",
"socket.io-client": "^3.0.4",
"socketio-auth": "^0.1.1",
"url-exist-sync": "^1.0.2",
"utf-8-validate": "^5.0.3"
} }
} }

1
src-local/swarmlab-sec

@ -0,0 +1 @@
Subproject commit 1f7e6b9525bf44cb111d2bd27f3b975fd3b60828

12
src/components/mynetwork.vue

@ -2,12 +2,18 @@
<div> <div>
<div class="row" > <div class="row" >
<div class="col-12 order-first pr-md-1" > <div class="col-7 order-first pr-md-1" >
<br> <br>
<view-network> <view-network>
</view-network> </view-network>
</div> </div>
<div class="col-5 order-first pr-md-1" >
<br>
<adhoc-view>
</adhoc-view>
</div>
</div> </div>
@ -16,9 +22,11 @@
<script> <script>
import {mapState, mapGetters, mapActions} from 'vuex' import {mapState, mapGetters, mapActions} from 'vuex'
import ViewNetwork from "./mynetwork/mytable.vue"; import ViewNetwork from "./mynetwork/mytable.vue";
import AdhocView from "./mynetwork/AdhocView.vue";
export default { export default {
components: { components: {
ViewNetwork ViewNetwork,
AdhocView
}, },
data () { data () {
return { return {

470
src/components/mynetwork/AdhocView.vue

@ -0,0 +1,470 @@
<template>
<div>
<b-row no-gutters w-100 h-100
v-if="showlloedit"
>
<b-col cols="12" sm="12" md="12" >
<b-row >
<b-col cols="4">
<div class="input-group input-group-sm sm-3">
<!--
<select
class="custom-select custom-select-sm "
@change="setKeymap"
v-model="selected">
<option
v-for="option in options"
v-bind:value="option.value">
{{ option.text }}
</option>
</select>
<div class="input-group-append">
<button type="button"
round
class="btn btn-outline-info btn-sm"
v-if="cmOptions.keyMap == 'sublime'"
@click="infoFilter">
i</button>
</div>
-->
</div>
</b-col>
<b-col cols="3">
<div class="input-group input-group-sm sm-3">
<button type="button"
round
disable
class="btn btn-outline-info btn-sm"
v-if="socketonline"
@click="socketconnect"
>
online </button>
<button type="button"
round
class="btn btn-outline-info btn-sm"
v-else
@click="socketconnect"
>
socket disconnected</button>
<button type="button"
round
class="btn btn-outline-info btn-sm"
v-if="socketonline"
@click="hotreload()">
Hot_Reload</button>
</div>
</b-col>
<b-col cols="5" >
<div class="input-group input-group-sm d-flex justify-content-end">
</div>
<div class="input-group input-group-sm d-flex justify-content-end">
<div class="input-group-append">
<button type="button"
round
class="btn btn-outline-warning btn-sm"
v-if="socketonline"
@click="infoHotreload()">
Hot_Reload_HowTo</button>
</div>
<div class="input-group-append">
<button type="button"
round
class="btn btn-outline-warning btn-sm"
v-if="tryConsole"
@click="clear()">
Clear</button>
</div>
<div class="input-group-append">
<button type="button"
round
class="btn btn-outline-info btn-sm"
v-if="cmOptions.keyMap == 'sublime'"
@click="infoFilter">
i</button>
</div>
<!--
<div class="input-group-append">
<button
type="button"
class="btn btn-outline-dark btn-sm"
v-if="tryLLO[active]"
@click="addlloasciisource"
>Create task!</button>
</div>
-->
</div>
</b-col>
</b-row>
<div class="codemirror" >
<codemirror
ref="myCm"
:value="code"
:options="cmOptions"
@cursorActivity="onCmCursorActivity"
@ready="onCmReady"
@focus="onCmFocus"
@input="onCmCodeChange"
></codemirror>
</div>
</b-col>
</b-row>
</div>
</template>
<script>
import {mapState, mapGetters, mapActions,dispatch} from 'vuex'
import Vue from 'vue'
import store from '@/store/index'
import { codemirror } from 'vue-codemirror'
import JSZip from 'jszip';
import FileSaver from 'file-saver';
import 'codemirror/lib/codemirror.css'
import 'codemirror/theme/neat.css'
import 'codemirror/theme/paraiso-light.css'
import'codemirror/addon/selection/active-line.js'
import'codemirror/addon/hint/show-hint.js'
import'codemirror/addon/hint/show-hint.css'
import'codemirror/addon/hint/javascript-hint.js'
import'codemirror/addon/selection/active-line.js'
import'codemirror/addon/scroll/annotatescrollbar.js'
import'codemirror/addon/search/matchesonscrollbar.js'
import'codemirror/addon/search/searchcursor.js'
import'codemirror/addon/search/match-highlighter.js'
import'codemirror/mode/shell/shell.js'
import'codemirror/addon/edit/matchbrackets.js'
import'codemirror/addon/comment/comment.js'
import'codemirror/addon/dialog/dialog.js'
import'codemirror/addon/dialog/dialog.css'
import'codemirror/addon/search/searchcursor.js'
import'codemirror/addon/search/search.js'
import'codemirror/keymap/sublime.js'
import'codemirror/keymap/vim.js'
import'codemirror/addon/fold/foldgutter.css'
import'codemirror/addon/fold/brace-fold.js'
import'codemirror/addon/fold/comment-fold.js'
import'codemirror/addon/fold/foldcode.js'
import'codemirror/addon/fold/foldgutter.js'
import'codemirror/addon/fold/indent-fold.js'
import'codemirror/addon/fold/markdown-fold.js'
import'codemirror/addon/fold/xml-fold.js'
import 'codemirror/lib/codemirror';
import 'codemirror/addon/display/placeholder';
export default {
components: {
codemirror
},
data () {
return {
socketonline:false,
tryConsole:false,
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 : false,
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 : false,
ADOC_html_code:'',
challenge:[],
action:'',
tryLLO:[],
service:'os2',
active:0,
activecount:0,
remove:'',
activeField:'',
bootstrap:false,
firstbootstrap:0,
htmlasciitmp:'',
datafile: 'https://git.swarmlab.io:3000/labs/examples-mpi2/raw/branch/master/0_netstat/data',
datadir: '0_netstat/data',
LearningObject:'',
showllo:true,
showlloedit:true,
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: false,
cmOptions: {
tabSize: 2,
styleActiveLine: true,
lineNumbers: true,
lineSeparator:'\n',
line: true,
foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
highlightSelectionMatches: { showToken: /\w/, annotateScrollbar: true },
styleSelectedText: true,
mode: 'shell',
hintOptions:{
completeSingle: false
},
keyMap: "sublime",
//keyMap: "vim",
matchBrackets: true,
showCursorWhenSelecting: true,
indentUnit:this.ADOC_html_code,
lineWrapping: true,
//theme: 'neat',
theme: 'paraiso-light',
refresh:true,
readOnly: true,
autofocus: false,
extraKeys: { "Ctrl": "autocomplete" }
},
ADOC_html:[]
}
},
methods: {
socketconnect () {
// send to runLLO
this.$root.$emit('SERVER_socket_connect')
},
clear () {
this.tryConsole = false
this.code = ''
},
async getdata () {
var field = this.getinfo
var log = await store.dispatch("pipelineLLO/get_data",{
code:field
})
},
async showactive(index) {
this.topwindow(index)
},
onCmReady(cm) {
cm.on('change', (cm, chg) => {
}),
cm.on('keypress', () => {
cm.showHint({completeSingle:false})
})
},
onCmCursorActivity(a, b, c) {
},
onCmFocus(cm) {
},
onCmCodeChange(newCode) {
this.code = newCode
//this.$root.$emit('socket_add',this.code)
},
handleChange() {
},
setKeymap () {
this.cmOptions.keyMap = this.selected
},
infoFilter() {
var title1='<h3>Playbook Images</h3>'
var winfop='<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>'
var title1=''
var winfo=''
this.$swal({
title: '<strong>Key bindings</strong>',
type: 'info',
html: winfop+title1+winfo,
showCloseButton: true,
showLoaderOnConfirm: false,
allowOutsideClick: false
})
},
async hotreload() {
var field = this.getinfo
var log = await store.dispatch("pipelineLLO/hotreload",{
token:this.token,
swarmlabname:this.swarmlabname
})
},
infoHotreload() {
var html1 = ` <div style="overflow-x: auto;"> <table class="table table-striped table-sm ">
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-left" >Download</td>
<td class="text-left">https://git.swarmlab.io:3000/labs/swarmlab-playground-client/raw/branch/master/hot_reload.sh</td>
</tr>
<tr>
<td class="text-center" colspan="2"><b>and add the proper values</b></td>
</tr>
<tr>
<td class="text-left">token</td>
<td class="text-left">${this.token}</td>
</tr>
<tr>
<td class="text-left">swarmlabname</td>
<td class="text-left">${this.swarmlabname}</td>
</tr>
<tr>
<td class="text-center" colspan="2"><b>OR set the variables before exec</b></td>
</tr>
<tr>
<td class="text-left" colspan="2">export SWARMLAB_token=${this.token}</td>
</tr>
<tr>
<td class="text-left" colspan="2">export SWARMLAB_name=${this.swarmlabname}</td>
</tr>
<tr>
<td class="text-center" colspan="2"><b>Ready!</b<</td>
</tr>
<tr>
<td class="text-left" colspan="2"><i>Execute script every time you run git push</i></td>
</tr>
</tbody>
</table></div>`
this.$swal({
title: '<strong>HowTo</strong>',
type: 'info',
html: html1,
showCloseButton: true,
showLoaderOnConfirm: false,
allowOutsideClick: false
})
}
},
computed: {
codemirror() {
return this.$refs.myCm.codemirror
}
},
mounted() {
// from runLLO
this.$root.$on('SERVER_socket_status', (v) => {
this.$nextTick(function () {
if(v == 'off'){
this.socketonline = false
}else if(v == 'on'){
this.socketonline = true
}
})
})
// from runLLO
this.$root.$on('hybrid_log_in', (log) => {
this.code += log
this.code += "\n"
this.$refs.myCm.codemirror.setCursor(this.$refs.myCm.codemirror.lineCount(), 0);
this.tryConsole=true
})
},
beforeDestroy () {
this.$root.$off('SERVER_socket_status')
this.$root.$off('hybrid_log_in')
},
created () {
this.token = new URL(location.href).searchParams.get('token');
this.swarmlabname = new URL(location.href).searchParams.get('pipelinename');
}
};
</script>
<style>
.CodeMirror {
font-family: monospace;
height: 550px;
}
</style>

50
src/components/mynetwork/mytable.vue

@ -40,7 +40,16 @@
type="button" type="button"
@click="onAction('start')" @click="onAction('start')"
> >
Start local</button> Start</button>
</div>
<div class="input-group-prepend">
<button
class="btn btn-outline-primary"
round
type="button"
@click="onAction('stop')"
>
Stop</button>
</div> </div>
<input type="text" <input type="text"
@ -121,8 +130,8 @@ export default {
} }
}, },
beforeMount () { beforeMount () {
//this.socketopen(); this.socketopen();
//this.socketauthenticate() this.socketauthenticate()
console.log('send') console.log('send')
}, },
mounted() { mounted() {
@ -135,7 +144,7 @@ export default {
var log = store.dispatch("pipelineLLO/settoken",{ var log = store.dispatch("pipelineLLO/settoken",{
token:this.token token:this.token
}) })
//this.socketopen(); this.socketopen();
}, },
beforeDestroy () { beforeDestroy () {
@ -150,7 +159,8 @@ export default {
}, },
methods: { methods: {
async onAction(){ async onAction(action){
if(action == 'start'){
/* /*
var log = await store.dispatch("pipelineLLO/swarmlabstartget",{ var log = await store.dispatch("pipelineLLO/swarmlabstartget",{
token:this.token, token:this.token,
@ -163,22 +173,24 @@ export default {
//this.$socket.client.emit('action', obj); //this.$socket.client.emit('action', obj);
//this.$socket.client.emit('actionstart', obj); //this.$socket.client.emit('actionstart', obj);
this.$socket.client.open(); this.$socket.client.open();
this.$socket.client.emit('s1', 'test'); this.$socket.client.emit('start', 'test');
//console.log('start ' + JSON.stringify(log)) //console.log('start ' + JSON.stringify(log))
console.log('startobj ' + JSON.stringify(obj)) console.log('startobj ' + JSON.stringify(obj))
//console.log(this.$socket.client.connect()) //console.log(this.$socket.client.connect())
}else if(action == 'stop'){
this.$socket.client.emit('stop', 'test');
}
}, },
async socketopen () { async socketopen () {
//this.$socket.client.open(); this.$socket.client.open();
//this.$socket.client.connect(); this.$socket.client.connect();
}, },
async socketauthenticate () { async socketauthenticate () {
this.$socket.client.emit('authenticate', this.token); this.$socket.client.emit('authenticate', this.token);
}, },
async socketreconnect () { async socketreconnect () {
//var log = await this.socketopen() var log = await this.socketopen()
//this.socketauthenticate() this.socketauthenticate()
}, },
async socketclose () { async socketclose () {
this.$socket.client.close(); this.$socket.client.close();
@ -218,8 +230,8 @@ export default {
connect_error(error) { connect_error(error) {
console.log("socket connect_error "+JSON.stringify(error)) console.log("socket connect_error "+JSON.stringify(error))
this.issocket = 'close' this.issocket = 'close'
//this.socketopen() this.socketopen()
//this.socketreconnect() this.socketreconnect()
}, },
/** /**
* *
@ -361,6 +373,18 @@ export default {
}, },
async message(val) { async message(val) {
console.log(" socket message "+JSON.stringify(val)) console.log(" socket message "+JSON.stringify(val))
},
async message_out(val) {
console.log(" socket out "+JSON.stringify(val))
this.$root.$emit('hybrid_log_in',val)
},
async message_err(val) {
console.log(" socket err "+JSON.stringify(val))
this.$root.$emit('hybrid_log_in',val)
},
async message_close(val) {
console.log(" socket close "+JSON.stringify(val))
this.$root.$emit('hybrid_log_in',val)
} }
}, },

Loading…
Cancel
Save