fix(ui): pass governance project context
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Failing after 2m48s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped

This commit is contained in:
Your Name
2026-06-29 12:16:26 +08:00
parent f4ec19a545
commit 305c5d6ab2
3 changed files with 6 additions and 2 deletions

View File

@@ -26,6 +26,7 @@ import {
// =============================================================================
const API_BASE = process.env.NEXT_PUBLIC_API_URL ?? ''
const GOVERNANCE_PROJECT_ID = 'awoooi'
const PAGE_SIZE = 20
// =============================================================================
@@ -63,6 +64,7 @@ interface EventsApiResponse {
function buildQueryString(filter: EventsFilter, page: number): string {
const params = new URLSearchParams()
params.set('project_id', GOVERNANCE_PROJECT_ID)
params.set('page', String(page))
params.set('size', String(PAGE_SIZE))
const eventId = filter.eventId.trim()

View File

@@ -28,6 +28,7 @@ import { GlassCard } from '@/components/ui/glass-card'
// =============================================================================
const API_BASE = process.env.NEXT_PUBLIC_API_URL ?? ''
const GOVERNANCE_PROJECT_ID = 'awoooi'
// =============================================================================
// Types
@@ -84,7 +85,7 @@ export function QueueTab() {
const fetchQueue = () => {
setLoading(true)
fetch(`${API_BASE}/api/v1/ai/governance/queue?dispatch_status=pending`)
fetch(`${API_BASE}/api/v1/ai/governance/queue?dispatch_status=pending&project_id=${encodeURIComponent(GOVERNANCE_PROJECT_ID)}`)
.then(r => r.ok ? r.json() : Promise.reject(r.status))
.then((d: QueueApiResponse) => {
setPending(d.items ?? [])

View File

@@ -25,6 +25,7 @@ import { GlassCard } from '@/components/ui/glass-card'
// =============================================================================
const API_BASE = process.env.NEXT_PUBLIC_API_URL ?? ''
const GOVERNANCE_PROJECT_ID = 'awoooi'
// =============================================================================
// Types
@@ -1009,7 +1010,7 @@ export function SloTab() {
useEffect(() => {
let cancelled = false
setSummaryLoading(true)
fetch(`${API_BASE}/api/v1/ai/governance/summary?days=30`)
fetch(`${API_BASE}/api/v1/ai/governance/summary?days=30&project_id=${encodeURIComponent(GOVERNANCE_PROJECT_ID)}`)
.then(r => r.ok ? r.json() : Promise.reject(r.status))
.then(d => { if (!cancelled) { setSummaryData(d); setSummaryError(false) } })
.catch(() => { if (!cancelled) setSummaryError(true) })