Commit Graph

25 Commits

Author SHA1 Message Date
Marek a11aa7ff62 Forwards LOGOUT_URL to templates.
Uses the openstack context preprocessor to pass
the LOGOUT_URL from settings to templates and
changes the 'Sign out' menu entry to redirect to it
instead of the logout view directly.

closes-bug: #1747149
Change-Id: Id17ffca6b5e24779433c3f19d009bb2a77f7b901
2019-09-20 11:51:48 +02:00
Akihiro Motoki 2f1e1899d3 Define default settings explicitly (openstack_dashboard 5/5)
This commit mainly covers settings in the remaining files
under openstack_dashboard.

Note that HORIZON_CONFIG, horizon and openstack_auth are not covered.
They will be covered by follow-up patches.

Part of blueprint ini-based-configuration
Change-Id: Ibd70e030445a073d9a62da9867850f4893135a89
2019-07-08 18:20:32 +09:00
Ivan Kolodyazhny 2e52e4a4e0 Remove deprecated SHOW_KEYSTONE_V2_RC config option
SHOW_KEYSTONE_V2_RC is deprecated since Stein release and it's safe
to remove it now.

Keystone v2 support removal will be implemented in a follow up patch.

Change-Id: Ib3098789a3aef47f4f4b84fd56f03376ce2ea96f
2019-05-14 11:55:53 +00:00
Akihiro Motoki ac7ac272b3 pylint: fix several coding convention violations
openstack_dashboard/context_processors.py:94:15: C0122: Comparison should be link['url'] != 'horizon:project:api_access:openrcv2' (misplaced-comparison-constant)
openstack_dashboard/settings.py:467:4: C0412: Imports from package horizon are not grouped (ungrouped-imports)
openstack_dashboard/enabled/_1370_project_vg_snapshots.py:9:0: C0301: Line too long (86/80) (line-too-long)
openstack_dashboard/enabled/_1360_project_volume_groups.py:9:0: C0301: Line too long (85/80) (line-too-long)
openstack_dashboard/usage/base.py:62:8: W0106: Expression "[instance_list.extend(u.server_usages) for u in self.usage_list]" is assigned to nothing (expression-not-assigned)
openstack_dashboard/dashboards/project/images/utils.py:43:12: W0106: Expression "[public_images.append(image) for image in images]" is assigned to nothing (expression-not-assigned)
openstack_dashboard/dashboards/project/images/utils.py:75:12: W0106: Expression "[community_images.append(image) for image in images]" is assigned to nothing (expression-not-assigned)
openstack_dashboard/api/glance.py:47:4: C0412: Imports from package glanceclient are not grouped (ungrouped-imports)
openstack_dashboard/api/cinder.py:60:4: C0412: Imports from package cinderclient are not grouped (ungrouped-imports)
openstack_auth/user.py:358:4: E0211: Method has no argument (no-method-argument)
openstack_auth/user.py:362:4: E0211: Method has no argument (no-method-argument)
openstack_dashboard/api/keystone.py:75:4: C0412: Imports from package keystoneclient are not grouped (ungrouped-imports)
horizon/loaders.py:43:16: W0706: The except handler raises immediately (try-except-raise)
horizon/themes.py:174:8: W0706: The except handler raises immediately (try-except-raise)

Change-Id: I40cf3ffbc4519657e11180d2e2fe7401387c5556
2019-01-17 00:05:27 +09:00
Akihiro Motoki d32359e011 SHOW_KEYSTONE_V2_RC defaults to False
In favor of keystone v2 support, SHOW_KEYSTONE_V2_RC now defaults
to False. SHOW_KEYSTONE_V2_RC setting is also deprecated.

Along with this change, "v3" part of "OpenStack RC File (Identity API v3)"
is now unnecessary, so "v3" information is dropped.

Change-Id: If0359e2dc1f2c8fb5f3c87046fd23043f94abc21
2018-12-23 04:02:22 +09:00
Adrian Turjak f588b4ee2e Fix wrong setting name for SHOW_KEYSTONE_V2_RC
The user links patch didn't use the same setting
variable name in context_processors.py, this fixes
that.

Closes-Bug: #1757112

Change-Id: Ie0e516d82c2c1cdc1c343075393cdf9c336f8e5f
2018-03-21 07:20:31 +13:00
Akihiro Motoki 1a252cb5e8 django2: is_authenticated/is_anonymous is now property only
https://docs.djangoproject.com/en/2.0/releases/1.10/#user-is-auth-anon-deprecation

