A panel is a UI element that exposes a core function of the system. Unlike widgets, panels are often mounted and unmounted as needed, whereas widgets usually remain on the screen permanently. Panels are typically used with the App bar widget.
Available panels
Each panel in the SDK contains a standard interface, a set of features, and configurations you can use to customize the panel.
The available panels are:
- Documentation panel
- Knowledgebase panel
- Local machine importer panel
- Admin Center panel
- Data Center panel
- Processing Center panel
- Resource Center panel
Mount a panel
To display any of the OS Center panels or the Local machine importer panel in the app, use the mountPanel() method.
[Tip] To see a list of all mounted panels in the console, run aiware.store.getState().panels.
- Call
aiware.mountPanel().
Parameters
The parameters of mountPanel() are an object with these properties:
| Description | Required | Type | Description |
|---|
| panelID | True | String |
The panel ID. Specified as one of the following:
- DATA_CENTER_IMPORTER
- ADMIN_CENTER
- DATA_CENTER
- PROCESSING_CENTER
- RESOURCE_CENTER
|
| microFrontend | True | Object | The panel properties that handle or interact with data. |
| panelConfig | True | Object | The appearance options for the panel. These are unique to each panel. |
microFrontend
| Name | Required | Type | Description |
|---|
| name | True | String |
The name of the component. Must correspond to the panelID. Specified as one of the following:
- DATA_CENTER_IMPORTER
- ADMIN_CENTER
- DATA_CENTER
- PROCESSING_CENTER
- RESOURCE_CENTER
|
panelConfig
| Name | Required | Type | Description |
|---|
| type | True | String | The panel type must be 'APP_BAR_PANEL_TEMPLATE'. |
| marginTop | False | Number | The top margin of the panel. |
| marginStart | False | Number | The right margin of the panel. |
| size | False | String | The width of the panel in pixels. Can be small, medium, large, xlarge, or xxlarge. Each value is defined in getWidth(). |
| zIndex | False | Number | The z-index of the panel. |
| dimmed | False | Number | The number of panels that slide over this panel in the UI. The number affects how much this panel is dimmed. |
| | | |
This example defines microFrontend and panelConfig, then it mounts the Local machine importer panel.
const microFrontend = {
name: 'DATA_CENTER_IMPORTER',
config: {
name: 'Local Importer',
},
};
const panelConfig = {
type: 'APP_BAR_PANEL_TEMPLATE',
marginTop: 55,
marginStart: 80,
size: 'large',
zIndex: 1000,
dimmed: 0,
};
aiware.mountPanel({
panelId: 'DATA_CENTER_IMPORTER',
microFrontend: microFrontend,
panelConfig: panelConfig,
});
Unmount a panel
To stop a panel from displaying in the app, use the hidePanel() method.
Parameters
The parameters of hidePanel() are:
| Name | Required | Type | Description |
|---|
| panelId | True | String |
The ID of the panel to unmount.
|