Commit Graph

50 Commits

Author SHA1 Message Date
Akihiro Motoki cd7c1b5110 Address RemovedInDjango40Warning (2)
django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(),
ungettext(), and ungettext_lazy() are deprecated in favor of the
functions that they’re aliases for: django.utils.translation.gettext(),
gettext_lazy(), gettext_noop(), ngettext(), and ngettext_lazy().

https://docs.djangoproject.com/en/4.0/releases/3.0/#id3

Change-Id: I77878f84e9d10cf6a136dada81eabf4e18676250
2022-02-04 16:22:07 +09:00
manchandavishal 6ac31e0ba8 Drop Django based implementation of launch instance
horizon already deprecated launch instance Django based implementation
in the wallaby cycle [1]. This patch remove code for launch instance
Django based implementation as angular based implementation is the
default one from long and all features gaps between angular and Django
implementation is closed.

It also moves SetAdvanced step code to ``resize_instance.py`` as
``workflows/create_instance.py`` file is deleted and remove server_group
option from Advanced Options of resizing instance action because
"server_group" is not required while resizing an instance as per
nova-api reference [2].

Closes-Bug: #1869222

[1] https://review.opendev.org/c/openstack/horizon/+/779125
[2] https://docs.openstack.org/api-ref/compute/?expanded=resize-server-resize-action-detail#resize-server-resize-action

Change-Id: I5e01cd81f309491f1a58ea93911030366a86e3c7
2022-01-24 16:21:18 +05:30
YuehuiLei 87f498bee5 Drop the usage of unicode prefix from unicode strings
All strings are considered as unicode strings in python 3,
so we no longer need "u" prefix (u'...').

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I796d2fcdca066475bbf29d25cbf2aa67b2b2178b
2021-02-12 13:05:27 -06:00
Akihiro Motoki e5d09edc20 Use python3-style super()
In python3, super() does not always require a class and self reference.
In other words, super() is enough for most cases.
This is much simpler and it is time to switch it to the newer style.

pylint provides a check for this.
Let's enable 'super-with-arguments' check.

NOTE: _prepare_mappings() method of FormRegion in
openstack_dashboard/test/integration_tests/regions/forms.py is refactored.
super() (without explicit class and self referece) does not work when
a subclass method calls a same method in a parent class multiple times.
It looks better to prepare a separate method to provide a common logic.

Change-Id: Id9512a14be9f20dbd5ebd63d446570c7b7c825ff
2020-10-15 14:37:20 +09:00
Akihiro Motoki fcdc67b819 Define default settings explicitly (openstack_dashboard 3/5)
This commit mainly covers settings
in openstack_dashboard/dashboards/project/.

Part of blueprint ini-based-configuration
Change-Id: I22413d2fe20576a507634dc4e2d0354c7db8800a
2019-07-03 14:54:16 +09:00
Akihiro Motoki f3bd271fc9 pylint: fix bad-super-call
Change-Id: Ia81e5c8b77dbfcb48630b1736d581cdff73278ef
2019-01-15 01:11:33 +09:00
Simon Collins 2a3b04ce6c Changed the message level for deleting some resources to info
Added functionality to the handle function in the BatchAction class
in action.py and allowed the easy changing between the alert types
and made deleting images, instances, and volumes give an info alert
rather than a success message and altered the testing parameters

Change-Id: I93251d6d12cf89a331b5c051bf4fe10a6e470f51
Closes-Bug: #1291681
2019-01-03 18:45:08 +13:00
wangliangyu 5f4057f8b5 Show snapshots list correctly when launching instance
In launch instance modal, when a user selects 'Instance Snapshots',
not all snapshots are listed. The snapshots which are created from
an instance with new volume or an instance created from volume
or volume snapshot don't have 'image_type' but 'block_device_mapping'.
So, judging only by image_type is not enough.

Change-Id: I7e175b6a7260ca3d82560427a8f742f8cfa35565
Closes-Bug: #1627619
2018-11-06 22:06:52 +00:00
Ivan Kolodyazhny 1f80d94459 Use default Django test runner instead of nose
Nose has been in maintenance mode for the past several years. It has
issue with exit code [1] which leads to false positive results for our
seleniun-headless job.

This patch changes test runner for Horizon tests and does the following
things:

* Django test runner  executes test in a different order than Nose does.
  That's why we've got an issue with side-effect in
  horizon.tests.unit.tables.test_tables.MyToggleAction class. This patch
  adds workaround to it.
