fix: docker log sequence
This commit is contained in:
@@ -1605,12 +1605,7 @@ export async function getApplicationLogs(request: FastifyRequest<GetApplicationL
|
|||||||
.split('\n')
|
.split('\n')
|
||||||
.map((l) => ansi(l))
|
.map((l) => ansi(l))
|
||||||
.filter((a) => a);
|
.filter((a) => a);
|
||||||
const logs = stripLogsStderr.concat(stripLogsStdout);
|
return { logs: stripLogsStderr.concat(stripLogsStdout) };
|
||||||
const sortedLogs = logs.sort((a, b) =>
|
|
||||||
day(a.split(' ')[0]).isAfter(day(b.split(' ')[0])) ? 1 : -1
|
|
||||||
);
|
|
||||||
return { logs: sortedLogs };
|
|
||||||
// }
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const { statusCode, stderr } = error;
|
const { statusCode, stderr } = error;
|
||||||
if (stderr.startsWith('Error: No such container')) {
|
if (stderr.startsWith('Error: No such container')) {
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -561,12 +561,7 @@ export const applicationsRouter = router({
|
|||||||
.split('\n')
|
.split('\n')
|
||||||
.map((l) => ansi(l))
|
.map((l) => ansi(l))
|
||||||
.filter((a) => a);
|
.filter((a) => a);
|
||||||
const logs = stripLogsStderr.concat(stripLogsStdout);
|
return { logs: stripLogsStderr.concat(stripLogsStdout) };
|
||||||
const sortedLogs = logs.sort((a, b) =>
|
|
||||||
day(a.split(' ')[0]).isAfter(day(b.split(' ')[0])) ? 1 : -1
|
|
||||||
);
|
|
||||||
return { logs: sortedLogs };
|
|
||||||
// }
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const { statusCode, stderr } = error;
|
const { statusCode, stderr } = error;
|
||||||
if (stderr.startsWith('Error: No such container')) {
|
if (stderr.startsWith('Error: No such container')) {
|
||||||
|
@@ -68,16 +68,11 @@ export const servicesRouter = router({
|
|||||||
.split('\n')
|
.split('\n')
|
||||||
.map((l) => ansi(l))
|
.map((l) => ansi(l))
|
||||||
.filter((a) => a);
|
.filter((a) => a);
|
||||||
const logs = stripLogsStderr.concat(stripLogsStdout);
|
|
||||||
const sortedLogs = logs.sort((a, b) =>
|
|
||||||
day(a.split(' ')[0]).isAfter(day(b.split(' ')[0])) ? 1 : -1
|
|
||||||
);
|
|
||||||
return {
|
return {
|
||||||
data: {
|
data: {
|
||||||
logs: sortedLogs
|
logs: stripLogsStderr.concat(stripLogsStdout)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// }
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const { statusCode, stderr } = error;
|
const { statusCode, stderr } = error;
|
||||||
if (stderr.startsWith('Error: No such container')) {
|
if (stderr.startsWith('Error: No such container')) {
|
||||||
@@ -92,7 +87,6 @@ export const servicesRouter = router({
|
|||||||
return {
|
return {
|
||||||
data: {
|
data: {
|
||||||
logs: []
|
logs: []
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user