Remove deprecated files and scripts to streamline the codebase
- Deleted unused API test files, RTSP diagnostic scripts, and development utility scripts to reduce clutter. - Removed outdated database schema and modularization proposal documents to maintain focus on current architecture. - Cleaned up configuration files and logging scripts that are no longer in use, enhancing project maintainability.
This commit is contained in:
@@ -5,7 +5,8 @@ import { DashboardHome } from './DashboardHome'
|
||||
import { UserManagement } from './UserManagement'
|
||||
import { ExperimentManagement } from './ExperimentManagement'
|
||||
import { DataEntry } from './DataEntry'
|
||||
import { VisionSystem } from './VisionSystem'
|
||||
// VisionSystem is now loaded as a microfrontend - see RemoteVisionSystem below
|
||||
// import { VisionSystem } from './VisionSystem'
|
||||
import { Scheduling } from './Scheduling'
|
||||
import React, { Suspense } from 'react'
|
||||
import { loadRemoteComponent } from '../lib/loadRemote'
|
||||
@@ -164,6 +165,13 @@ export function DashboardLayout({ onLogout, currentRoute }: DashboardLayoutProps
|
||||
LocalVideoPlaceholder as any
|
||||
) as unknown as React.ComponentType
|
||||
|
||||
const LocalVisionSystemPlaceholder = () => (<div className="p-6">Vision System module not enabled.</div>)
|
||||
const RemoteVisionSystem = loadRemoteComponent(
|
||||
isFeatureEnabled('enableVisionSystemModule'),
|
||||
() => import('visionSystemRemote/App'),
|
||||
LocalVisionSystemPlaceholder as any
|
||||
) as unknown as React.ComponentType
|
||||
|
||||
const renderCurrentView = () => {
|
||||
if (!user) return null
|
||||
|
||||
@@ -200,7 +208,13 @@ export function DashboardLayout({ onLogout, currentRoute }: DashboardLayoutProps
|
||||
case 'data-entry':
|
||||
return <DataEntry />
|
||||
case 'vision-system':
|
||||
return <VisionSystem />
|
||||
return (
|
||||
<ErrorBoundary fallback={<div className="p-6">Failed to load vision system module. Please try again.</div>}>
|
||||
<Suspense fallback={<div className="p-6">Loading vision system module...</div>}>
|
||||
<RemoteVisionSystem />
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
)
|
||||
case 'scheduling':
|
||||
return <Scheduling user={user} currentRoute={currentRoute} />
|
||||
case 'video-library':
|
||||
|
||||
@@ -3,6 +3,7 @@ export type FeatureFlags = {
|
||||
enableVideoModule: boolean
|
||||
enableExperimentModule: boolean
|
||||
enableCameraModule: boolean
|
||||
enableVisionSystemModule: boolean
|
||||
}
|
||||
|
||||
const toBool = (v: unknown, fallback = false): boolean => {
|
||||
@@ -19,6 +20,7 @@ export const featureFlags: FeatureFlags = {
|
||||
enableVideoModule: toBool(import.meta.env.VITE_ENABLE_VIDEO_MODULE ?? false),
|
||||
enableExperimentModule: toBool(import.meta.env.VITE_ENABLE_EXPERIMENT_MODULE ?? false),
|
||||
enableCameraModule: toBool(import.meta.env.VITE_ENABLE_CAMERA_MODULE ?? false),
|
||||
enableVisionSystemModule: toBool(import.meta.env.VITE_ENABLE_VISION_SYSTEM_MODULE ?? false),
|
||||
}
|
||||
|
||||
export const isFeatureEnabled = (flag: keyof FeatureFlags): boolean => featureFlags[flag]
|
||||
|
||||
Reference in New Issue
Block a user