11import { ARTIFACT_OBJECT , NODE_OBJECT , PROPOSED_CHANGES_OBJECT } from "@/config/constants" ;
22import { RequireAuth } from "@/entities/authentication/ui/useAuth" ;
33import { BranchesProvider } from "@/entities/branches/ui/branches-provider" ;
4- import { constructPathForIpam } from "@/entities/ipam/common/utils" ;
5- import { IPAM_ROUTE , IP_ADDRESS_GENERIC , IP_PREFIX_GENERIC } from "@/entities/ipam/constants" ;
4+ import { constructPathForIpam } from "@/entities/ipam/utils" ;
65import { RESOURCE_GENERIC_KIND } from "@/entities/resource-manager/constants" ;
76import { SchemaProvider } from "@/entities/schema/ui/providers/schema-provider" ;
87import { constructPath } from "@/shared/api/rest/fetch" ;
@@ -379,21 +378,7 @@ export const router = createBrowserRouter([
379378 } ,
380379 } ,
381380 {
382- path : "/ipam/namespaces" ,
383- lazy : ( ) => import ( "@/pages/ipam/namespaces/ip-namespace-list-page" ) ,
384- handle : {
385- breadcrumb : ( ) => {
386- return {
387- type : "link" ,
388- label : "namespaces" ,
389- to : constructPath ( "/ipam/namespaces" ) ,
390- } satisfies BreadcrumbItem ;
391- } ,
392- } ,
393- } ,
394- {
395- path : IPAM_ROUTE . INDEX ,
396- lazy : ( ) => import ( "@/pages/ipam/layout" ) ,
381+ path : "ipam" ,
397382 handle : {
398383 breadcrumb : ( ) => {
399384 return {
@@ -405,72 +390,34 @@ export const router = createBrowserRouter([
405390 } ,
406391 children : [
407392 {
408- index : true ,
409- lazy : ( ) => import ( "@/entities/ipam/ipam-router" ) ,
410- } ,
411- {
412- path : IPAM_ROUTE . ADDRESSES ,
413- lazy : ( ) => import ( "@/entities/ipam/ipam-router" ) ,
393+ path : "namespaces" ,
414394 handle : {
415395 breadcrumb : ( ) => {
416396 return {
417397 type : "link" ,
418- label : "IP Addresses " ,
419- to : constructPathForIpam ( "/ipam/addresses " ) ,
420- } ;
398+ label : "namespaces " ,
399+ to : constructPath ( "/ipam/namespaces " ) ,
400+ } satisfies BreadcrumbItem ;
421401 } ,
422402 } ,
423403 children : [
424404 {
425- path : ":ip_address" ,
426- lazy : ( ) => import ( "@/entities/ipam/ipam-router" ) ,
427- handle : {
428- breadcrumb : ( match : UIMatch ) => {
429- return {
430- type : "select" ,
431- value : match . params . ip_address ,
432- kind : IP_ADDRESS_GENERIC ,
433- } ;
434- } ,
435- } ,
436- } ,
437- ] ,
438- } ,
439- {
440- path : IPAM_ROUTE . PREFIXES ,
441- lazy : ( ) => import ( "@/entities/ipam/ipam-router" ) ,
442- handle : {
443- breadcrumb : ( ) => {
444- return {
445- type : "link" ,
446- label : "IP Prefixes" ,
447- to : constructPathForIpam ( "/ipam/prefixes" ) ,
448- } ;
405+ index : true ,
406+ lazy : ( ) => import ( "@/pages/ipam/ipam-namespace-list-page" ) ,
449407 } ,
450- } ,
451- children : [
452408 {
453- path : ":prefix" ,
454- lazy : ( ) => import ( "@/entities/ipam/ipam-router" ) ,
455- handle : {
456- breadcrumb : ( match : UIMatch ) => {
457- return {
458- type : "select" ,
459- value : match . params . prefix ,
460- kind : IP_PREFIX_GENERIC ,
461- } ;
462- } ,
463- } ,
409+ path : ":objectKind" ,
410+ lazy : ( ) => import ( "@/pages/objects/layout" ) ,
464411 children : [
465412 {
466- path : ":ip_address " ,
467- lazy : ( ) => import ( "@/entities/ipam/ipam-router " ) ,
413+ path : ":objectid " ,
414+ lazy : ( ) => import ( "@/pages/objects/object-details " ) ,
468415 handle : {
469416 breadcrumb : ( match : UIMatch ) => {
470417 return {
471418 type : "select" ,
472- value : match . params . ip_address ,
473- kind : IP_ADDRESS_GENERIC ,
419+ value : match . params . objectid ,
420+ kind : match . params . objectKind ,
474421 } ;
475422 } ,
476423 } ,
@@ -481,6 +428,47 @@ export const router = createBrowserRouter([
481428 } ,
482429 ] ,
483430 } ,
431+ {
432+ path : "ipam" ,
433+ lazy : ( ) => import ( "@/pages/ipam/ipam-layout" ) ,
434+ handle : {
435+ breadcrumb : ( ) => {
436+ return {
437+ type : "link" ,
438+ label : "IP Address Manager" ,
439+ to : constructPathForIpam ( "/ipam" ) ,
440+ } as BreadcrumbItem ;
441+ } ,
442+ } ,
443+ children : [
444+ {
445+ index : true ,
446+ lazy : ( ) => import ( "@/pages/ipam/ipam-ip-prefixes-list-page" ) ,
447+ } ,
448+ {
449+ path : "ip_prefixes" ,
450+ lazy : ( ) => import ( "@/pages/ipam/ipam-ip-prefixes-list-page" ) ,
451+ } ,
452+ {
453+ path : "ip_addresses" ,
454+ lazy : ( ) => import ( "@/pages/ipam/ipam-ip-addresses-list-page" ) ,
455+ } ,
456+ {
457+ path : ":objectKind/:objectId" ,
458+ lazy : ( ) => import ( "@/pages/ipam/ipam-details-layout" ) ,
459+ children : [
460+ {
461+ index : true ,
462+ lazy : ( ) => import ( "@/pages/ipam/ipam-details-page" ) ,
463+ } ,
464+ {
465+ path : ":relationshipName" ,
466+ lazy : ( ) => import ( "@/pages/ipam/ipam-details-relationship-page" ) ,
467+ } ,
468+ ] ,
469+ } ,
470+ ] ,
471+ } ,
484472 {
485473 path : "role-management" ,
486474 lazy : ( ) => import ( "@/pages/role-management" ) ,
0 commit comments