这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import Tooltip from 'react-bootstrap/lib/Tooltip';

export const statusCodeDescription = (
<Tooltip id="tooltip-trigger-status-code-description">
Status code of the webhook response
</Tooltip>
);
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import {
} from './FilterActions';
import { ordinalColSort } from '../utils';
import '../TableCommon/ReactTableFix.css';
import * as tooltip from '../Common/Tooltips';
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';

const ViewRows = ({
curTriggerName,
Expand Down Expand Up @@ -404,8 +406,57 @@ const ViewRows = ({
</div>
) : null}
<div className={styles.add_mar_top}>
<div className={styles.subheading_text}>
Payload
<div
className={
styles.subheading_text +
' col-md-6 ' +
styles.padd_remove
}
>
{finalResponse.status_code
? 'Payload'
: 'Error'}
</div>
<div
className={
styles.status_code_right +
' col-md-6 ' +
styles.padd_remove
}
>
{finalResponse.status_code
? [
'Status Code: ',
finalResponse.status_code === 200 ? (
<i
className={
styles.invocationSuccess +
' fa fa-check'
}
/>
) : (
<i
className={
styles.invocationFailure +
' fa fa-times'
}
/>
),
finalResponse.status_code,
' ',
<OverlayTrigger
placement="top"
overlay={
tooltip.statusCodeDescription
}
>
<i
className="fa fa-question-circle"
aria-hidden="true"
/>
</OverlayTrigger>,
]
: null}
</div>
<AceEditor
mode="json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import {
toggleOldAvailable,
toggleNewAvailable,
} from './LogActions';
import * as tooltip from '../Common/Tooltips';
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';

class StreamingLogs extends Component {
constructor(props) {
Expand Down Expand Up @@ -409,7 +411,54 @@ class StreamingLogs extends Component {
</div>
) : null}
<div className={styles.add_mar_top}>
<div className={styles.subheading_text}>Response</div>
<div
className={
styles.subheading_text +
' col-md-6 ' +
styles.padd_remove
}
>
{finalResponse.status_code ? 'Payload' : 'Error'}
</div>
<div
className={
styles.status_code_right +
' col-md-6 ' +
styles.padd_remove
}
>
{finalResponse.status_code
? [
'Status Code: ',
finalResponse.status_code === 200 ? (
<i
className={
styles.invocationSuccess +
' fa fa-check'
}
/>
) : (
<i
className={
styles.invocationFailure +
' fa fa-times'
}
/>
),
finalResponse.status_code,
' ',
<OverlayTrigger
placement="top"
overlay={tooltip.statusCodeDescription}
>
<i
className="fa fa-question-circle"
aria-hidden="true"
/>
</OverlayTrigger>,
]
: null}
</div>
<AceEditor
mode="json"
theme="github"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@ const parseRowData = (row, dataType) => {
switch (row.response.version) {
case '2':
try {
data = JSON.parse(row.response.data.body);
// Handle graphql-engine server error message
if (row.response.data.message) {
data = row.response.data;
} else {
data = JSON.parse(row.response.data.body);
}
} catch (e) {
console.log(e);
data = row.response.data.body;
}
return {
data: data,
headers: row.response.data.headers,
status_code: row.response.data.status,
};
default:
try {
Expand All @@ -36,6 +42,7 @@ const parseRowData = (row, dataType) => {
}
return {
data: data,
status_code: row.status,
};
}
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,15 @@ a.expanded {
clear: both;
margin: 0;
}
.status_code_right {
text-align: right;
font-weight: bold;
font-size: 15px;
padding-bottom: 20px;
margin-top: 0;
margin-bottom: 0;
i
{
margin-left: 5px;
}
}