* Rename filename of test files to names starting with 'test_'
  so that the django test runner can find tests expectedly.
* '--with-html-output' option is temporary dropped and will be added in
  a following patch.
* Integraion tests is marked via django.test.tag mechanism which is
  introduced in Django 1.10
* 'selenium-headless' is broken now because we don't have geckodriver on
  gates, this patch makes it non-voting.
* 'tox -e cover' is fixed
* Remove @memorized decorator from
  dashboards.project.images.images.tables.filter_tenant_ids function.

[1] https://github.com/nose-devs/nose/issues/984

Depends-On: https://review.openstack.org/572095
Depends-On: https://review.openstack.org/572124
Depends-On: https://review.openstack.org/572390
Depends-On: https://review.openstack.org/572391

Related blueprint: improve-horizon-testing
Change-Id: I7fb2fd7dd40f301ea822154b9809a9a07610c507
2018-06-08 15:21:12 +03:00
Akihiro Motoki 11eb4e9d3e Fix W503 warnings
W503 line break before binary operator

Looking at the code base, it sounds okay to follow this check.

Change-Id: Id511e0104dc6de5b204021661d4a8776ca6d3658
2018-04-11 18:13:47 +09:00
Akihiro Motoki e477eafa45 django2: Replace django.core.urlresolves with django.urls
(In Django 2.0) The django.core.urlresolvers module is removed
in favor of its new location, django.urls.
It was depreacted in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3

blueprint django2-support
Change-Id: I46ab5c325491274b8eaffbf848e5d80f83c2fd26
2018-02-17 01:36:48 +09:00
Jenkins 24a4905f5e Merge "Update Horizon to use latest nova policy rules for validation" 2017-04-05 20:34:46 +00:00
Akihiro Motoki baa4ca8dce hacking: noqa cleanup in openstack_dashboard
attribute-level imports are not checked by hacking module now.
most noqa is used to disable warnings on attribute-level imports.
This commit drops noqa for this purpose.

After this, there are only 3 noqa under openstack_dashboard/ :)

Change-Id: I4a449802f5dbd6e44e4b8b5c378a555d47d9a99f
2017-03-17 19:38:47 +00:00
Yaguang Tang c61ae4f083 Update Horizon to use latest nova policy rules for validation
As Nova's API is unified to os_compute_api, the API policies are also
updated to use this format, Horizon needs to use Nova  policy enforce
rules in the codebase. This patch also update nova_policy.json using
oslo-config-generator for Nova policy file.

Co-Authored-By: Rob Cresswell <robert.cresswell@outlook.com>
Implements: blueprint update-nova-enforce-policies

Change-Id: Id7d01a39930c88592301a5035f0befe5293a78fa
2017-03-13 13:43:02 +00:00
Richard Jones 46ad19dbf0 Refactor Project Volumes stand-alone panel
Note that there was state leaking from one of the existing
tests that was relied upon in other tests and moving that test
in the run order caused the others to fail. All related tests
have been altered to not leak state.

Change-Id: I972bc5650fa77044de8a027f570cf2cb41febef8
Implements: blueprint reorganise-volumes
2017-03-06 15:50:09 +11:00
Julie Pichon cf0aac9400 Support for Glance v2
Implements wrappers necessary for Horizon to work with either Glance
v1 or v2 and removes the dependency on the Glance v1 endpoint.
Handles the differences between setting properties with v1 and v2 and
restricts some Glance functions that aren't supported in v2.

Implements blueprint: horizon-glance-v2
Co-Authored-By: Travis Tripp <travis.tripp@hp.com>
Co-Authored-By: Brad Pokorny <Brad_Pokorny@symantec.com>
Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com>
Co-Authored-By: Liuqing Jing <jing.liuqing@99cloud.net>

Change-Id: Icca91c53eabf18c3109b3931ed53f70eaaaa0e56
2016-09-12 11:16:33 -07:00
Rob Cresswell 07d33cf462 Prevent long names breaking table layouts
Adds a word-break class that can be added to tables to prevent large
column values breaking the table shape.

Change-Id: Icca10d9c29254d176dc7f8b7c039bc19c3f52c72
Related-Bug: 1565724
Closes-Bug: 1584785
2016-08-19 09:21:33 +01:00
Steve McLellan 018e99d20e Allow horizon to function without nova
Adds conditional block to nova quotas to exclude them if nova is not
enabled; adds 'permission' checks to the project overview and
access_and_security panels to only enable them if compute is enabled;
adds permission checks on compute and image to the admin overview
and metadef panels; disables 'modify quota' and 'view usage' project
actions; disables 'update defaults' if there are no quotas available.

