mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
feat(schedules): add unread run report notifications and run search
This commit is contained in:
1 parent
7cac8baade
commit
5a8a81419c
43 files changed
+2463
-798
No files matched your search
@@ -24,6 +24,10 @@ import {
|
||||
listAllScheduleJobsWithRepos,
|
||||
listScheduleRunArtifactsByJob,
|
||||
listAllScheduleRuns,
|
||||
listUnreadScheduleRuns,
|
||||
countUnreadScheduleRuns,
|
||||
markScheduleRunViewed,
|
||||
markAllScheduleRunsViewed,
|
||||
listEnabledScheduleJobs,
|
||||
listScheduleJobIdsByRepo,
|
||||
listScheduleJobsByRepo,
|
||||
@@ -35,7 +39,7 @@ import {
|
||||
updateScheduleRunMetadata,
|
||||
updateScheduleRunWorktree,
|
||||
} from '../db/schedules'
|
||||
import type { ListAllRunsOptions, ScheduleRunWithContext } from '../db/schedules'
|
||||
import type { ListAllRunsOptions, ScheduleRunWithContext, ScheduleRunWithUnreadPreview } from '../db/schedules'
|
||||
import {
|
||||
buildCreateSchedulePersistenceInput,
|
||||
buildUpdatedSchedulePersistenceInput,
|
||||
@@ -373,6 +377,22 @@ export class ScheduleService {
|
||||
return listAllScheduleRuns(this.db, { ...options, limit, offset })
|
||||
}
|
||||
|
||||
listUnreadRuns(limit: number): ScheduleRunWithUnreadPreview[] {
|
||||
return listUnreadScheduleRuns(this.db, limit)
|
||||
}
|
||||
|
||||
countUnreadRuns(): { total: number; failed: number } {
|
||||
return countUnreadScheduleRuns(this.db)
|
||||
}
|
||||
|
||||
markRunViewed(runId: number): boolean {
|
||||
return markScheduleRunViewed(this.db, runId)
|
||||
}
|
||||
|
||||
markAllRunsViewed(): number {
|
||||
return markAllScheduleRunsViewed(this.db)
|
||||
}
|
||||
|
||||
async recoverRunningRuns(): Promise<void> {
|
||||
const runningRuns = listRunningScheduleRuns(this.db)
|
||||
|
||||
|
||||
Reference in new issue
Block a user