feat: setup logs retention by max file size

This commit is contained in:
fsylvain committed 2026-10-07 22:02:13 +02:00
1 parent 70c8492f4f
commit f914eae3c5
44 files changed
+2316 -161

No files matched your search

+9 -2
View File
@@ -3,11 +3,18 @@ import { useApi } from '@/composables/useApi'
export interface WorkspaceSettings {
version: string
activity_retention_days: number
activity_retention_max_gb: number
activity_log_size_bytes: number
activity_last_cleanup_at: string | null
activity_last_cleanup_removed: number
activity_next_cleanup_at: string | null
}
export interface RetentionPatch {
activity_retention_days?: number
activity_retention_max_gb?: number
}
const SETTINGS_PATH = '/v1/settings/'
const JSON_HEADERS = { 'Content-Type': 'application/json' }
@@ -18,11 +25,11 @@ export function useSettings() {
return request<WorkspaceSettings>(SETTINGS_PATH)
}
function updateRetention(days: number): Promise<WorkspaceSettings> {
function updateRetention(patch: RetentionPatch): Promise<WorkspaceSettings> {
return request<WorkspaceSettings>(SETTINGS_PATH, {
method: 'PATCH',
headers: JSON_HEADERS,
body: JSON.stringify({ activity_retention_days: days }),
body: JSON.stringify(patch),
})
}