Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Implement going to individual log items
Browse files Browse the repository at this point in the history
  • Loading branch information
dok committed Sep 28, 2018
1 parent 5782442 commit db8cc6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/api-explorer/api-explorer.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ form form.rjsf {
}
.logs .logs-list table {}
.hub-reference-section .logs .logs-list table tbody tr:hover {
cursor: default;
cursor: pointer;
background-color: #eee;
}
.logs .select-container {
Expand Down
8 changes: 7 additions & 1 deletion packages/api-logs/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class Logs extends React.Component {
this.renderSelect = this.renderSelect.bind(this);
this.onSelect = this.onSelect.bind(this);
this.renderTable = this.renderTable.bind(this);
this.visitLogItem = this.visitLogItem.bind(this);
}

componentDidMount() {
Expand Down Expand Up @@ -115,13 +116,18 @@ class Logs extends React.Component {
});
}

visitLogItem(log) {
const { baseUrl } = this.props;
window.location = `${baseUrl}logs/${log._id}`;
}

renderLogs() {
const { logs } = this.state;

return logs.map(log => {
const entry = log.request.log.entries[0];
return (
<tr key={log._id}>
<tr onClick={this.visitLogItem.bind(this, log)} key={log._id}>
<td>{entry.request.method}</td>
<td>{entry.response.status}</td>
<td>{entry.request.url}</td>
Expand Down

0 comments on commit db8cc6a

Please sign in to comment.