mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-17 08:07:51 +00:00
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 PROCESS_LOGS = createRequestTypes('PROCESS_LOGS');
|
||||||
export const processLogs = {
|
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}),
|
success: (processLogs) => action(PROCESS_LOGS[SUCCESS], {processLogs}),
|
||||||
failure: (error) => action(PROCESS_LOGS[FAILURE], {error})
|
failure: (error) => action(PROCESS_LOGS[FAILURE], {error})
|
||||||
};
|
};
|
||||||
|
@ -56,7 +56,7 @@ export function fetchProcesses() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function fetchProcessLogs(payload) {
|
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() {
|
export function fetchContractLogs() {
|
||||||
|
@ -84,7 +84,7 @@ class ProcessLauncher {
|
|||||||
self.embark.registerAPICall(
|
self.embark.registerAPICall(
|
||||||
'get',
|
'get',
|
||||||
apiRoute,
|
apiRoute,
|
||||||
(_req, res) => {
|
(req, res) => {
|
||||||
let limit = parseInt(req.query.limit, 10);
|
let limit = parseInt(req.query.limit, 10);
|
||||||
if(!Number.isInteger(limit)) limit = 0;
|
if(!Number.isInteger(limit)) limit = 0;
|
||||||
const result = self.logs.map((log, id) => Object.assign(log, {id})).slice(limit);
|
const result = self.logs.map((log, id) => Object.assign(log, {id})).slice(limit);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user