blueprint django2-support
Change-Id: I57a39417f0595eae8d1c06d7e61d0a67078bb231
2018-02-17 01:36:54 +09:00
Amelia Cordwell 924239073e Add setting for user menu links
* User menu links can be specified in the settings page
* Defaults to the standard Open RC links (bug and help links are
  not modified in this patch)
* Url, name and icon can all be specified

Change-Id: I3cbcfbf06ede18d468d4c611ad6005cb74f1b284
Closes-Bug: 1736048
2018-01-19 12:19:33 +13:00
Amelia Cordwell b0e696cf9a Optional removal of V2 openrc file
* Setting 'SHOW_V2_KEYSTONE_RC' added and will control whether
  or not user's are able to see links for the V2 rc file on both
  the API Access panel and the user menu.

Change-Id: I454fcf578dd8c4d2b9b52c3a9e5426b85e5298b5
2017-12-12 16:40:38 +13:00
Akihiro Motoki f50cce4c1c Fix KeyError for HORIZON_CONFIG['plugins'] in plugin UT
HORIZON_CONFIG['plugins'] does not always exist.
It breaks unit tests of some horizon plugins like designate-dashboard.

Change-Id: I23aae10a7e63494c1c9f656b47becd2f067c9058
Closes-Bug: #1702889
2017-07-07 11:33:40 +00:00
Akihiro Motoki ce82c1f805 test helper: Ensure to populate JS_CATALOG in context
_script_i18n.html which tries to access 'jsi18n' url assumes
context['JS_CATALOG'] is populated, but openstack_dashboard test
helper clears it by mocking a context processor.
This leads to a error in rendering templates in unit tests.
Note that template rendering error is caught by a rendering engine
so unit test itself succeeds even when this happens.

Change-Id: I0f5013c4e9ed7b166c527b1aacd0302413948d51
Closes-Bug: #1699509
2017-06-21 14:00:27 +00:00
Jenkins 8201d7bc9f Merge "Keystone to Keystone Federation Drop Down" 2017-01-25 23:10:07 +00:00
Elvin Tubillara 69eb05ae71 Keystone to Keystone Federation Drop Down
This adds a dropdown to enable the user to switch Keystone providers using
Keystone to Keystone Federation.

Depends-On: I75b1a10a3b40b5544b60f6fdc060e0070c585977
Change-Id: Id39bf8d21c537347cbd23f63eaa3da8cc1bfff46
Implements: blueprint k2k-horizon
2017-01-19 14:59:01 -06:00
Paul Karikh e2cf94eb46 Enable profiling of angular pages (with async requests)
The main difficulty in tracing async requests which are made during
the rendering of Angular-based pages is tracking the root request (the
one which was made to render the skeleton page which then initiated
all other requests) throughout other requests, so they form a cohesive
trace. This is solved by capturing the root request id and exposing it
as a profiler module constant in the process of interpolating
_scripts.html Django template. Then if that constant is not an empty
dictionary, profiler module intercepts all Angular requests and adds
osprofiler headers to them.

This patch also fixes issues which arose after transitioning to the
new version of angular-bootstrap.

Change-Id: I656028b969289a473f54594681d9313ff8a07fd8
2016-12-29 18:26:19 +03:00
Timur Sufiev 4ceeef5376 Add the Profiler panel to the Developer dashboard
Provide both pythonic Django part and the static assets (angular
directives and styles) for the new panel.

DEPLOY NOTES:

To enable panel itself, copy
openstack_dashboard/local/local_settings.d/_9030_profiler_settings.py.example
file from the previous commit to
openstack_dashboard/local/local_settings.d/_9030_profiler_settings.py
and copy openstack_dashboard/contrib/developer/enabled/_9030_profiler.py
to openstack_dashboard/local/enabled/_9030_profiler.py

To support storing profiler data on server-side, MongoDB cluster needs
to be installed on Devstack host (default configuration), see
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/#install-mongodb-community-edition
for instructions. Then, change net:bindIp: key to 0.0.0.0 inside
/etc/mongod.conf and invoke `sudo service mongod restart` for the
changes to have an effect.

Implements-blueprint: openstack-profiler-at-developer-dashboard
Change-Id: Ice7b8b4b4decad2c45a9edef3f3c4cc2ff759de4
2016-12-01 22:29:16 +03:00
Thai Tran b56d278582 Support javascript translation for plugin
It's not possible for plugins to contribute translations to the javascript
message catalog. Right now our files are hardcoded to allow only
contributions from horizon and openstack_dashboard. This patch fixes
the issue.

