|
@ -1988,9 +1988,16 @@ io.on('connection', function(socket) { |
|
|
n.status = 'error' |
|
|
n.status = 'error' |
|
|
n.exec = 'sharedefault' |
|
|
n.exec = 'sharedefault' |
|
|
n.data = data.toString() |
|
|
n.data = data.toString() |
|
|
n.command = `docker exec ${service.Name} /bin/sh -c "ip address show" <br> <br>
|
|
|
n.command = `docker exec ${service.Name} /bin/sh -c "ifconfig" <br> <br>` |
|
|
docker exec ${service.Name} /bin/sh -c "/sbin/ifconfig " <br> |
|
|
var grepjupyter1 = new RegExp('microservice-jupyter26'); |
|
|
` |
|
|
var grepjupyter301 = new RegExp('microservice-jupyter30'); |
|
|
|
|
|
if(grepjupyter1.test(service.Name)){ |
|
|
|
|
|
n.command += `docker exec ${service.Name} /bin/sh -c "jupyter notebook list"` |
|
|
|
|
|
}else if(grepjupyter301.test(service.Name)){ |
|
|
|
|
|
n.command += `docker exec ${service.Name} /bin/sh -c "jupyter server list"` |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(n.data) |
|
|
console.log(n.data) |
|
|
io.emit('container_info_reserror', n); |
|
|
io.emit('container_info_reserror', n); |
|
|
}); |
|
|
}); |
|
@ -2340,8 +2347,18 @@ services: |
|
|
` |
|
|
` |
|
|
shareinfo.share_dir = `${mypath}/hybrid/connect/${stackid[1]}/volumes_client/${stackid[1]}_${service.volumename}` |
|
|
shareinfo.share_dir = `${mypath}/hybrid/connect/${stackid[1]}/volumes_client/${stackid[1]}_${service.volumename}` |
|
|
try { |
|
|
try { |
|
|
var showexecyml = `${mypath}/hybrid/connect/${stackid[1]}/volumes_client/${stackid[1]}_${service.volumename}.yml` |
|
|
var showexecicreatedir = `./hybrid/connect/${stackid[1]}/volumes_client` |
|
|
fs.writeFileSync(showexecyml, stackid_yaml, { mode: 0o755 }); |
|
|
if (!fs.existsSync(showexecicreatedir)){ |
|
|
|
|
|
fs.mkdirSync(showexecicreatedir, { recursive: true }); |
|
|
|
|
|
var showexecyml = `./hybrid/connect/${stackid[1]}/volumes_client/${stackid[1]}_${service.volumename}.yml` |
|
|
|
|
|
//fs.writeFileSync(showexecyml, stackid_yaml, { mode: 0o755 });
|
|
|
|
|
|
//console.log('create yaml ' + showexecyml)
|
|
|
|
|
|
fs.writeFileSync(showexecyml, stackid_yaml); |
|
|
|
|
|
}else{ |
|
|
|
|
|
var showexecyml = `./hybrid/connect/${stackid[1]}/volumes_client/${stackid[1]}_${service.volumename}.yml` |
|
|
|
|
|
//console.log('create yaml1 ' + showexecyml)
|
|
|
|
|
|
fs.writeFileSync(showexecyml, stackid_yaml); |
|
|
|
|
|
} |
|
|
} catch(err) { |
|
|
} catch(err) { |
|
|
console.error(err); |
|
|
console.error(err); |
|
|
} |
|
|
} |
|
@ -2567,38 +2584,63 @@ services: |
|
|
console.log(JSON.stringify(value)); |
|
|
console.log(JSON.stringify(value)); |
|
|
try { |
|
|
try { |
|
|
service.container = value |
|
|
service.container = value |
|
|
var showexec1 = `docker inspect --format '{{json .Mounts}}' ${service.container}` |
|
|
|
|
|
log1 = spawn(showexec1, { |
|
|
var showmount = `docker exec ${service.container} /bin/sh -c "/usr/local/bin/check_mount"` |
|
|
shell: true, |
|
|
exec(showmount, (err, stdout, stderr) => { |
|
|
cwd: service.Dir, |
|
|
if (err) { |
|
|
detached: false, |
|
|
console.error(`exec error: ${err}`); |
|
|
stdio: 'pipe' |
|
|
return; |
|
|
}); |
|
|
} |
|
|
log1.stdout.on('data', function (data) { |
|
|
if (stdout) { |
|
|
var n = {} |
|
|
var string = stdout.toString() |
|
|
n.status = 'data' |
|
|
string = string.replace(/(\r\n|\n|\r|\t)/g,""); |
|
|
n.exec = 'infomountvolume' |
|
|
if(string == 'yes'){ |
|
|
n.data = data.toString() |
|
|
var found = 'yes'; |
|
|
n.data = JSON.parse(n.data) |
|
|
// mount yes find directory
|
|
|
console.log(JSON.stringify(n.data)); |
|
|
var showexec1 = `docker inspect --format '{{json .Mounts}}' ${service.container}` |
|
|
io.emit('info_nfsvolume_res_resclose', n); |
|
|
log1 = spawn(showexec1, { |
|
|
}); |
|
|
shell: true, |
|
|
log1.stderr.on('data', function (data) { |
|
|
cwd: service.Dir, |
|
|
var n = {} |
|
|
detached: false, |
|
|
n.status = 'error' |
|
|
stdio: 'pipe' |
|
|
n.exec = 'infomountvolume' |
|
|
}); |
|
|
n.data = data.toString() |
|
|
log1.stdout.on('data', function (data) { |
|
|
console.log(JSON.stringify(n.data)); |
|
|
var n = {} |
|
|
io.emit('info_nfsvolume_res_reserror', n); |
|
|
n.status = 'data' |
|
|
}); |
|
|
n.mount = found |
|
|
log1.on('close', function (code) { |
|
|
n.exec = 'infomountvolume' |
|
|
var n = {} |
|
|
n.data = data.toString() |
|
|
n.status = 'error' |
|
|
n.data = JSON.parse(n.data) |
|
|
n.exec = 'infomountvolume' |
|
|
console.log(JSON.stringify(n.data)); |
|
|
n.data = code.toString() |
|
|
io.emit('info_nfsvolume_res_resclose', n); |
|
|
console.log(JSON.stringify(n.data)); |
|
|
}); |
|
|
io.emit('info_nfsvolume_res_resclose', n); |
|
|
log1.stderr.on('data', function (data) { |
|
|
}); |
|
|
var n = {} |
|
|
|
|
|
n.status = 'error' |
|
|
|
|
|
n.exec = 'infomountvolume' |
|
|
|
|
|
n.data = data.toString() |
|
|
|
|
|
console.log(JSON.stringify(n.data)); |
|
|
|
|
|
io.emit('info_nfsvolume_res_reserror', n); |
|
|
|
|
|
}); |
|
|
|
|
|
log1.on('close', function (code) { |
|
|
|
|
|
var n = {} |
|
|
|
|
|
n.status = 'error' |
|
|
|
|
|
n.exec = 'infomountvolume' |
|
|
|
|
|
n.data = code.toString() |
|
|
|
|
|
console.log(JSON.stringify(n.data)); |
|
|
|
|
|
io.emit('info_nfsvolume_res_resclose', n); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
var found = 'no'; |
|
|
|
|
|
var n = {} |
|
|
|
|
|
n.status = 'error' |
|
|
|
|
|
n.exec = 'infomountvolume' |
|
|
|
|
|
n.mount = found |
|
|
|
|
|
io.emit('info_nfsvolume_res_resclose', n); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
} catch (err) { |
|
|
} catch (err) { |
|
|
console.log(err.stack || String(err)); |
|
|
console.log(err.stack || String(err)); |
|
|
} |
|
|
} |
|
|