Skip to content

Commit

Permalink
jshint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lwindolf committed Sep 3, 2023
1 parent 2b8afe9 commit 0376513
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
7 changes: 3 additions & 4 deletions frontend/js/notebook.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// vim: set ts=4 sw=4:
/* jshint esversion: 6 */
/* jshint esversion: 8 */

import { ProbeAPI } from './probeapi.js';
// import * as runtime from '../starboard-notebook.js';

// Starboard-Notebook has no native shell type, so we register one
// see CoffeeScript example: https://starboard.gg/gz/coffeescript-custom-cell-type-n1VJRGC
Expand All @@ -15,7 +14,7 @@ function registerStarboardShellCellType() {
name: "Shell",
cellType: ["shell"],
createHandler: (cell, runtime) => new ShellCellHandler(cell, runtime),
}
};

class ShellCellHandler {
constructor(cell, runtime) {
Expand Down Expand Up @@ -57,7 +56,7 @@ function registerStarboardShellCellType() {
method: "result",
data: [val]
});
return val
return val;
}).catch((d) => {
this.outputElement.addEntry({
method: "error",
Expand Down
10 changes: 5 additions & 5 deletions frontend/js/probeapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function _ProbeAPI() {
a.ws = undefined;
setInfo('Connecting backend ...');
try {
var ws = new WebSocket(settings.backendEndpoint);
let ws = new WebSocket(settings.backendEndpoint);
ws.onerror = function(e) {
setInfo(`⛔ Backend websocket error!`);
setTimeout(function() {a.connect();}, 5000);
Expand All @@ -28,7 +28,7 @@ function _ProbeAPI() {
};
ws.onmessage = function(e) {
try {
var d = JSON.parse(e.data);
let d = JSON.parse(e.data);
if(d.cmd === 'history')
addHistory(d.result);
if(d.cmd === 'hosts')
Expand All @@ -39,7 +39,7 @@ function _ProbeAPI() {
}

if(d.cmd === 'run') {
var p = a.runs[d.id];
let p = a.runs[d.id];

if(undefined === p) {
console.error(`Message ${d} misses id info or does not match known run!`);
Expand All @@ -52,7 +52,7 @@ function _ProbeAPI() {
}

if(d.cmd === 'probe') {
var p = a.hosts[d.host].probes[d.probe];
let p = a.hosts[d.host].probes[d.probe];

if(undefined === p) {
console.error(`Message ${d} misses probe info or does not match known probe!`);
Expand Down Expand Up @@ -130,7 +130,7 @@ function _ProbeAPI() {
if(undefined === a.hosts[host].probes[name])
a.hosts[host].probes[name] = {};

var p = a.hosts[host].probes[name];
let p = a.hosts[host].probes[name];
p.updating = true;
p.timestamp = Date.now();

Expand Down
6 changes: 3 additions & 3 deletions frontend/js/renderer/netmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function parse(results) {
});

return { 'results': results };
};
}

// IP lookup popup helper
function lookup(ip) {
Expand All @@ -72,7 +72,7 @@ function lookup(ip) {
"\nPostal: "+data.postal
);
});
};
}

function netmapRenderer(pAPI, id, host) {
$(id).html('<i>Loading connections...</i>');
Expand Down Expand Up @@ -146,6 +146,6 @@ function netmapRenderer(pAPI, id, host) {
$(id).html('ERROR: Fetching connection data failed!');
console.error(`probe Error: host=${h} probe=${probe} ${e}`);
});
};
}

export { netmapRenderer };
2 changes: 1 addition & 1 deletion frontend/js/renderer/perf-flamegraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ function perfRenderer(pAPI, id, host) {
console.error(`probe Error: host=${h} probe=${probe} ${e}`);
});
});
};
}

export { perfRenderer };
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"websocket": "^1.0.34"
},
"scripts": {
"test": "jshint *.js js/*.js js/renderer/*.js",
"test": "jshint worker.js js/*.js js/renderer/*.js",
"start": "python3 -m http.server"
}
}

0 comments on commit 0376513

Please sign in to comment.