Skip to content

Commit

Permalink
Fixed few UI issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanishka Dilshan committed Dec 28, 2018
1 parent 51dc1b2 commit e952507
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
20 changes: 14 additions & 6 deletions routes/interceptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,20 @@ router.get('/:id', (req, res) => {
HttpInterception.find({})
.sort({ date: 'desc' })
.then(httpInterceptions => {
res.render('interceptions/index', {
interceptionUrl: envUtils.getHostName() + "/interception/" + req.params.id,
selectedInterceptionId: req.params.id,
httpInterceptionDumps: httpInterceptionDumps,
httpInterceptions: httpInterceptions
});
HttpInterception.findById({
_id: req.params.id
})
.then(selectedInterception => {
res.render('interceptions/index', {
interceptionUrl: envUtils.getHostName() + "/interception/" + req.params.id,
selectedInterception : selectedInterception,
httpInterceptionDumps: httpInterceptionDumps,
httpInterceptions: httpInterceptions
});
})
.catch(err => {

});
})
.catch(err => {
res.send("Error occured while retrieving http interceptions");
Expand Down
12 changes: 9 additions & 3 deletions views/interceptions/index.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@
<p>Selected reception</p>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">URL</span>
<span class="input-group-text" id="basic-addon1">Request URL</span>
</div>
<input type="text" class="form-control" aria-describedby="basic-addon1" value={{interceptionUrl}}>
<a href="/interceptions/{{selectedInterceptionId}}/delete" class="btn btn-danger" data-toggle="confirmation"
<a href="/interceptions/{{selectedInterception._id}}/delete" class="btn btn-danger" data-toggle="confirmation"
data-title="Are you sure?">
<span class="fas fa-trash" aria-hidden="true"></span> Delete</a>
</div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Forward URL</span>
</div>
<input type="text" class="form-control" aria-describedby="basic-addon1" value={{selectedInterception.forwardUrl}}>
</div>
</div>
{{/if}}
<!--End of indicating selected reception -->
Expand All @@ -50,7 +56,7 @@
<p class="text-left text-secondary"><small>{{date}}</small></p>
</div>
<div class="card-body">
<a href="/interceptiondumps/{{_id}}" class="btn btn-primary" >
<a href="/interceptiondumps/{{_id}}" class="btn btn-primary">
<span class="fas fa-project-diagram" aria-hidden="true"></span> Inspect</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion views/receptions/add.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</div>
<div class="form-group">
<label for="details">Response Status</label>
<input name="status" class="form-control" value="200" aria-describedby="basic-addon-name">
<input type="number" name="status" class="form-control" value="200" aria-describedby="basic-addon-name">
</div>
<div class="form-group">
<label for="details">Reason Phrase</label>
Expand Down

0 comments on commit e952507

Please sign in to comment.