Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #138 from cglewis/dev
Browse files Browse the repository at this point in the history
adds /tools to be able to get fields for #134
  • Loading branch information
cglewis committed Apr 10, 2020
2 parents 33d17b7 + 6ec565b commit a59ddc1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
17 changes: 17 additions & 0 deletions ui/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,23 @@ app.get('/id/:session/:id/:tool/:pcap/:counter/:file', function(req, res) {

});

// render tools available
app.get('/tools', function(req, res) {
var url = 'http://lb/api/v1/tools'

request.get({url:url}, function optionalCallback(err, httpResponse, body) {
if (err) {
res.set('Content-Type', 'application/json');
res.send([]);
return console.error('failed:', err);
}
console.log(body);
res.set('Content-Type', 'application/json');
res.send(body);
});

});

app.get('/*', function(req, res) {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
Expand Down
2 changes: 1 addition & 1 deletion ui/src/epics/fetch-results-epic.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const fetchResultsEpic = (action$, store, ajax = rxAjax) => {
const sessionId = action.payload.sessionId;
const url = '/ids/' + sessionId;
return ajax({ 'url': url, 'crossDomain': true, 'responseType': 'json' }).pipe(
map((result) => {
map((result) => {

return result.response ;
})
Expand Down
4 changes: 2 additions & 2 deletions ui/src/epics/fetch-status-epic.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const fetchToolStatusEpic = (action$, store, ajax = rxAjax) => {
const fileId = action.payload.fileId;
const url = '/status/' + sessionId + '/' + fileId;
return ajax({ 'url': url, 'crossDomain': true, 'responseType': 'json' }).pipe(
map((result) => {
map((result) => {
const resp = result.response;
const tools = {};
const keys = Object.keys(resp);
Expand All @@ -45,4 +45,4 @@ const fetchToolStatusEpic = (action$, store, ajax = rxAjax) => {
}

export default fetchToolStatusEpic;
export { fetchToolStatus };
export { fetchToolStatus };

0 comments on commit a59ddc1

Please sign in to comment.