Browse Source

add venus stats

master
zeus 4 years ago
parent
commit
fe4f4555fb
  1. 2
      client/index.html
  2. 1
      client/js/app.5d70420c.js.map
  3. 2
      client/js/app.d91a6d39.js
  4. 1
      client/js/app.d91a6d39.js.map
  5. 34
      llo/connect-new.js

2
client/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.ea5082e6.css" rel="preload" as="style"><link href="/css/chunk-vendors.d0de25b8.css" rel="preload" as="style"><link href="/js/app.5d70420c.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.5d70420c.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.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>

1
client/js/app.5d70420c.js.map

File diff suppressed because one or more lines are too long

2
client/js/app.5d70420c.js → 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

34
llo/connect-new.js

@ -1,6 +1,4 @@
var fs = require('fs');
var express = require('express');
@ -17,7 +15,6 @@ var allowedOrigins = [
app.use(cors({
origin: function(origin, callback){ // allow requests with no origin
// (like mobile apps or curl requests)
if(!origin)
return callback(null, true);
if(allowedOrigins.indexOf(origin) === -1){
@ -90,7 +87,6 @@ function myexec(res) {
* **********************************************************
*/
async function wg_save_clientconf(res) {
/*
@ -103,23 +99,6 @@ async function wg_save_clientconf(res) {
res.allowedips
res.interfaceip
res.endpointfpath
const { mkdir } = require('fs').promises;
(async function main() {
try {
const parent = '.';
const dirnames = ['pdfs', 'fonts', 'err/or', 'users'];
await Promise.all(
dirnames.map(dirname => mkdir(`${parent}/${dirname}`).catch(console.error))
);
// All dirs are created here or errors reported.
} catch (err) {
console.error(err);
}
})();
*/
const apptest = require('express')();
@ -282,9 +261,7 @@ export NODE_PATH=$(npm root --quiet -g)
console.log(err);
} else {
var dbo = db.db(mongoserver.mongo_db);
//var findcoll = `{"stackid":"${res.bootstrapstackid}"}`
//{EmployeeName : {$regex: "Gu" }}
var limit = 15
var limit = 2
dbo.collection(mongoserver.mongo_coll).find({"stackid":res.bootstrapstackid},{sort:{_id:-1}}).limit(limit).toArray(function(err, result) {
if(err){
console.log(err);
@ -337,11 +314,6 @@ docker run -d \
fs.writeFileSync(`./hybrid/connect/${res.bootstrapstackid}/swarmlabwg`, myExec);
fs.writeFileSync(`./hybrid/connect/${res.bootstrapstackid}/swarmlabstatus`, 'wgstatusclient=off');
//stackid=2WpY5xabCndTNCvqYflUcORKTRDkf6e9
//stackinterface=YBqJjwhL6a9OOcWBUdC9PjM8Gr7AOzuNX5g1247mVl8=
//stackname=swarmlabwg-2WpY5xabCndTNCvqYflUcORKTRDkf6e9
//stackpeer=pl8Gf6HDMbKBHA/pQRPgCE7cdafoXVqpPo97I/tqlEQ=
const myExecLog = `#!/bin/sh
date=\`date '+%Y-%m-%d-%H:%M'\`
@ -523,13 +495,10 @@ app.post('/hybrid_join_connect', (req, res, next) => {
});
app.get('/getserviceshybridstatus', (req, res, next) => {
var RES = new Object();
RES.bootstrapnameid = req.query["bootstrapnameid"]
// swarmlab name swarmlabwg
RES.bootstrapstackname = req.query["bootstrapstackname"]
var showexec = `docker ps --format '{"Names":"{{ .Names }}", "Status":"{{.Status}}"}' | jq . -s `
exec(showexec, (err, stdout, stderr) => {
@ -570,7 +539,6 @@ app.get('/getserviceshybridstatus', (req, res, next) => {
});
server.listen(serverPort, function() {
console.log('server up and running at %s port', serverPort);
});

Loading…
Cancel
Save