Browse Source

update dist

master
zeus 4 years ago
parent
commit
e7781d22be
  1. 8
      client/css/app.ea5082e6.css
  2. 10
      client/css/chunk-vendors.d0de25b8.css
  3. BIN
      client/favicon.ico
  4. BIN
      client/fonts/themify.2c454669.eot
  5. BIN
      client/fonts/themify.a1ecc3b8.woff
  6. BIN
      client/fonts/themify.e23a7dca.ttf
  7. BIN
      client/img/docker.7b56657d.png
  8. BIN
      client/img/hybrid-1.852eef88.png
  9. BIN
      client/img/loading.f4404720.gif
  10. BIN
      client/img/penguinfledgling2.d4cb3ed7.png
  11. 362
      client/img/themify.9c8e96ec.svg
  12. BIN
      client/img/warning.f9cebb9b.png
  13. 1
      client/index.html
  14. 2
      client/js/app.d91a6d39.js
  15. 1
      client/js/app.d91a6d39.js.map
  16. 110
      client/js/chunk-vendors.1ae3a34a.js
  17. 1
      client/js/chunk-vendors.1ae3a34a.js.map
  18. 246
      llo/connect-new.js

8
client/css/app.ea5082e6.css

File diff suppressed because one or more lines are too long

10
client/css/chunk-vendors.d0de25b8.css

File diff suppressed because one or more lines are too long

BIN
client/favicon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

BIN
client/fonts/themify.2c454669.eot

Binary file not shown.

BIN
client/fonts/themify.a1ecc3b8.woff

Binary file not shown.

BIN
client/fonts/themify.e23a7dca.ttf

Binary file not shown.

BIN
client/img/docker.7b56657d.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

BIN
client/img/hybrid-1.852eef88.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

BIN
client/img/loading.f4404720.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

BIN
client/img/penguinfledgling2.d4cb3ed7.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

362
client/img/themify.9c8e96ec.svg

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 229 KiB

BIN
client/img/warning.f9cebb9b.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

1
client/index.html

@ -1 +0,0 @@
<!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.ea5082e6.css" rel="preload" as="style"><link href="/css/chunk-vendors.d0de25b8.css" rel="preload" as="style"><link href="/js/app.d91a6d39.js" rel="preload" as="script"><link href="/js/chunk-vendors.1ae3a34a.js" rel="preload" as="script"><link href="/css/chunk-vendors.d0de25b8.css" rel="stylesheet"><link href="/css/app.ea5082e6.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/chunk-vendors.1ae3a34a.js"></script><script src="/js/app.d91a6d39.js"></script></body></html>

2
client/js/app.d91a6d39.js

File diff suppressed because one or more lines are too long

1
client/js/app.d91a6d39.js.map

File diff suppressed because one or more lines are too long

110
client/js/chunk-vendors.1ae3a34a.js

File diff suppressed because one or more lines are too long

1
client/js/chunk-vendors.1ae3a34a.js.map

File diff suppressed because one or more lines are too long

246
llo/connect-new.js

