Browse Source

add video

master
zeus 4 years ago
parent
commit
b7eebb963e
  1. 2
      dist/index.html
  2. 2
      dist/js/app.4c082a6b.js
  3. 1
      dist/js/app.4c082a6b.js.map
  4. 2
      dist/js/app.9d5ec349.js
  5. 1
      dist/js/app.9d5ec349.js.map
  6. 55
      src-local/llo/new.js
  7. 83
      src/components/mynetwork/mytable.vue
  8. 25
      src/store/modules/create_pipelineLLO.js

2
dist/index.html

@ -1 +1 @@
<!DOCTYPE html><html lang=""><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.10423c10.css" rel="preload" as="style"><link href="/css/chunk-vendors.e469b508.css" rel="preload" as="style"><link href="/js/app.9d5ec349.js" rel="preload" as="script"><link href="/js/chunk-vendors.d8d18fe6.js" rel="preload" as="script"><link href="/css/chunk-vendors.e469b508.css" rel="stylesheet"><link href="/css/app.10423c10.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/chunk-vendors.d8d18fe6.js"></script><script src="/js/app.9d5ec349.js"></script></body></html>
<!DOCTYPE html><html lang=""><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.10423c10.css" rel="preload" as="style"><link href="/css/chunk-vendors.e469b508.css" rel="preload" as="style"><link href="/js/app.4c082a6b.js" rel="preload" as="script"><link href="/js/chunk-vendors.d8d18fe6.js" rel="preload" as="script"><link href="/css/chunk-vendors.e469b508.css" rel="stylesheet"><link href="/css/app.10423c10.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/chunk-vendors.d8d18fe6.js"></script><script src="/js/app.4c082a6b.js"></script></body></html>

2
dist/js/app.4c082a6b.js

File diff suppressed because one or more lines are too long

1
dist/js/app.4c082a6b.js.map

File diff suppressed because one or more lines are too long

2
dist/js/app.9d5ec349.js

File diff suppressed because one or more lines are too long

1
dist/js/app.9d5ec349.js.map

File diff suppressed because one or more lines are too long

55
src-local/llo/new.js

