feat : ajout de la lecture des logs symfony et docker (#3)
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Reviewed-on: #3 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit was merged in pull request #3.
This commit is contained in:
5
frontend/services/dto/logs.ts
Normal file
5
frontend/services/dto/logs.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
type LogOutput = {
|
||||
content: string
|
||||
lines: number
|
||||
source: string
|
||||
}
|
||||
15
frontend/services/logs.ts
Normal file
15
frontend/services/logs.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { LogOutput } from './dto/logs'
|
||||
|
||||
export function getDockerLogs(envId: number, lines: number = 100): Promise<LogOutput> {
|
||||
return useApi().get<LogOutput>(`/environments/${envId}/logs/docker`, { lines }, {
|
||||
toast: false,
|
||||
})
|
||||
}
|
||||
|
||||
export function getSymfonyLog(envId: number, logFileId: number, lines: number = 100, level?: string): Promise<LogOutput> {
|
||||
const query: Record<string, any> = { lines }
|
||||
if (level) query.level = level
|
||||
return useApi().get<LogOutput>(`/environments/${envId}/logs/symfony/${logFileId}`, query, {
|
||||
toast: false,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user