mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
Add run history tab to GlobalSchedules page
Extract RunDetailPanel, create RunHistoryCards component, add runs tab with filtering
This commit is contained in:
1 parent
20838f0b88
commit
cc1256d6ec
7 files changed
+887
-511
No files matched your search
@@ -6,6 +6,7 @@ import {
|
||||
deleteRepoSchedule,
|
||||
getRepoSchedule,
|
||||
getRepoScheduleRun,
|
||||
listAllScheduleRuns,
|
||||
listAllSchedules,
|
||||
listRepoScheduleRuns,
|
||||
listRepoSchedules,
|
||||
@@ -13,7 +14,7 @@ import {
|
||||
updateRepoSchedule,
|
||||
} from '@/api/schedules'
|
||||
import { showToast } from '@/lib/toast'
|
||||
import type { ScheduleJobWithRepo } from '@/api/schedules'
|
||||
import type { ListAllRunsParams, ScheduleJobWithRepo, ScheduleRunWithContext } from '@/api/schedules'
|
||||
|
||||
export function useAllSchedules() {
|
||||
return useQuery({
|
||||
@@ -25,6 +26,18 @@ export function useAllSchedules() {
|
||||
})
|
||||
}
|
||||
|
||||
export function useAllScheduleRuns(params: ListAllRunsParams, enabled: boolean = true) {
|
||||
return useQuery({
|
||||
queryKey: ['all-schedule-runs', params],
|
||||
queryFn: async () => {
|
||||
const response = await listAllScheduleRuns(params)
|
||||
return response.runs as ScheduleRunWithContext[]
|
||||
},
|
||||
enabled,
|
||||
refetchInterval: 5000,
|
||||
})
|
||||
}
|
||||
|
||||
export function useRepoSchedules(repoId: number | undefined) {
|
||||
return useQuery({
|
||||
queryKey: ['repo-schedules', repoId],
|
||||
|
||||
Reference in new issue
Block a user