feat: maintenance flows frontend foundation - types, API clients, sidebar, library filter
- Add maintenance.ts types: TargetEntry, TargetList, MaintenanceSchedule, BatchLaunch - Add targetListsApi and maintenanceSchedulesApi/batchLaunchApi clients - Extend TreeType union with 'maintenance' in tree.ts - Update getTreeNavigatePath/getTreeEditorPath in routing.ts for maintenance - Sidebar: track maintenance count and add Maintenance sub-nav item - TreeLibraryPage: add maintenance to typeFilter state, URL sync, and tab buttons - TreeGridView, TreeListView, TreeTableView: add amber Wrench maintenance badge Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
24
frontend/src/api/maintenanceSchedules.ts
Normal file
24
frontend/src/api/maintenanceSchedules.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { apiClient } from './client'
|
||||
import type {
|
||||
MaintenanceSchedule,
|
||||
MaintenanceScheduleCreate,
|
||||
MaintenanceScheduleUpdate,
|
||||
BatchLaunchRequest,
|
||||
BatchLaunchResponse,
|
||||
} from '@/types'
|
||||
|
||||
export const maintenanceSchedulesApi = {
|
||||
getForTree: (treeId: string): Promise<MaintenanceSchedule> =>
|
||||
apiClient.get(`/maintenance-schedules/tree/${treeId}`).then(r => r.data),
|
||||
|
||||
create: (data: MaintenanceScheduleCreate): Promise<MaintenanceSchedule> =>
|
||||
apiClient.post('/maintenance-schedules', data).then(r => r.data),
|
||||
|
||||
update: (id: string, data: MaintenanceScheduleUpdate): Promise<MaintenanceSchedule> =>
|
||||
apiClient.patch(`/maintenance-schedules/${id}`, data).then(r => r.data),
|
||||
}
|
||||
|
||||
export const batchLaunchApi = {
|
||||
launch: (data: BatchLaunchRequest): Promise<BatchLaunchResponse> =>
|
||||
apiClient.post('/sessions/batch', data).then(r => r.data),
|
||||
}
|
||||
Reference in New Issue
Block a user