Change-Id: Idde2fc6ac0bf7f762a595cf139ed5184dad64540
Closes-Bug: #1523930
2016-01-11 13:46:05 -08:00
Thai Tran 35e47358f0 Fix bug where WEBROOT is not respected
The WEB_ROOT setting needs to be respected rather than assuming / as
the root of the application. Simiarly, we can not assume that STATIC_URL
is a sub url of the WEB_ROOT. They can be configured as two indepedent url.

Angular templates are loaded dynamically with Ajax, which requires an
absolute base path. We define those base paths as angular constants for
template use and future routing.

TO TEST, follow directions at:
  http://docs.openstack.org/developer/horizon/topics/settings.html#webroot

Co-Authored-By: Matt Borland <matt.borland@hp.com>
Co-Authored-By: Shaoquan Chen <sean.chen2@hp.com>
Co-Authored-By: Thai Tran <tqtran@us.ibm.com>

Change-Id: Ifcd459633682edc94b270019ce77e17d64bea22d
Closes-Bug: #1451681
2015-07-22 04:10:50 +00:00
Vlad Okhrimenko a47c984623 Update project list in the header bar.
Use function for clean cache (from openstack_auth), after project
members were changed(for project cache is invalidated).
Now, in the header bar, show only active projects.

Change-Id: Ia2561b591b4f3de29a14aaa4b666b16fc1d4cec8
Closes-Bug: #1393659
2014-12-11 18:22:38 +02:00
He Yongli e790ac070e Remove extraneous vim configuration comments
Remove vim setting:
comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4

at the top of source code files, except for files in
openstack/common.

Change-Id: I9a5c6b17c6ef7ecec601f4503dfc7b31fc72e90a
Close-bug: #1229324
2014-05-06 15:30:10 +08:00
David Lyle 8b53d1f094 Implementing accordion navigation
Left hand side navigation is now an accordion with collapsable
dashboards and panel groups.

The project and region pickers have been relocated to the header.
They will be further enhanced in a future bp.

The help link and settings link have now been placed in a user
dropdown as well.

The page header text is still preserved and now sits above the
main content. This information is generally redundant with the
table headers or the panel selected in the left hand navigation,
and should be considered for removal in a different bp.

Implements blueprint navigation-enhancement

Change-Id: I9588cabdf4ce41bd08cadff780b1a87f73dbbea5
2014-02-26 14:03:36 -07:00
Radomir Dopieralski 028332da4a Remove #noqa from most common imports and add them to import_exceptions
We have a lot of import with #noqa that is there to ignore h302,
because it's traditional to import and use a name directly, instead
of a whole module. This hides other errors and gives people the
impression that it's actually fine to import non-modules, you just
have to slap #noqa on those lines.

I went through the code and identified about a dozen names that are
most commonly imported this way. I remove the #noqa tag from them,
and added them to the list in import_exceptions.

I also removed a few unused imports that were revealed in the process.

Change-Id: I27afb8e2b1d4759ec974ded9464d8f010312ee78
2014-01-07 12:26:35 +01:00
Paul Belanger da8c69afa6 Gate on H4xx docstrings for pep8
In an effort to help horizon more friendly to OpenStack hacking
guidelines, we now gate on H40* violations.

Change-Id: Id07294543660368d2f7f5ac363710176ab23b874
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
2013-11-23 12:51:07 -05:00
lawrancejing d33f294ba9 Remove unused LOG
In some files, we import logging and define
LOG, but we never used it later, so i remove
those unused LOG and make horizon code clean.

Fixed: bug #1231761

Change-Id: I1ebf0098c647e7522f5f1a93cfece7a52bdc05c1
2013-09-28 23:57:13 -07:00
Tatiana Mazur 953d1b9793 Enable H302 check
This patch replaces some method imports with module imports and
makes H302 test enabled.

Fixes bug 1188531

Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
2013-08-22 17:39:09 +04:00
Gabriel Hurley cb8e7c1f8f Splits OpenStack Dashboard bits from framework app code.
Moves everything OpenStack-specific (dashboards, apis, etc.)
into the openstack_dashboard project, achieving a much
cleaner separation between the project-specific code and
the generic Horizon framework code.

Change-Id: I7235b41d449b26c980668fc3eb4360b24508717b
2012-10-11 11:47:50 -07:00