@ -1078,6 +1078,61 @@ app.get('/getlogs', (req, res, next) => {
*/
});
app.get('/getshareinfo', (req, res, next) => {
var RES = new Object();
var container = req.query["instance"]
console.log(container)
var showexec = `docker inspect ${container} --format '{"network":"{{ .HostConfig.NetworkMode }}","container":"{{ .Id }}"}' | jq . -s`
exec(showexec, (err, stdout, stderr) => {
if (err) {
console.error(`exec error: ${err}`);
return;
}
if (stdout) {
try {
var string = stdout.toString()
var datajson = JSON.parse(string);
var showexec1 = `docker inspect ${datajson[0].network} --format '{{json .Containers}}' | jq . -s`
exec(showexec1, (err1, stdout1, stderr1) => {
if (err1) {
console.error(`exec error1: ${err1}`);
return;
}
if (stdout1) {
var string1 = stdout1.toString()
var datajson1 = JSON.parse(string1);
var logdatatest = datajson1.length
for(var iii=0; iii < logdatatest; iii++){
for (var prop in datajson1[iii]) {
if(prop == datajson[0].container){
var IP = datajson1[iii][prop]
break;
}
}
}
console.log(datajson1)
RES.error = false
RES.error_msg = "ok"
RES.container = datajson;
RES.network = IP;
res.json(RES)
}
})
} catch (error) {
console.error(`exec error: ${error}`);
}
}else{
var found = 'no'
RES.error = false
RES.error_msg = "ok"
res.json(RES)
}
});
});
app.get('/getnetworks', (req, res, next) => {
var RES = new Object();

83
src/components/mynetwork/mytable.vue

@ -29,7 +29,7 @@
round
type="button"
title="You are connected swarmlab-hybrid"
disabled
@click="onAction('shareinfo')"
>
</button>
</div>
@ -284,6 +284,7 @@ export default {
swarmlabname_git:'',
// run on
hybridshowdata:{},
hybridshowdatashare:{},
issocket:'close',
setFilter: {},
searchFor: {},
@ -302,8 +303,9 @@ export default {
this.hybridshowdata = data
var filterju = `microservice-jupyter`
var grepju = new RegExp(filterju);
if(grepju.test(data.Networks)){
var grepju = new RegExp(filterju);
if(grepju.test(data.Networks) && grepju.test(data.Names)){
this.webinterface = true
this.webinterface_port = data.Ports
console.log(JSON.stringify(this.webinterface_port))
@ -316,7 +318,7 @@ export default {
this.selectedNetworks = []
this.localNetworkoptions = []
this.localNetworkdefault = ''
//console.log(JSON.stringify(this.hybridshowdata))
console.log(JSON.stringify(this.hybridshowdata))
})
})
// from available services socket run here
@ -495,6 +497,77 @@ export default {
//console.log('start ' + JSON.stringify(log))
//console.log('startobj ' + JSON.stringify(obj))
////console.log(this.$socket.client.connect())
}else if(action == 'shareinfo'){
var openuerlju = 'no'
var search = 'microservice-jupyter'
var extenderror = new RegExp(search);
if(extenderror.test(this.hybridshowdata.Names)){
var log = await store.dispatch("pipelineLLO/getjupyterinfo",{
instance:this.hybridshowdata.Names
})
if(log.data.test){
//get token
var splitted = log.data.test.split('?token=');
var jutoken = splitted[1];
//cut from home dir
var splitted1 = jutoken.split(' ');
var jutokenok = splitted1[0];
var juurl = this.webinterface_port.split('->');
// trim it
var juurlok = juurl[0].trim();
//build url
openuerlju = `http://${juurlok}/?token=${jutokenok}`
}
}
var log = await store.dispatch("pipelineLLO/getshareinfo",{
instance:this.hybridshowdata.Names
})
console.log('logs---------- ' + JSON.stringify(this.hybridshowdata))
console.log('logs1---------- ' + JSON.stringify(this.hybridshowdata.Names))
console.log('logsserver---------- ' + JSON.stringify(log.data.container))
console.log('logsserver1---------- ' + JSON.stringify(log.data.network))
this.hybridshowdatashare = log.data.network
var IP = this.hybridshowdatashare.IPv4Address.split('/');
var search1 = '->'
var search3 = ','
var extenderror1 = new RegExp(search1);
var extenderror3 = new RegExp(search3);
var info = ''
// url port einai polla
if(extenderror1.test(this.hybridshowdata.Ports) ){
try {
if(extenderror3.test(this.hybridshowdata.Ports)){
var PORTSport = this.hybridshowdata.Ports.split(',');
for(var iaa = 0; iaa < PORTSport.length; iaa++){
var PORTStmp = PORTSport[iaa].split('->');
var PORTS = PORTSport[iaa].split('/');
if( openuerlju == 'no'){
info += `<h5>URL: ${IP[0]}:${PORTS[0]}</h5>`
}else{
info += `<h5>URL: ${IP[0]}:${PORTS[0]}/?token=${jutokenok}</h5>`
}
}
}else{
var PORTStmp = this.hybridshowdata.Ports.split('->');
var PORTS = PORTStmp[1].split('/');
var info = ''
if( openuerlju == 'no'){
info = `<h5>URL: ${IP[0]}:${PORTS[0]}</h5>`
}else{
info = `<h5>URL: ${IP[0]}:${PORTS[0]}/?token=${jutokenok}</h5>`
}
}
} catch (e) {
}
}
this.$swal({
title: '<strong>Share info</strong>',
type: 'info',
html: info,
showCloseButton: true,
showLoaderOnConfirm: false,
allowOutsideClick: false
})
}else if(action == 'container-logs'){
var log = await store.dispatch("pipelineLLO/getlogs",{
container:this.hybridshowdata.ID
@ -516,8 +589,6 @@ export default {
var juurlok = juurl[0].trim();
//build url
var openuerlju = `http://${juurlok}/?token=${jutokenok}`
//console.log('jupyter '+ JSON.stringify(jutokenok))
//console.log('jupyter '+ JSON.stringify(openuerlju))
var info=`<h5>You can connect to the same contained process multiple times simultaneously, from different sessions.<br>
<br>
<b>Click

25
src/store/modules/create_pipelineLLO.js

@ -398,6 +398,31 @@ export default {
return R;
}
}
},
async getshareinfo({commit,rootGetters}, value) {
try {
var token = value.token
var params = {
instance: value.instance
}
var options = {
params: params,
headers: { 'content-type': 'application/x-www-form-urlencoded',Authorization: `Bearer ${token}` },
};
var sock_server_l = ApiConfig.url_80+'/getshareinfo'
var p = await axios.get(sock_server_l,options);
return p
} catch (e) {
if(e.message == "Request failed with status code 401" || /401/i.test(e.message)){
window.location.href = 'https://api-login.swarmlab.io:8089';
}else{
var R = {
ERROR_str: e,
ERROR: 'yes'
}
return R;
}
}
},
async getnetworks({commit,rootGetters}, value) {
//console.log('value '+JSON.stringify(value))

Loading…
Cancel
Save