diff --git a/client/dashboard.css b/client/dashboard.css index d190517..0158020 100644 --- a/client/dashboard.css +++ b/client/dashboard.css @@ -9,15 +9,19 @@ td , caption , th { border: 1px solid black; background-color: PowderBlue; } -#repeaters { +#rptrtable { border: 1px solid black; background-color: Yellow; } +#urltable { + border: 1px solid black; + background-color: White; +} #linktable { border: 1px solid black; background-color: Lime; } -#lhtable caption , #linktable caption , #rptrtable caption { +#lhtable caption , #linktable caption , #rptrtable caption , #urltable caption{ font-weight : bold; font-size : 2em; color : white; @@ -25,6 +29,6 @@ td , caption , th { width : 100%; } -#linktable , #lhtable , #rptrtable { +#linktable , #lhtable , #rptrtable , #urltable { width: 100%; } diff --git a/client/index.html b/client/index.html index 1421a7a..e182a61 100644 --- a/client/index.html +++ b/client/index.html @@ -19,10 +19,10 @@

Dashboard

+
+
-
-
diff --git a/client/script.js b/client/script.js index 56d6a59..d0f059d 100644 --- a/client/script.js +++ b/client/script.js @@ -4,13 +4,24 @@ socket.addEventListener("connect", () => { socket.emit("Hello from script.js"); }); -socket.addEventListener("message", data => { - console.log(data[0]); - $("#intro").text(data); +socket.addEventListener("info", indata => { +// console.log(indata); + const data = JSON.parse(indata); + $("#instruct").empty(); + $("#instruct").append(""); + $("#urltable").append(""); + $("#urltable").append(""); + $("#urltable").append(""); + }); socket.addEventListener("title", data => { - console.log(data); +// console.log(data); $("title").text(data); $("#intro").text(data); }); diff --git a/dashboard.ini b/dashboard.ini index 0deeafb..8ae4086 100644 --- a/dashboard.ini +++ b/dashboard.ini @@ -3,7 +3,7 @@ headers=/var/log/dstargateway/Headers.log links=/var/log/dstargateway/Links.log [config] dgwconfig=/usr/local/etc/dstargateway.cfg -host=nw7dr.ampr.org +host=kf7ufz.ampr.org port=443 [urls] sponsorname=Greater Kingston Radio Club @@ -18,4 +18,4 @@ livename_2=Openquad Live live_2=https://openquad.net/last.php [params] linkqueue=10 -heardqueue=20 +heardqueue=15 diff --git a/index.js b/index.js index 6a181fa..4d44d63 100644 --- a/index.js +++ b/index.js @@ -20,6 +20,9 @@ const dgwconfig = ini.parse(fs.readFileSync(inifile.config.dgwconfig, 'utf-8')); const app = express(); const buf = new CircularBuffer(heardqueue); const linklist = new CircularBuffer(linkqueue); + +const urls = inifile.urls; + var repeaterlist = []; linklist.push({'timestamp':'0000-00-00 00:00:00' , 'protocol': 'none' , 'device':'none', @@ -50,10 +53,7 @@ app.use(express.static(path.resolve(__dirname, 'client'))); const io = socketio(server); function senddata(dest,data,socket) { - //console.log("Enter Senddata -> " + dest); socket.emit(dest,data); - // console.log(dest,JSON.stringify(data)); - // console.log("Leave Senddata -> " + dest); } @@ -72,22 +72,15 @@ function buildrepeaters(){ 'description2':rptr.description2,'latitude':rptr.latitude, 'longitude': rptr.longitude}); } } - -// console.log(JSON.stringify(repeaterlist)); - } function updatelinks() { - // console.log("Entering updatelinks"); const linksregex = /(.*) (.*) (.*) - Type: (.*) Rptr: (.*) Refl: (.*) Dir: (.*)/; const linkfile = fs.readFileSync(links).toString(); const lines = linkfile.split(/\n|\r\n/); - // console.log("Queue Size in: " + linklist.size()); while (linklist.size() > 0) { linklist.deq(); }; - // console.log("Queue Size out: " + linklist.size()); - // console.log("File Length: " + lines.length); let i = 0; while (i < lines.length) { if(lines[i] != "") { @@ -99,9 +92,6 @@ function updatelinks() { } i++; } -// console.log("From updatelinks() " + JSON.stringify(linklist.toarray())); -// senddata("links",linklist.toarray(),io); - // console.log("Leaving updatelinks"); } @@ -109,6 +99,7 @@ function updatelinks() { io.on('connection', (socket) => { // console.log('WS New connection'); buildrepeaters(); + senddata("info",JSON.stringify(urls),socket); senddata("lastheard",buf.toarray(),socket); senddata("links",linklist.toarray(),socket); senddata("title",host + " Dashboard",socket); @@ -116,29 +107,20 @@ io.on('connection', (socket) => { // console.log("leaving connection"); }); -// io.on('message', (socket) => { -// console.log('New Message' + JSON.stringify(socket)) -//}); - fs.watch(headers, (curr, prev)=>{ - // console.log(headers + ' file changed'); -// console.log("from fs.watch headers " + JSON.stringify(buf.toarray())); senddata("lastheard",buf.toarray(),io); }); fs.watch(links, (curr, prev)=>{ - // console.log(links + ' file changed'); -// console.log("from fs.watch links " + JSON.stringify(linklist.toarray())); updatelinks(); - // console.log("from fs.watch links " + JSON.stringify(linklist.toarray())); senddata("links",linklist.toarray(),io); - // console.log("Leaving links watch"); }); + + const tailheaders = new Tail(headers, {startPos : 'end'}, line => { const headerregex = /(.*) (.*) header.*My: (.*) Your: (.*) *Rpt1: (.*) *Rpt2: (.*) Flags.*\((.*)\)/; const groups = line.match(headerregex); -// console.log(JSON.stringify(groups)); if (groups) { var ipport = groups[7].split(':'); var my = groups[3].split('/'); @@ -149,7 +131,6 @@ const tailheaders = new Tail(headers, {startPos : 'end'}, line => { 'srcip':ipport[0],'srcport':ipport[1]}; buf.push(record); senddata("lastheard",buf.toarray(),io); -// console.log(JSON.stringify(record)); } });
Helpful URLs
SponsorLiveUtilities
" + + data.sponsorname + "" + + data.livename_1 + "" + data.registersite + "
" + + data.cosponsorname + "" + + data.livename_2 + "