The 'access and security' panel still appears (under Compute) but
tabs other than the keystone endpoint and RC download tab are hidden.

Closes-Bug: #1580116
Change-Id: I1b2ddee0395ad9f55692111604b31618c4eaf69e
2016-07-26 09:15:48 -05:00
Andy Hsiang 71a7ac29f8 modified filter tab name for images shared by projects
previously named "Shared with Me" for one of the 3 filter tabs on
project/image page.  Selecting this tab would show all images shared
with current selected project. Updated the tab name accordingly to
clarify the confusion.

Change-Id: Ie623ebea9b69746761d598106ec43d44eb5ef943
Closes-Bug: #1491622
2016-06-09 15:15:38 -04:00
Rob Cresswell 2843ce3c0a Enable Angular Launch Instance by default
This patch enables the Angular Launch Instance workflow by default. The
toggle has been maintained for those running the Python workflow, and
also for the integration tests to run against both simultaneously.

Keep integration tests running for a legacy Launch Instance workflow
by means of a separate local_settings.d code snippet activated before
starting the tests.

Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com>
Change-Id: Id0c57b33df46397711e32092cec6cc5268841779
Implements: blueprint enable-angular-launch-instance
2016-03-03 17:40:35 +00:00
IWAMOTO Toshihiro 2e59431227 Look for volumev2 endpoints instead of volume
Volumes tabs should be enabled when volumev2 endpoint is registered.
Currently, Horizon considers no volume service is running if there
is no V1 endpoint, which doesn't make sense as Horizon no longer
supports the cinder V1 protocol.

Co-Authored-By: itxaka <itxaka@redhat.com>
Change-Id: I35d821eedb75f73f9330ed11f921694104eed0c6
Closes-Bug: 1415712
2016-02-23 11:47:25 +01:00
Timur Sufiev f8e595b0fa Sort images list in ascending alphabetical order
Move most of the pagination-logic to `api.glance.image_list_detailed`,
thus making code in Admin/Project->Images->get_data() less confusing
(and remove hard-coded 'asc'|'desc' values).

Also prepare to get images both from glanceclient.v1 and
glanceclient.v2 (which doesn't set `is_public` attr on images using
`visibility` attr instead).

Change-Id: Ibe6d3dd1e94a1d1fbf95382599a5f53c3559ce5a
Closes-Bug: #1534670
Closes-Bug: #1336317
2016-01-30 12:00:03 +00:00
Victor Stinner 80ae31f461 Fix Python 3 issues in dashboard image tests
* Use NamedTemporaryFile instead of TemporaryFile because we must
  have a name which is a text on Python 3. Otherwise, the test fails.
  On Python 3, TemporaryFile uses an integer for the file name, the
  file descriptor.
* Replace filter() and map() with list comprehensions to get a list
  on Python 3.
* On Python 3, temporary files are open in binary mode so write a
  byte string instead of a text string.
* tox.ini: enable all image tests on Python 3.

Partial-Implements: blueprint porting-python3
Change-Id: Ice7f119c040bbddeda10ed45d137bb7851764b8d
2015-11-09 10:49:41 +01:00
sayalilunkad 02ee3e41d4 Adds deactivated status for glance image
This patch adds the status deactivated for
images that have been deactivated in glance
thus also fixes the issue with progress bar
after image is deactivated.

Change-Id: I24c9fecb3cf67e1a2a56a0443e272a34a3585a74
Closes-bug: #1482094
2015-10-06 12:45:41 +02:00
Szymon Wroblewski af66565b51 Allow to edit image metadata from project view
Add new table action to allow metadata editing.

Implemenents: blueprint project-images-metadata
Change-Id: I2ae0922f4a172c72ae35269bb3136177878dcffd
2015-08-25 15:45:44 +02:00
Jenkins d36cec00a6 Merge "Truncate image name to 40 in image table" 2015-08-12 20:41:23 +00:00
Richard Jones 9d3823b3d8 JSCS Cleanup - style guide cleanup for Launch Instance wizard
Following John Papa's style guide
https://github.com/johnpapa/angular-styleguide,
this patch refactors the Angular code for Launch Instance wizard.

