diff --git a/ui/src/components/CloudMonkey/Resource.vue b/ui/src/components/CloudMonkey/Resource.vue index 4f5c379c627..726566c424a 100644 --- a/ui/src/components/CloudMonkey/Resource.vue +++ b/ui/src/components/CloudMonkey/Resource.vue @@ -1,26 +1,6 @@ - - - - - - {{ $t(item.meta.title) }} - - - {{ $route.params.id }} - - - - - {{ $t(tem.meta.title) }} - - - - + @@ -103,72 +83,88 @@ - - - - + + + + + + - - - - - + + + - > - - {{ opt.name }} - - - - - - - - - - + + + + + - - + > + + {{ opt.name }} + + + + + + + + + + + + + + @@ -185,6 +181,7 @@ :loading="loading" v-show="!tableView" /> + @@ -192,10 +189,10 @@ import { api } from '@/api' import { mixinDevice } from '@/utils/mixin.js' import store from '@/store' +import Breadcrumb from '@/components/widgets/Breadcrumb' import CardView from '@/components/widgets/CardView' import ChartCard from '@/components/chart/ChartCard' import DataView from '@/components/widgets/DataView' -import FormView from '@/components/widgets/FormView' import InstanceView from '@/components/widgets/InstanceView' import ListView from '@/components/widgets/ListView' import Status from '@/components/widgets/Status' @@ -203,10 +200,10 @@ import Status from '@/components/widgets/Status' export default { name: 'Resource', components: { + Breadcrumb, CardView, ChartCard, DataView, - FormView, InstanceView, ListView, Status @@ -225,7 +222,6 @@ export default { showAction: false, dataView: false, actions: [], - breadList: [], tableView: true } }, @@ -253,15 +249,7 @@ export default { this.form = this.$form.createForm(this) }, methods: { - getBreadcrumb () { - this.breadList = [] - this.name = this.$route.name - this.$route.matched.forEach((item) => { - this.breadList.push(item) - }) - }, fetchData (search = '') { - this.getBreadcrumb() this.routeName = this.$route.name if (!this.routeName) { this.routeName = this.$route.matched[this.$route.matched.length - 1].parent.name diff --git a/ui/src/components/page/GlobalHeader.vue b/ui/src/components/page/GlobalHeader.vue index 30e746f5e44..a92189d2a28 100644 --- a/ui/src/components/page/GlobalHeader.vue +++ b/ui/src/components/page/GlobalHeader.vue @@ -73,7 +73,6 @@ import UserMenu from '../tools/UserMenu' import SMenu from '../menu/' import Logo from '../tools/Logo' -import Breadcrumb from '@/components/tools/Breadcrumb' import { mixin } from '@/utils/mixin.js' @@ -82,8 +81,7 @@ export default { components: { SMenu, Logo, - UserMenu, - Breadcrumb + UserMenu }, mixins: [mixin], props: { diff --git a/ui/src/components/page/PageHeader.vue b/ui/src/components/page/PageHeader.vue index 951603de8e1..9caaccbbee2 100644 --- a/ui/src/components/page/PageHeader.vue +++ b/ui/src/components/page/PageHeader.vue @@ -34,7 +34,7 @@ - - diff --git a/ui/src/components/widgets/Breadcrumb.vue b/ui/src/components/widgets/Breadcrumb.vue new file mode 100644 index 00000000000..d8a74d2bfdc --- /dev/null +++ b/ui/src/components/widgets/Breadcrumb.vue @@ -0,0 +1,65 @@ + + + + + + + {{ $t(item.meta.title) }} + + + {{ $route.params.id }} + + + + + {{ $t(item.meta.title) }} + + + + + + + + diff --git a/ui/src/components/widgets/FormView.vue b/ui/src/components/widgets/FormView.vue index 5407330e8bb..c1fadb1e712 100644 --- a/ui/src/components/widgets/FormView.vue +++ b/ui/src/components/widgets/FormView.vue @@ -1,12 +1,12 @@ @@ -17,11 +17,10 @@ - 12 ? 'small' : 'medium'" + size="small" :loading="loading" :columns="columns" :dataSource="items" diff --git a/ui/src/config/router.js b/ui/src/config/router.js index 0b21624ad49..b8f56e4ef23 100644 --- a/ui/src/config/router.js +++ b/ui/src/config/router.js @@ -26,7 +26,7 @@ export function generateRouterMap (section) { map.meta.permission = section.children[0].permission map.children = [] for (const child of section.children) { - map.children.push({ + var route = { name: child.name, path: '/' + child.name, meta: { @@ -54,7 +54,8 @@ export function generateRouterMap (section) { component: child.viewComponent ? child.viewComponent : child.component } ] - }) + } + map.children.push(route) } } else { map.hideChildrenInMenu = true diff --git a/ui/src/config/section/infra.js b/ui/src/config/section/infra.js index 7a958916f34..b78c1fc6dff 100644 --- a/ui/src/config/section/infra.js +++ b/ui/src/config/section/infra.js @@ -10,7 +10,16 @@ export default { icon: 'global', permission: [ 'listZones', 'listZonesMetrics' ], component: () => import('@/components/CloudMonkey/Resource.vue'), - columns: [ 'name', 'allocationstate', 'networktype', 'guestcidraddress' ] + columns: [ 'name', 'allocationstate', 'networktype', 'guestcidraddress' ], + actions: [ + { + api: 'createZone', + icon: 'plus', + label: 'Add Zone', + listView: true, + component: () => import('@/views/infra/ZoneWizard.vue') + } + ] }, { name: 'pod', diff --git a/ui/src/views/infra/Zone.vue b/ui/src/views/infra/Zone.vue deleted file mode 100644 index 7a611b87077..00000000000 --- a/ui/src/views/infra/Zone.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/ui/src/views/infra/ZoneWizard.vue b/ui/src/views/infra/ZoneWizard.vue new file mode 100644 index 00000000000..557ab723a80 --- /dev/null +++ b/ui/src/views/infra/ZoneWizard.vue @@ -0,0 +1,27 @@ + + + + + + + + + + + + +