From 55f30c4c68040b655272db42a9ba885e8bc7541e Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Wed, 13 Jan 2016 14:41:49 -0600 Subject: [PATCH] Add template option for the default horizon panel The change adds the option to set the default panel within horizon. this change is useful when a tenant has many hundreds of vms and running into horizon login slowness due to poorly crafted api calls and sql statements. Change-Id: If3da12a466d4953a176ec8e45499bf1cd9452ae5 Closes-Bug: #1533830 Signed-off-by: Kevin Carter --- defaults/main.yml | 3 +++ tasks/horizon_post_install.yml | 1 + tasks/horizon_pre_install.yml | 1 + templates/80_admin_default_panel.py.j2 | 4 ++++ 4 files changed, 9 insertions(+) create mode 100644 templates/80_admin_default_panel.py.j2 diff --git a/defaults/main.yml b/defaults/main.yml index f89a9ea5..4b46d565 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -128,6 +128,9 @@ horizon_enable_neutron_lbaas: False ## Swift horizon_swift_file_transfer_chunk_size: 524288 +## Panel +horizon_default_panel: overview + horizon_webroot: / horizon_listen_ports: diff --git a/tasks/horizon_post_install.yml b/tasks/horizon_post_install.yml index 9a28bfb7..d8175266 100644 --- a/tasks/horizon_post_install.yml +++ b/tasks/horizon_post_install.yml @@ -42,6 +42,7 @@ with_items: - { src: "horizon_local_settings.py.j2", dest: "/etc/horizon/local_settings.py", mode: "0644" } - { src: "horizon-manage.py.j2", dest: "{{ horizon_bin }}/horizon-manage.py", mode: "0755" } + - { src: "80_admin_default_panel.py.j2", dest: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled/_80_admin_default_panel.py", mode: "0755" } notify: Restart apache2 tags: - horizon-configs diff --git a/tasks/horizon_pre_install.yml b/tasks/horizon_pre_install.yml index 96f925f2..acbef044 100644 --- a/tasks/horizon_pre_install.yml +++ b/tasks/horizon_pre_install.yml @@ -164,6 +164,7 @@ - { path: "{{ horizon_lib_dir }}/static", mode: "2755" } - { path: "{{ horizon_lib_dir }}/openstack_dashboard", mode: "2755" } - { path: "{{ horizon_lib_dir }}/openstack_dashboard/local", mode: "2755" } + - { path: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled", mode: "2755" } tags: - horizon-dirs diff --git a/templates/80_admin_default_panel.py.j2 b/templates/80_admin_default_panel.py.j2 new file mode 100644 index 00000000..2ab8b5b3 --- /dev/null +++ b/templates/80_admin_default_panel.py.j2 @@ -0,0 +1,4 @@ +PANEL = '{{ horizon_default_panel }}' +PANEL_DASHBOARD = 'admin' +PANEL_GROUP = 'admin' +DEFAULT_PANEL = '{{ horizon_default_panel }}'