mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
2.6 KiB
2.6 KiB
Configuration
Section Config Definition
A new section may be added in src/config/section and in src/config/router.js
import the new section (newconfig.js as example) configuration file and rules to
asyncRouterMap as:
import newconfig from '@/config/section/newconfig'
[ ... snipped ... ]
generateRouterMap(newSection),
API
An existing or new section config/js file must export the following parameters:
name: unique path in URLtitle: the name to be displayed in navigation and breadcrumbicon: the icon to be displayed, from AntD's icon set https://vue.ant.design/components/icon/children: (optional) array of resources sub-navigation under the parent grouppermission: when children are not defined, the array of API to check against allowed auto-discovered APIscolumns: when children is not defined, list of column keyscomponent: when children is not defined, the custom component for rendering the route view
See src/config/section/compute.js and src/config/section/project.js for example.
The children should have:
name: unique path in the URLtitle: the name to be displayed in navigation and breadcrumbicon: the icon to be displayed, from AntD's icon set https://vue.ant.design/components/icon/permission: the array of API to check against auto-discovered APIscolumns: list of column keys for list view renderingcomponent: the custom component for rendering the route viewviewComponent: the custom component for rendering a resource from the default list view (table)actions: arrays of actions/buttons
Action API
The actions defined for a children show up as group of buttons on the default autogen view (that shows tables, actions etc.). Each action item should define:
api: The CloudStack API for the actionicon: the icon to be displayed, from AntD's icon set https://vue.ant.design/components/icon/label: The action button name labellistView: (boolean) whether to show the action button in list view (table)dataView: (boolean) whether to show the action button in resource/data viewgroupAction: Whether the button supports groupable actions when multiple items are selected in the tableoptions: list of API arguments to render/show on auto-generated action formhidden: function that takes in a records and returns a boolean to control if the action button needs to be disabled/hiddencomponent: the custom component to render the action (in a separate route view)popup: (boolean) when true, displays any custom component in a popup modal than in its separate route view