Note that the construction of the Launch Instance wizard precludes
applying JP's "controller as" rule to the top level wizard controller
itself; doing so breaks the *many* implicit parent accesses throughout
the wizard sub controllers (implicit parent scope accesses are not
possible using the "controller as" style). Fixing that is potentially
a flow-on tech-debt fix that is outside of the scope of this
patch - it'll be a bunch of work!

I also noticed a trivial bugfix while addressing this. It could be
broken out into a separate patch, but we have enough patches already ;)

Change-Id: Ie6a1fdca1da60259adbb65c36a9829b001ae752b
Partially-Implements: blueprint jscs-cleanup
Closes-Bug: 1481135
2015-08-07 22:35:58 +00:00
liyingjun 164175eb90 Truncate image name to 40 in image table
Column `name` in image table is not truncated, it's need to be
trauncated when the image name is too long.

Change-Id: If17fbf4ee2ae18e2745fd502b6ed0d5e546c13c2
Closes-bug: #1481842
2015-08-06 09:43:51 +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
Shaoquan Chen c0f4ee6e07 JSCS cleanup - launch-instance.js
This patch breaks up launc-instance.js into small pieces according to
Horizon code style.

Change-Id: I852943a5223289391b1b8a315be80a48dcd39fb6
Partially-Implements: blueprint jscs-cleanup
2015-07-01 10:17:47 -07:00
Yves-Gwenael Bourhis 63f4d841b8 Do not use a mutable as default argument
LaunchImageNG was using a mutable as default argument
Using None and setting the default mutable only if None.

Change-Id: Ie73d259689d0788a081498da1ce92af6aa2077f8
Closes-Bug: #1466894
2015-06-19 16:29:38 +02:00
Justin Pomeroy 12550cb9b9 Add support for Docker image format
The 'Docker' format is added to the default list of supported
formats so it can be selected from the list of formats when creating
or updating an image. When the docker format is selected, the
disk_format and container_format properties are set appropriately.
This also includes changes to the Format column and filter for the
Images table to handle this type.

Closes-Bug: #1455179
Change-Id: Ie705c86d47c0b6035373b9311454748122185988
2015-05-29 11:15:11 -05:00
Jenkins 68b2a05b58 Merge "Make "RAW" in image table translatable." 2015-04-08 22:45:56 +00:00
Doug Fish 441277cc84 Make "RAW" in image table translatable.
Most of the format values in the images tables are acronyms
and do not need to be translated. The "RAW" value is a word and
should be translated. It really don't need to be all caps either.

Change-Id: I3465d896760b24e19dad200ab550ca95e590291c
Closes-Bug: 1441352
2015-04-07 16:20:40 -05:00
Doug Fish a553e98887 Make Image Type translatable
On the image tables the Type values are not translatable.
Update the code so they can be translated.

Change-Id: Ibde03a5e2281fad80ecc21e56e8b92bbe432c368
Closes-Bug: 1441196
2015-04-07 15:51:08 -05:00
Matt Borland 688b2d57d4 [Launch Instance Fix] Launch Instance from Various Screens
Using the 'launch' options from Image Table/Detail or Network Topology
fires off the Launch Instance workflow.  Each firing-off point describes
where the user should be relocated to when successfully done with the
wizard (when a launch request has been successfully submitted).

Co-Authored-By: Shaoquan Chen <sean.chen2@hp.com>

Closes-Bug: #1433113
Change-Id: Id7bfad80781195c6311ef37e3ef32077947d8e62
2015-04-03 10:35:45 -06:00
nikunj2512 afef289fdd Makes Launch/ Edit buttons in Images explicit
The table actions, and thus detail page actions, are just listed as
Launch and Edit. This patch makes them Launch Instance & Edit Image.

Change-Id: I7e462d48547b3ab13e20ecb1e75d5bd7eab705b5
Closes-bug: #1435928
2015-03-25 02:47:32 -07:00
Jenkins 1655989c5a Merge "Remove not required parentheses for tables.Column(link=..)" 2015-02-24 06:30:18 +00:00
lin-hua-cheng 0cde6aa055 Move to hacking 0.10
Release notes:
http://git.openstack.org/cgit/openstack-dev/hacking/tag/?id=0.10.0

Per the release notes, H307, H803 and H904 has been removed.

Fix code issues with H238 and W292.

