mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
console: update request payload event triggers (#358)
This commit is contained in:
parent
6c9d176921
commit
258885ad4d
@ -195,7 +195,7 @@ const loadEventLogs = triggerName => (dispatch, getState) => {
|
||||
],
|
||||
where: { event: { trigger_name: triggerName } },
|
||||
order_by: ['-created_at'],
|
||||
limit: 20,
|
||||
limit: 10,
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
@ -313,12 +313,12 @@ const ViewRows = ({
|
||||
showPagination={false}
|
||||
SubComponent={logRow => {
|
||||
const finalIndex = logRow.index;
|
||||
const finalRow = currentRow.logs[finalIndex];
|
||||
const currentPayload = JSON.stringify(
|
||||
currentRow.payload,
|
||||
finalRow.request,
|
||||
null,
|
||||
4
|
||||
);
|
||||
const finalRow = currentRow.logs[finalIndex];
|
||||
const finalResponse = JSON.parse(
|
||||
JSON.stringify(finalRow.response, null, 4)
|
||||
);
|
||||
|
@ -306,12 +306,12 @@ const ViewRows = ({
|
||||
showPagination={false}
|
||||
SubComponent={logRow => {
|
||||
const finalIndex = logRow.index;
|
||||
const finalRow = currentRow.logs[finalIndex];
|
||||
const currentPayload = JSON.stringify(
|
||||
currentRow.payload,
|
||||
finalRow.request,
|
||||
null,
|
||||
4
|
||||
);
|
||||
const finalRow = currentRow.logs[finalIndex];
|
||||
// check if response is type JSON
|
||||
let finalResponse = finalRow.response;
|
||||
try {
|
||||
|
@ -313,12 +313,12 @@ const ViewRows = ({
|
||||
showPagination={false}
|
||||
SubComponent={logRow => {
|
||||
const finalIndex = logRow.index;
|
||||
const finalRow = currentRow.logs[finalIndex];
|
||||
const currentPayload = JSON.stringify(
|
||||
currentRow.payload,
|
||||
finalRow.request,
|
||||
null,
|
||||
4
|
||||
);
|
||||
const finalRow = currentRow.logs[finalIndex];
|
||||
const finalResponse = JSON.parse(
|
||||
JSON.stringify(finalRow.response, null, 4)
|
||||
);
|
||||
|
@ -46,7 +46,7 @@ class Schema extends Component {
|
||||
dispatch(push(`${appPrefix}/manage/triggers/add`));
|
||||
}}
|
||||
>
|
||||
Create
|
||||
Create Trigger
|
||||
</button>
|
||||
) : null}
|
||||
</div>
|
||||
|
@ -95,7 +95,7 @@ const streamingLogsReducer = (triggerName, triggerList, logState, action) => {
|
||||
columns: ['*'],
|
||||
},
|
||||
],
|
||||
limit: 20,
|
||||
limit: 10,
|
||||
where: { event: { trigger_name: triggerName } },
|
||||
},
|
||||
activePath: [triggerName],
|
||||
|
@ -80,7 +80,7 @@ class StreamingLogs extends Component {
|
||||
}
|
||||
if (col === 'created_at') {
|
||||
const formattedDate = new Date(r.created_at).toUTCString();
|
||||
return formattedDate;
|
||||
return <div className={conditionalClassname}>{formattedDate}</div>;
|
||||
}
|
||||
const content = r[col] === undefined ? 'NULL' : r[col].toString();
|
||||
return <div className={conditionalClassname}>{content}</div>;
|
||||
@ -103,15 +103,18 @@ class StreamingLogs extends Component {
|
||||
<div>
|
||||
<button
|
||||
onClick={this.watchChanges.bind(this)}
|
||||
className={' btn btn-default'}
|
||||
className={styles.watchBtn + ' btn btn-default'}
|
||||
data-test="run-query"
|
||||
>
|
||||
{this.state.isWatching ? (
|
||||
<span>
|
||||
Streaming... <i className={'fa fa-spinner fa-spin'} />
|
||||
<i className={'fa fa-pause'} /> Streaming...{' '}
|
||||
<i className={'fa fa-spinner fa-spin'} />
|
||||
</span>
|
||||
) : (
|
||||
'Stream Logs'
|
||||
<span>
|
||||
Stream Logs <i className={'fa fa-play'} />
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -257,3 +257,9 @@ a.expanded {
|
||||
padding-left: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.watchBtn {
|
||||
i {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user