2026-08-03 22:06:00 +00:00
|
|
|
import { useState } from 'react';
|
|
|
|
|
import './App.css';
|
|
|
|
|
import { TopologyView } from './pages/TopologyView';
|
|
|
|
|
import { InventoryView } from './pages/InventoryView';
|
|
|
|
|
import { IPsView } from './pages/IPsView';
|
|
|
|
|
import { DiscoveryJobsView } from './pages/DiscoveryJobsView';
|
2026-08-03 22:22:59 +00:00
|
|
|
import { ServicesView } from './pages/ServicesView';
|
2026-08-03 22:06:00 +00:00
|
|
|
import type { ViewKey } from './types';
|
|
|
|
|
|
|
|
|
|
export function App() {
|
|
|
|
|
const [current, setCurrent] = useState<ViewKey>('inventory');
|
|
|
|
|
|
2026-08-03 22:22:59 +00:00
|
|
|
const commonProps = { onNavigate: setCurrent };
|
|
|
|
|
|
2026-08-03 22:06:00 +00:00
|
|
|
const renderView = () => {
|
|
|
|
|
switch (current) {
|
|
|
|
|
case 'topology':
|
2026-08-03 22:22:59 +00:00
|
|
|
return <TopologyView {...commonProps} />;
|
2026-08-03 22:06:00 +00:00
|
|
|
case 'inventory':
|
2026-08-03 22:22:59 +00:00
|
|
|
return <InventoryView {...commonProps} />;
|
2026-08-03 22:06:00 +00:00
|
|
|
case 'ips':
|
2026-08-03 22:22:59 +00:00
|
|
|
return <IPsView {...commonProps} />;
|
2026-08-03 22:06:00 +00:00
|
|
|
case 'discovery':
|
2026-08-03 22:22:59 +00:00
|
|
|
return <DiscoveryJobsView {...commonProps} />;
|
|
|
|
|
case 'services':
|
|
|
|
|
return <ServicesView {...commonProps} />;
|
2026-08-03 22:06:00 +00:00
|
|
|
default:
|
2026-08-03 22:22:59 +00:00
|
|
|
return <InventoryView {...commonProps} />;
|
2026-08-03 22:06:00 +00:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2026-08-03 22:22:59 +00:00
|
|
|
return renderView();
|
2026-08-03 22:06:00 +00:00
|
|
|
}
|