In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "how to set up plug-in Panels and Groups". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Introduction
Horizon allows you to add dashboards, panels, and panel groups without modifying the default settings. Plug-in settings are a mechanism that allows settings to be stored in separate files. These files are read at startup and are used to modify the default settings.
The default location of the dashboard configuration file is openstack_dashboard/enabled, and another directory, openstack_dashboard/local/enabled, is used for local overrides. Both sets of files will be loaded, but the openstack_dashboard/local/enabled settings will override the default settings. These settings apply the alphabetical order of file names. If the same dashboard has configuration files in both enabled and local/enabled, it will be used in local/enabled. Note that because the names of python modules cannot start with a number, these files are usually named with a major underscore and a number, so you can easily control their order.
General pluggable settings
Before describing a specific use case, you can use the following configuration variables in any plug-in settings file.
ADD_EXCEPTIONS New in version 2014.1 (Icehouse).
You can add an exception class dictionary to the configuration variable HORIZON ['exceptions'].
ADD_INSTALLED_APPSNew in version 2014.1 (Icehouse).
This setting is required before the application list is inserted into the INSTALLED_APPS list when you need to expose static files from the plug-in.
ADD_ANGULAR_MODULES New in version 2014.2 (Juno).
When Angular bootstraps, the list of AngularJS modules is loaded. These modules are added to root Horizon application horizon as dependencies.
ADD_JS_FILES New in version 2014.2 (Juno).
The list of javascript source files is introduced into the set of compressed files loaded on each page. This is necessary for AngularJS modules because the modules that are added to ADD_ANGULAR_MODULES are referenced to the javascript source file, so they need to be added to each page.
ADD_JS_SPEC_FILES New in version 2015.1 (Kilo).
A list of javascript specification files will be introduced to integrate with the Jasmine specification runner. Jasmine is a behavior-driven development framework for testing JavaScript code.
ADD_SCSS_FILES New in version 8.0.0 (Liberty).
The list of scss files is introduced into the set of compressed files loaded on each page. One scss file per dashboard is recommended, and if you need to reference an additional scss file for the panel, use @ import.
ADD_XSTATIC_MODULES New in version 14.0.0 (Rocky).
The list of xstatic modules containing javascript and scss files is introduced into the set of compressed files loaded on each page. Related files should be added in ADD_XSTATIC_MODULES rather than in ADD_JS_FILES. The configuration value of this option is a list of tuples, each containing a xstatic module and a list of javascript files to load. For more details, see the BASE_XSTATIC_MODULES comments in openstack_dashboard/utils/settings.py.
Example:
ADD_XSTATIC_MODULES = [('xstatic.pkg.foo', [' foo.js']), ('xstatic.pkg.bar', None),] AUTO_DISCOVER_STATIC_FILES New in version 8.0.0 (Liberty).
If set to True, the JavaScript file and the angular static html template file are automatically found in the static folder of each app in the ADD_INSTALLED_APPS.
The JavaScript source files are sorted according to the naming convention: files with the .module.js extension are listed first, followed by other JavaScript source files.
The JavaScript files used for testing will also be sorted according to the naming convention: files with the .mock.js extension are listed first, followed by files with the .spec.js extension.
If ADD_JS_FILES and / or ADD_JS_SPEC_FILES are also specified, the files listed manually will be appended to the automatically discovered files.
DISABLED New in version 2014.1 (Icehouse).
If set to True, this settings file is not added to the settings.
EXTRA_TABS New in version 14.0.0 (Rocky).
Additional tabs can be added to a tab set by using this setting to implement plug-ins in horizon or other horizon. Additional tabs are displayed after the default tabs defined in the corresponding tab group.
This is a dictionary configuration. The dictionary's key specifies the tag group to which additional tags are added. The key must match the full class name of the target tab group. The dictionary value is a full list of additional label classes (the module name and class name of this value must be separated by a period). The tabs specified through EXTRA_TABS will be displayed in the order in which you are registered.
In some cases, you may want to specify the order of additional tabs, because multiple horizon plug-ins can register additional tabs. In the EXTRA_TABS configuration, you can specify the priority of each tab by using a tuple with priority and tab class name instead of an extra tab full name as a dictionary value. The priority is an integer, and the lower the value, the higher the priority. If a tab forgets to set the priority, its priority will be set to 0.
Example:
EXTRA_TABS = {'openstack_dashboard.dashboards.project.networks.tabs.NetworkDetailsTabs': (' openstack_dashboard.dashboards.project.networks.subnets.tabs.SubnetsTab', 'openstack_dashboard.dashboards.project.networks.ports.tabs.PortsTab',),}
Examples with priority:
EXTRA_TABS = {'openstack_dashboard.dashboards.project.networks.tabs.NetworkDetailsTabs': ((1,' openstack_dashboard.dashboards.project.networks.subnets.tabs.SubnetsTab'), (2, 'openstack_dashboard.dashboards.project.networks.ports.tabs.PortsTab')),} UPDATE_HORIZON_CONFIG New in version 2014.2 (Juno).
The dictionary value you set updates the value in HORIZON_CONFIG.
Plug-in setting of Dashboards New in version 2014.1 (Icehouse).
The following configuration is used to register the dashboard.
DASHBOARD New in version 2014.1 (Icehouse).
This value is the slug field value of dashboard and will be added to HORIZON ['dashboards']. Is a required option.
DEFAULT New in version 2014.1 (Icehouse).
If set to True, this dashboard will be set to the default dashboard.
Example:
To disable dashboard locally, create an openstack_dashboard/local/enabled/_40_dashboard-name.py file with the following:
DASHBOARD =''DISABLED = True
To add a Tuskar-UI (Infrastructure) dashboard, you must first install it, and then create a file openstack_dashboard/local/enabled/_50_tuskar.py:
From tuskar_ui import exceptionsDASHBOARD = 'infrastructure'ADD_INSTALLED_APPS = [' tuskar_ui.infrastructure',] ADD_EXCEPTIONS = {'recoverable': exceptions.RECOVERABLE,' not_found': exceptions.NOT_FOUND, 'unauthorized': exceptions.UNAUTHORIZED,} Panels plug-in setting New in version 2014.1 (Icehouse).
The following configuration is used to register or delete panel.
PANEL New in version 2014.1 (Icehouse).
This value is the slug field value of panel and will be added to the HORIZON_CONFIG. Is a required option.
PANEL_ DASHBOARD New in version 2014.1 (Icehouse).
Specifies the slug value of the dashboard associated with PANEL. Is a required option. This configuration sets panel to the specified dashbaord.
PANEL_ group New in version 2014.1 (Icehouse).
Specifies the slug value of the panel group associated with PANEL. This configuration sets panel to the specified group. If you want this panel not in the group, set this value to "default".
DEFAULT_ panel New in version 2014.1 (Icehouse).
If you set this value, it updates the default panel for PANEL_DASHBOARD.
ADD_ panel New in version 2014.1 (Icehouse).
This value is the Python class of the panel to be added.
REMOVE_ panel New in version 2014.1 (Icehouse).
If set to True,panel, it will be removed from PANEL_DASHBOARD or PANEL_GROUP.
Example:
To add a panel to Admin panel group in Admin dashboard, create an openstack_dashboard/local/enabled/_60_admin_add_panel.py file with the following:
PANEL = 'plugin_panel'PANEL_DASHBOARD =' admin'PANEL_GROUP = 'admin'ADD_PANEL =' test_panels.plugin_panel.panel.PluginPanel'
To delete the Info panel of Admin panel group in Admin dashboard, create an openstack_dashboard/local/enabled/_70_admin_remove_panel.py file with the following:
PANEL = 'info'PANEL_DASHBOARD =' admin'PANEL_GROUP = 'admin'REMOVE_PANEL = True
To change the default panel in Admin dashboard to Instances, create an openstack_dashboard/local/enabled/_80_admin_default_panel.py file with the following:
PANEL = 'instances'PANEL_DASHBOARD =' admin'PANEL_GROUP = 'admin'DEFAULT_PANEL =' instances'Panels group plug-in setting New in version 2014.1 (Icehouse).
The following configuration is used to register or delete panel groups.
PANEL_ group New in version 2014.1 (Icehouse).
This value is the slug field value of the panel group and will be added to the HORIZON_CONFIG. Is a required option.
PANEL_GROUP_NAME New in version 2014.1 (Icehouse).
The name displayed by the PANEL_GROUP. Is a required option.
PANEL_GROUP_DASHBOARD New in version 2014.1 (Icehouse).
Specifies the slug value of the dashboard associated with PANEL_GROUP. Is a required option. This configuration sets the panel group to the specified dashbaord.
Example:
Add a new panel group to Admin dashboard and create an openstack_dashboard/local/enabled/_90_admin_add_panel_group.py with the following:
This is the end of PANEL_GROUP = 'plugin_panel_group'PANEL_GROUP_NAME =' Plugin Panel Group'PANEL_GROUP_DASHBOARD = 'admin'' how to set up plug-in Panels and Groups. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.