@ -123,16 +123,6 @@ const servertest = apptest.listen(0, () => {
RES.data = err RES.data = err
return RES return RES
}else{ }else{
fs.mkdir(`./hybrid/connect/${res.bootstrapstackid}/scripts/1`, { recursive: true }, (err) => {
if (err){
return err
}
})
fs.mkdir(`./hybrid/connect/${res.bootstrapstackid}/scripts/5`, { recursive: true }, (err) => {
if (err){
return err
}
})
var endpointfpath = `${res.serverip}:${res.endpoint}` var endpointfpath = `${res.serverip}:${res.endpoint}`
var peerconfig =` var peerconfig =`
@ -258,7 +248,7 @@ export NODE_PATH=$(npm root --quiet -g)
const myExec = ` const myExec = `
docker exec -it swarmlabwg-${res.bootstrapstackid} /bin/bash -c "ip link set ${DEV_NAME} down; ip link del ${DEV_NAME}" docker exec swarmlabwg-${res.bootstrapstackid} /bin/bash -c "ip link set ${DEV_NAME} down; ip link del ${DEV_NAME}"
sleep 1 sleep 1
docker stop swarmlabwg-${res.bootstrapstackid}; docker container rm swarmlabwg-${res.bootstrapstackid} docker stop swarmlabwg-${res.bootstrapstackid}; docker container rm swarmlabwg-${res.bootstrapstackid}
sleep 1 sleep 1
@ -304,7 +294,7 @@ node /usr/local/bin/venus-stats.js --insert=yes --port=${mongoserver.mongo_port}
fs.chmodSync(`./hybrid/connect/${res.bootstrapstackid}/scripts/1/logs`, 0o755); fs.chmodSync(`./hybrid/connect/${res.bootstrapstackid}/scripts/1/logs`, 0o755);
const myExec1 = ` const myExec1 = `
docker exec -it swarmlabwg-${res.bootstrapstackid} /bin/bash -c "ip link set ${DEV_NAME} down; ip link del ${DEV_NAME}" docker exec swarmlabwg-${res.bootstrapstackid} /bin/bash -c "ip link set ${DEV_NAME} down; ip link del ${DEV_NAME}"
sleep 1 sleep 1
docker stop swarmlabwg-${res.bootstrapstackid}; docker container rm swarmlabwg-${res.bootstrapstackid} docker stop swarmlabwg-${res.bootstrapstackid}; docker container rm swarmlabwg-${res.bootstrapstackid}
sleep 1 sleep 1
@ -340,8 +330,10 @@ console.log(RES.dev_name)
// ***************************************** // *****************************************
// *** save wg config file wg0.conf // *** save wg config file wg0.conf
// ***************************************** // *****************************************
//fs.mkdirSync(`./hybrid/connect/${res.bootstrapstackid}`, { recursive: true });
fs.mkdirSync(`./hybrid/connect/${RES.bootstrapstackid}/scripts/1`, { recursive: true });
//fs.mkdirSync(`./hybrid/connect/${res.bootstrapstackid}/scripts/5`, { recursive: true });
(async() => { (async() => {
fs.mkdirSync(`./hybrid/connect/${res.bootstrapstackid}`, { recursive: true });
RES.serverconf = await wg_save_clientconf(RES) RES.serverconf = await wg_save_clientconf(RES)
RES.serverrun = await wg_save_ifup_linux(RES) RES.serverrun = await wg_save_ifup_linux(RES)
RES.serverconnect = await wg_save_connect_linux(RES) RES.serverconnect = await wg_save_connect_linux(RES)
@ -518,8 +510,223 @@ app.get('/getserviceshybridstatus', (req, res, next) => {
}); });
function myserverStatus(){ app.get('/getwginterfaces', (req, res, next) => {
var mypath = process.cwd()
var mongoserver = JSON.parse(fs.readFileSync('./hybrid/venus-stats/config.json', 'utf8')) var mongoserver = JSON.parse(fs.readFileSync('./hybrid/venus-stats/config.json', 'utf8'))
var showexec = `docker exec swlabadminvenus /bin/bash -c "/usr/local/bin/check-wg-connection.sh"`
var RES = new Object();
const page = req.query["page"]
const per_page = req.query["per_page"]
var sort = req.query["sort"]
var filter = req.query["filter"]
var type = req.query["type"]
var sort = req.query["sort"]
var sorttmp1 = sort.split('|');
var sortname = sorttmp1[0];
var sortorder = sorttmp1[1];
log = spawn(showexec, {
shell: true,
cwd: mypath,
detached: false,
stdio: 'pipe'
});
log.stderr.on('data', function (data) {
console.log('error '+JSON.stringify(n));
RES.code = req.query["action"]
RES.token = req.query["token"]
RES.error = true
RES.error_msg = "no"
RES.data = data.toString();
res.json(RES.data)
});
log.stdout.on('data', function (data) {
var n = {}
n.data = data.toString()
n.data = n.data.replace(/(\r\n|\n|\r|\t)/g,"");
var interfaces = JSON.parse(n.data);
var total = interfaces.length;
var perpage = per_page
var lastpage = total/perpage;
if(lastpage <= 1) {
lastpage=1
}else{
lastpage++
}
lastpage = Math.trunc(lastpage);
var next=(page+1);
if(next >= lastpage){
next=lastpage;
}
var prev=(page-1);
if(prev == 0){
prev=1;
}
var from=((page-1)*perpage)+1;
var to=(perpage*page)
var mywgint = new Object();
var links = `
{
"pagination": {
"total": ${total},
"per_page": ${perpage},
"current_page": ${page},
"last_page": ${lastpage},
"next_page_url": "?page=${next}",
"prev_page_url": "?page=${prev}",
"from": ${from},
"to": ${to},
"frommongo": ${from},
"tomongo": ${to}
}
}
`
mywgint.links = JSON.parse(links);
from--
mywgint.data = interfaces.slice(from,to);
RES.code = req.query["action"]
RES.token = req.query["token"]
RES.error = false
RES.error_msg = "ok"
RES.data = mywgint;
res.json(RES.data)
});
});
app.get('/getwginterfacesstats', (req, res, next) => {
var mypath = process.cwd()
var mongoserver = JSON.parse(fs.readFileSync('./hybrid/venus-stats/config.json', 'utf8'))
const bootstrapstackid = req.query["stackid"]
const respublickey = req.query["publickey"]
try {
var mongourl = `mongodb://${mongoserver.mongo_user}:${mongoserver.mongo_pass}@${mongoserver.mongo_ip}:${mongoserver.mongo_port}`;
const OPTS = {
useNewUrlParser: true,
useUnifiedTopology: true
};
MongoClient.connect(mongourl, OPTS, function(err, db) {
if(err){
console.log(err);
} else {
var dbo = db.db(mongoserver.mongo_db);
var limit = 10
dbo.collection(mongoserver.mongo_coll).find({"stackid":bootstrapstackid},{sort:{_id:-1}}).limit(limit).toArray(function(err, result) {
if(err){
console.log(err);
} else {
try {
if(result[0].log[0].peers[respublickey].transferTx){
var datalenth = result.length
var labels = []
var datain = []
var dataout = []
for (var i=0 ; i < datalenth ; i++)
{
labels.push(result[i].date)
datain.push(result[i].log[0].peers[respublickey].transferTx)
dataout.push(result[i].log[0].peers[respublickey].transferRx)
}
}
var chartdata = {
labels: labels,
datasets: [
{
label: "In",
backgroundColor: "#f87979",
data: datain,
borderColor: '#249EBF',
pointBackgroundColor: 'white',
borderWidth: 1,
fill: false,
lineTension: 0,
steppedLine: true,
pointBorderColor: '#249EBF'
},
{
label: "Out",
backgroundColor: "#A5CC82",
data: dataout,
borderColor: '#A5CC82',
pointBackgroundColor: 'white',
fill: false,
borderWidth: 1,
steppedLine: true,
pointBorderColor: '#A5CC82'
}
],
}
//console.log(JSON.stringify(chartdata));
//console.log(JSON.stringify('-------- '+JSON.stringify(result[0].log[0].peers[respublickey].transferTx)));
db.close();
res.json(chartdata)
} catch (err) {
console.error(err);
}
}
});
}
});
} catch (err) {
console.error(err);
}
});
async function mywgStatus(){
//var mongoserver = JSON.parse(fs.readFileSync('./hybrid/venus-stats/config.json', 'utf8'))
var mypath = process.cwd()
var showexec = `docker exec swlabadminvenus /bin/bash -c "/usr/local/bin/check-wg-connection.sh"`
log = spawn(showexec, {
shell: true,
cwd: mypath,
detached: false,
stdio: 'pipe'
});
log.stdout.on('data', function (data) {
var n = {}
n.data = data.toString()
n.data = n.data.replace(/(\r\n|\n|\r|\t)/g,"");
var interfaces = JSON.parse(n.data);
var datalenth = interfaces.length
for (var i=0 ; i < datalenth ; i++)
{
var nn = {}
nn.connection = interfaces[i].connection;
nn.AllowedIPs = interfaces[i].ip;
nn.publickey = interfaces[i].publickey;
nn.bootstrapstackid = interfaces[i].stackid;
}
console.log(interfaces)
return interfaces
});
log.stderr.on('data', function (data) {
var n = {}
n.data = data.toString()
console.log('error '+JSON.stringify(n));
return n
});
log.on('close', function (code) {
console.log('close '+JSON.stringify(code));
var n = {}
n.data = code
return interfaces
});
}
function mywgRemoveClosedConnection(){
//var mongoserver = JSON.parse(fs.readFileSync('./hybrid/venus-stats/config.json', 'utf8'))
var mypath = process.cwd() var mypath = process.cwd()
var showexec = `docker exec swlabadminvenus /bin/bash -c "/usr/local/bin/check-wg-connection.sh"` var showexec = `docker exec swlabadminvenus /bin/bash -c "/usr/local/bin/check-wg-connection.sh"`
@ -534,8 +741,8 @@ function myserverStatus(){
var n = {} var n = {}
n.data = data.toString() n.data = data.toString()
n.data = n.data.replace(/(\r\n|\n|\r|\t)/g,""); n.data = n.data.replace(/(\r\n|\n|\r|\t)/g,"");
console.log(n); //console.log(n);
console.log(n.data); //console.log(n.data);
var interfaces = JSON.parse(n.data); var interfaces = JSON.parse(n.data);
var datalenth = interfaces.length var datalenth = interfaces.length
for (var i=0 ; i < datalenth ; i++) for (var i=0 ; i < datalenth ; i++)
@ -552,7 +759,8 @@ function myserverStatus(){
nn.bootstrapstackid = interfaces[i].stackid; nn.bootstrapstackid = interfaces[i].stackid;
console.log('no connection '+JSON.stringify(nn)); console.log('no connection '+JSON.stringify(nn));
var wgdown = `/bin/bash /config/${nn.bootstrapstackid}/ifdown_linux` var wgdown = `/bin/bash /config/${nn.bootstrapstackid}/ifdown_linux`
var showexec1 = `docker exec swlabadminvenus /bin/bash -c "${wgdown}"` var showexecrm1 = `/bin/sh ./hybrid/connect/${bootstrapstackid}/swarmlabwgdown`
var showexec1 = `docker exec swlabadminvenus /bin/bash -c "${wgdown}"; ${showexecrm1}`
log1 = spawn(showexec1, { log1 = spawn(showexec1, {
shell: true, shell: true,
cwd: mypath, cwd: mypath,
@ -653,10 +861,10 @@ function myserverStatus(){
} }
*/ */
} }
myserverStatus(); mywgRemoveClosedConnection();
setInterval(function(){ setInterval(function(){
myserverStatus() mywgRemoveClosedConnection()
}, 30000) }, 30000)
io.on('connection', function(socket) { io.on('connection', function(socket) {

Loading…
Cancel
Save