console: update request payload event triggers (#358)

This commit is contained in:
Praveen Durairaj 2018-09-05 18:37:52 +05:30 committed by Shahidh K Muhammed
parent 6c9d176921
commit 258885ad4d
8 changed files with 22 additions and 13 deletions

View File

@ -195,7 +195,7 @@ const loadEventLogs = triggerName => (dispatch, getState) => {
],
where: { event: { trigger_name: triggerName } },
order_by: ['-created_at'],
limit: 20,
limit: 10,
},
}),
};

View File

@ -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)
);

View File

@ -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 {

View File

@ -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)
);

View File

@ -46,7 +46,7 @@ class Schema extends Component {
dispatch(push(`${appPrefix}/manage/triggers/add`));
}}
>
Create
Create Trigger
</button>
) : null}
</div>

View File

@ -95,7 +95,7 @@ const streamingLogsReducer = (triggerName, triggerList, logState, action) => {
columns: ['*'],
},
],
limit: 20,
limit: 10,
where: { event: { trigger_name: triggerName } },
},
activePath: [triggerName],

View File

@ -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>

View File

@ -257,3 +257,9 @@ a.expanded {
padding-left: 5px;
}
}
.watchBtn {
i {
font-size: 12px;
}
}