Change-Id: I747ebb64db5825bc70f1ae19c1c1f5ca2089c06d
2015-02-04 20:27:07 -08:00
Christian Berendt 5f0581aeb5 Remove not required parentheses for tables.Column(link=..)
Change-Id: I2de64370179ff80dbab2bfd1d7f40f07c372f23e
2015-02-04 12:50:06 +01:00
Wu Wenxiang bd483ffcac Make values for image status be translatable
Add STATUS_DISPLAY_CHOICES in files:
openstack_dashboard/dashboards/project/images/images/tables.py

Change-Id: Ia3ed7b742ae10e04434612a64a4680e3f06c87f3
Closes-Bug: #1415640
2015-02-03 09:22:21 +08:00
Jenkins a25ef90360 Merge "Make table BatchAction help text configurable" 2015-01-27 05:46:57 +00:00
Timur Sufiev 8b02edc643 Fix sorting by size for Project->Images table
To fix it the proper sorting function should be used in tablesorter
jquery plugin, this is achieved by marking the column with correct
'data-type' attribute value.

Change-Id: Idc7dfab9cef5a32166e9ecdba77ccaf09170db15
Closes-Bug: #1413266
2015-01-21 20:05:01 +03:00
LIU-Yulong a65258f77e Make table BatchAction help text configurable
Now the BatchAction help text is consistent.
This patch make the BatchAction/DeleteAction help text configurable,
so horizon user can understand the BatchAction (mostly dangerous)
more clearly.

Implements blueprint: make-batchaction-help-text-configurable

Anoter blueprint: add-batchactions-help-text do the "add
appropriate help text" work.

Change-Id: I08c219cf0b918a28da60ca74830a1e17f5453a2f
2015-01-14 22:37:25 +08:00
Cindy Lu d0254a859b add missing icons for Project > Images filter
The fixed filter (Project | Shared with Me | Public) should have icons.
Using font awesome icons.

Also fix the tabbing in the html file.

Change-Id: Ie9f228feebd31fc76adc62102a84235a93b23930
Closes-Bug: #1367442
2014-12-11 14:00:22 -08:00
Doug Fish de81c57573 Fix concatenation in Delete Image action
Remove concatenation and pluralization issues from Delete Image
action

Change-Id: I27d9c9f4c38d68183c16b5d23a6aba6f206d392c
partial-bug: 1307476
2014-09-16 14:11:42 -05:00
Jiri Tomasek 92146772b6 Update Twitter Bootstrap to version 3
Updated to bootstrap 3.2.0
back to v3.1.1
fix base-line-height variable
Revamped grid system
Replaced help-inline with help-block
Change .control-group to .form-group
Add column widths to horizontal form labels and .controls, remove .controls class
Datepicker form fix
Add btn-default to btn elements with no other color
Topbar switcher fix
Rename button sizes
Replace alert-error with alert-danger
Removed alert-block
Alerts fixing
Updated LinkAction and Action table actions to define icon, replaced btn-default icon with glyphicon
Replaced icons with glyphicons, removed btn-icon styling from horizon.scss
change Button Icons text in customizing docs
Fixed table header
Fix page_header h2 margin
Nav accordion fix
Tables fix
Modal fixes
added form-control class to input and selects
Forms fixes
Workflow modal fix
Fix quota bar
updated customizing docs
removed unused styling from horizon.scss
make datepicker form inline
fix table filter styling
added btn-danger to terminate instances button
fixed loading spinner
form fields and validations
Created bootstrap_form_field filter and template to render bootstrap forms properly
Style up the datepicker
Fixed failing test cases

Implements: blueprint bootstrap-update

Change-Id: Ic826849be1af7fc6bf06f97dd7a60fc54b862148
2014-07-28 16:13:21 +02:00
Salvo Rapisarda 78fdfe3741 Add "Size" column to Image Table
In the class ImagesTable in "project/images/images/tables.py"
was added the size column after disk_format column.

Used the exist filesizeformat filter for format the value and verbose name.

Closes-Bug: #1300622
Change-Id: I047732bc0295ea50d7ddd88745320c0946471d7c
2014-06-03 16:25:37 +00: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
Zhenguo Niu 3d25f1d595 Move volume snapshots table to volumes panel
Now that instance snapshots are just images, the images & snapshots
page only has images and volume snapshots. This is an odd combination.
I think we should now move volume snapshots to the volumes panel,
since a volume snapshot is tied to a volume.

Closes-Bug: #1190843
Change-Id: I3e12cec8b859a30db9f131e9889a92277e064086
2014-02-18 10:24:18 +08:00