From 55f70be3816505678139524c64248d4f4f69e60b Mon Sep 17 00:00:00 2001 From: Itxaka Date: Fri, 22 Mar 2019 12:45:25 +0100 Subject: [PATCH] Add heat dashboard if available to horizon Currently there is no enabling of the heat dashboard if its installed on the horizon image. This patch add an extra conf var that allows several dashboards to be added and will try to find and enable them on start If the panel dirs dont exists, it will do nothing This patch add the extra heat_dashboard and includes the existing neutron_taas_dashboard into the new config Change-Id: Ibcc4da166d907f3cb842bfc45d842a650361a2d8 --- horizon/templates/bin/_horizon.sh.tpl | 14 ++++++++++---- horizon/values.yaml | 8 ++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/horizon/templates/bin/_horizon.sh.tpl b/horizon/templates/bin/_horizon.sh.tpl index 4dbfc0eede..000bcbfe53 100644 --- a/horizon/templates/bin/_horizon.sh.tpl +++ b/horizon/templates/bin/_horizon.sh.tpl @@ -46,11 +46,17 @@ function start () { rm -rf /var/run/apache2/* APACHE_DIR="apache2" - # Add TaaS dashboard panel if available - TAAS_PANEL="${SITE_PACKAGES_ROOT}/neutron_taas_dashboard/enabled/_90_project_tapservices_panel.py" - if [ -f ${TAAS_PANEL} ]; then - ln -s ${TAAS_PANEL} ${SITE_PACKAGES_ROOT}/openstack_dashboard/local/enabled/_90_project_tapservices_panel.py + # Add extra panels if available + {{- range .Values.conf.horizon.extra_panels }} + PANEL_DIR="${SITE_PACKAGES_ROOT}/{{ . }}/enabled" + if [ -d ${PANEL_DIR} ];then + for panel in `ls -1 ${PANEL_DIR}/_[1-9]*.py` + do + ln -s ${panel} ${SITE_PACKAGES_ROOT}/openstack_dashboard/local/enabled/$(basename ${panel}) + done fi + unset PANEL_DIR + {{- end }} # If the image has support for it, compile the translations if type -p gettext >/dev/null 2>/dev/null; then diff --git a/horizon/values.yaml b/horizon/values.yaml index 8bd1dd6248..0334f61259 100644 --- a/horizon/values.yaml +++ b/horizon/values.yaml @@ -1952,6 +1952,14 @@ conf: 'os_compute_api:servers:stop': 'rule:admin_or_owner' 'os_compute_api:servers:trigger_crash_dump': 'rule:admin_or_owner' 'os_compute_api:servers:update': 'rule:admin_or_owner' + # list of panels to enable for horizon + # this requires that the panels are already installed in the horizon image, if they are not + # nothing will be added + # the name of the panel should be the name of the dir where the panel is installed + # for example heat_dashboard, cloudkittydashboard or neutron_taas_dashboard + extra_panels: + - heat_dashboard + - neutron_taas_dashboard dependencies: dynamic: