Spaces:
Running
Running
Commit Β·
42ea8a0
1
Parent(s): 7c87b0c
Add pre-populated demo cases and sample images for UI dashboard
Browse filesFiles changed (6)
9 unmodified lines10111213141516179 unmodified lines// ββ Mock Backend Interceptor βββββββββββββββββββββββββββββββββββββββββββ// This simulates the AI backend purely in the browser for the public UI democonst originalFetch = window.fetch;let mockNextId = 1;let mockCases = {};window.fetch = async (url, options = {}) => {// Only intercept our API calls9 unmodified lines101112131415161718192021222324252627282930313233343536373839404142434445464748495051529 unmodified lines// ββ Mock Backend Interceptor βββββββββββββββββββββββββββββββββββββββββββ// This simulates the AI backend purely in the browser for the public UI democonst originalFetch = window.fetch;let mockNextId = 104;// Pre-populate some demo caseslet mockCases = {101: {case: { id: 101, case_number: "INV-2026-042", officer_name: "Sgt. Miller", location: "Hwy 101 N", incident_date: "2026-03-01", status: "complete", created_at: "2026-03-01T08:14:00Z", photo_count: 3 },photos: [{ id: "img_demo_1", filename: "01a252ba0708_car_8.jpg", blob_url: "images/demo/01a252ba0708_car_8.jpg" },{ id: "img_demo_2", filename: "bb7313c8f601_car_10.jpg", blob_url: "images/demo/bb7313c8f601_car_10.jpg" },{ id: "img_demo_3", filename: "413495119937_accident_6.jpg", blob_url: "images/demo/413495119937_accident_6.jpg" }],analyses: [{ filename: "01a252ba0708_car_8.jpg", raw_analysis: "[AI Observation]\nSubject: Silver SUV\nAction: Severe front-end deformation observed consistent with high-speed impact. Deployment of airbags visible." }],violations: [{ rule_id: "Article 18", rule_title: "Failure to Leave Safe Distance", severity: "HIGH", confidence: 0.96, party_label: "Silver SUV", evidence_summary: "Front end crush profile indicates impact from rear-ending the leading vehicle." }],fault_analysis: { determined: true, primary_fault_party: "Silver SUV", probable_cause: "Following too closely.", fault_distribution_json: { "Silver SUV": 100, "Other": 0 }, overall_confidence: 0.94, analysis_summary: "Based on front-end damage, Silver SUV is at fault." }},102: {case: { id: 102, case_number: "INV-2026-043", officer_name: "Off. Davis", location: "Downtown Intersection", incident_date: "2026-03-02", status: "ready", created_at: "2026-03-02T10:30:00Z", photo_count: 2 },photos: [{ id: "img_demo_4", filename: "a358e234c528_accident_scene_2.jpg", blob_url: "images/demo/a358e234c528_accident_scene_2.jpg" },{ id: "img_demo_5", filename: "e05bd82a2cfa_accident_9.jpg", blob_url: "images/demo/e05bd82a2cfa_accident_9.jpg" }],analyses: [],violations: [],fault_analysis: null},103: {case: { id: 103, case_number: "INV-2026-044", officer_name: "Sgt. Miller", location: "Main St Bridge", incident_date: "2026-03-02", status: "new", created_at: "2026-03-02T14:45:00Z", photo_count: 0 },photos: [],analyses: [],violations: [],fault_analysis: null}};window.fetch = async (url, options = {}) => {// Only intercept our API calls
images/demo/01a252ba0708_car_8.jpgAdded

images/demo/413495119937_accident_6.jpgAdded

images/demo/a358e234c528_accident_scene_2.jpgAdded

images/demo/bb7313c8f601_car_10.jpgAdded

images/demo/e05bd82a2cfa_accident_9.jpgAdded

js/alt_app.js+37-2