mirror of https://github.com/embarklabs/embark.git
Missing pieces for adding log limit
This commit is contained in:
parent
145f376000
commit
7b784b9618
|
@ -108,7 +108,9 @@ export const commands = {
|
|||
|
||||
export const PROCESS_LOGS = createRequestTypes('PROCESS_LOGS');
|
||||
export const processLogs = {
|
||||
request: (processName, limit) => action(PROCESS_LOGS[REQUEST], {processName, limit}),
|
||||
request: (processName, limit) => {
|
||||
return action(PROCESS_LOGS[REQUEST], {processName, limit});
|
||||
},
|
||||
success: (processLogs) => action(PROCESS_LOGS[SUCCESS], {processLogs}),
|
||||
failure: (error) => action(PROCESS_LOGS[FAILURE], {error})
|
||||
};
|
||||
|
|
|
@ -56,7 +56,7 @@ export function fetchProcesses() {
|
|||
}
|
||||
|
||||
export function fetchProcessLogs(payload) {
|
||||
return get(`/process-logs/${payload.processName}`, ...arguments);
|
||||
return get(`/process-logs/${payload.processName}`, {params: payload, credentials: payload.credentials});
|
||||
}
|
||||
|
||||
export function fetchContractLogs() {
|
||||
|
|
|
@ -84,7 +84,7 @@ class ProcessLauncher {
|
|||
self.embark.registerAPICall(
|
||||
'get',
|
||||
apiRoute,
|
||||
(_req, res) => {
|
||||
(req, res) => {
|
||||
let limit = parseInt(req.query.limit, 10);
|
||||
if(!Number.isInteger(limit)) limit = 0;
|
||||
const result = self.logs.map((log, id) => Object.assign(log, {id})).slice(limit);
|
||||
|
|
Loading…
Reference in New Issue