33 lines
787 B
TypeScript
33 lines
787 B
TypeScript
|
|
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';
|
||
|
|
import type { ViewKey } from './types';
|
||
|
|
|
||
|
|
export function App() {
|
||
|
|
const [current, setCurrent] = useState<ViewKey>('inventory');
|
||
|
|
|
||
|
|
const renderView = () => {
|
||
|
|
switch (current) {
|
||
|
|
case 'topology':
|
||
|
|
return <TopologyView />;
|
||
|
|
case 'inventory':
|
||
|
|
return <InventoryView />;
|
||
|
|
case 'ips':
|
||
|
|
return <IPsView />;
|
||
|
|
case 'discovery':
|
||
|
|
return <DiscoveryJobsView />;
|
||
|
|
default:
|
||
|
|
return <InventoryView />;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
return (
|
||
|
|
<>
|
||
|
|
{renderView()}
|
||
|
|
</>
|
||
|
|
);
|
||
|
|
}
|