MCPcopy Create free account
hub / github.com/apache/cloudstack / generateRouterMap

Function generateRouterMap

ui/src/config/router.js:47–192  ·  view source on GitHub ↗
(section)

Source from the content-addressed store, hash-verified

45import cloudian from '@/config/section/plugin/cloudian'
46
47function generateRouterMap (section) {
48 var map = {
49 name: section.name,
50 path: '/' + section.name,
51 hidden: 'show' in section ? !section.show() : section.hidden,
52 meta: {
53 title: section.title,
54 icon: section.icon,
55 docHelp: vueProps.$applyDocHelpMappings(section.docHelp),
56 searchFilters: section.searchFilters,
57 related: section.related,
58 section: true
59 },
60 component: shallowRef(RouteView)
61 }
62
63 if (section.children && section.children.length > 0) {
64 map.children = []
65 for (const child of section.children) {
66 if ('show' in child && !child.show()) {
67 continue
68 }
69 var component = child.component ? child.component : shallowRef(AutogenView)
70 var route = {
71 name: child.name,
72 path: '/' + child.name,
73 hidden: child.hidden,
74 meta: {
75 title: child.title,
76 name: child.name,
77 icon: child.icon,
78 docHelp: vueProps.$applyDocHelpMappings(child.docHelp),
79 permission: child.permission,
80 resourceType: child.resourceType,
81 filters: child.filters,
82 params: child.params ? child.params : {},
83 columns: child.columns,
84 details: child.details,
85 searchFilters: child.searchFilters,
86 related: child.related,
87 actions: child.actions,
88 tabs: child.tabs,
89 customParamHandler: child.customParamHandler
90 },
91 component: component,
92 hideChildrenInMenu: true,
93 children: [
94 {
95 path: '/' + child.name + '/:id(.*)',
96 hidden: child.hidden,
97 meta: {
98 title: child.title,
99 name: child.name,
100 icon: child.icon,
101 docHelp: vueProps.$applyDocHelpMappings(child.docHelp),
102 permission: child.permission,
103 resourceType: child.resourceType,
104 params: child.params ? child.params : {},

Callers 1

asyncRouterMapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected