Commit Graph

75 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
Vadym Markov b6439399e0 Make word wrapping consistent
Proposed patch enables word wrapping for 'Image name' and 'Host' columns
in affected dashboards. Currently, all potentially long names like instance
and image name are wrapped. Ellipsis might be a good idea, but it is not
implemented. Patch [1] just turns off wrapping for instance size (which is
reasonable, it is short in most cases) and hostname (might be very long in
prod environment, because in some cases backend generate some random name
for compute VM)

[1] https://review.opendev.org/c/openstack/horizon/+/5831

Related-Bug: #964738
Change-Id: I3058825c0e4ae114fb397670dbed1c1c6e983552
2021-06-25 15:03:40 +03:00
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
manchandavishal d6217b3e63 Instances column is shortened so it fits properly
The 'Time since created' column name has been shortened to 'Age'
in project instances and admin instances meaning it fits properly
in table header cell and doesn't cause table header height to
increase.

Closes-Bug: #1614287

Change-Id: I94fc9eb260050e187445abd8236ac414b885b467
Co-Authored-By: Sam Wright <swright.wellington@gmail.com>
2018-12-18 10:01:56 +00:00
pengyuesheng ffa8b5404e Support of rescue instance in Horizon
Change-Id: Ie195befde8fe10ce419583ead06fdb759dd3813c
Implements: blueprint instance-rescue-horizon-support
2018-11-20 10:25:37 +00: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
Ahmed Zaid 7d7de3b37f Add more actions to admin.
Admin can Rebulid and Shut off instance from instances in admin panel
for all project-member.

Change-Id: Ieab146b49a92f3527e34aacb0a9077a704151e3e
Closes-Bug: 1704833
2017-12-21 06:52:04 +00:00
Jenkins 1eb61ef506 Merge "Do not fail on AdminUpdateRow if tenant is not found" 2017-10-05 14:28:20 +00:00
Ivan Kolodyazhny 65baa5fa6d Do not fail on AdminUpdateRow if tenant is not found
We still can show instance info on admin/instances page even if tenant
is deleted or we can't retrieve tenant's information.

Change-Id: Idb1a5ffbb4103cce5258657d559bf4fe784b98d6
Closes-Bug: #1712565
2017-10-04 23:04:35 +03:00
Dmitry Ratushyy 9e1eb5f5d7 Fix actions inside instance details view page
At the current moment user can not suspend an
instance from the instance "Details" page if the
instance does not belong to the first page of the
instances list. This is fixed.

Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Co-Authored-By: Vladislav Kuzmin <vkuzmin@mirantis.com>
Change-Id: I4d805e4a65e838242af38677cbb9efefc498a96f
Closes-Bug: #1553142
2017-09-07 01:08:41 +04:00
Ying Zuo 9a975ebaf5 Show instance resize and rebuild actions in red
Updated the template used for LinkAction to add the css class for
destructive action if action_type is set to "danger".

Removed the action_type for live  migration action because it is
not a destructive action.

Change-Id: Ib957597aa065df4c8a65303b1dc95a5c762ae3d3
Closes-bug: #1704014
2017-07-12 17:47:27 -07:00
Akihiro Motoki ed4c4b3442 I18n cleanup on recent merged changes
* (admin/instances/tables.py)
  _(" ") is confusing to translators. We already use an empty string ""
  in the project instance table, so there is no need to use a string
  only with a space.
* (project/instances/templates/instances/_detail_overview.html)
  "Locked" in the instance detail template means an attribute name.
  The word "locked" is potentially used in various contexts:
  passive voice, adjective or some name like attribute name.
  We can clarify the meaning of the string by using gettext context.
* (Angular workflow/launch-instance/keypair/create-keypair.html)
  <label> with "translate" attribute leads to an extracted string
  with HTML tagws. It can be avoided by using <translate> tag.
  The fix is same as what were fixed in commit fcd30d95e8.

Change-Id: Ib30306d82e45d81188393d4965493abac93699e3
2017-06-20 10:11:59 +00:00
Ying Zuo ddfa667d02 Add instance locked status on instances table
Added a column to show the locked status on project/admin instances table.

There will be a locked or unlocked icon with help tooltip if nova 2.9 or
above is used. See openstack_dashboard/api/microversions.py

Added the locked field on project/admin instance details panel.

Change-Id: If31ae281d2782c71cd6112f3bd6228647a6130e4
Closes-bug: #1593903
2017-06-14 20:00:56 -07: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
Ying Zuo 804db52d7d Remove link for user id field on project action log
The action log under project dashboard should not link
to the user details panel which requires admin permission.

Change-Id: I802188db6f1f8fc7e854980eca85d3b1a75aec1e
Closes-bug: #1667154
2017-03-12 18:22:36 +00:00
Ying Zuo f1ef8085b5 Rename Size column on instances tables to Flavor
Change-Id: I33e2d6ff079f8381193a2c4d13c04ead3bec1c27
Closes-bug: #1644015
2016-11-23 11:11:41 -08:00
Eddie Ramirez 460a53f96d Server-side filtering for Instances (Project/Admin)
New Filters:
- UUID
- Flavor Name
- Image Name
- Availability Zone
- Key Name
- IPv4 Address
- IPv6
- vCPUs
- Changes-since.

Affected views: Project->Instances and Admin->Instances

Implements blueprint: server-side-filtering
Change-Id: I3b07674fc1083607cae5d1db5a691827bde46d7c
2016-09-15 22:33:35 +00: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
Eddie Ramirez ea1641b2f9 Instance Size (flavor) column is sortable when it should not
The column size is now sortable=False. Disables the sorting function
for this column in Admin-Instances, just as the table in
Project->Instances does.

Change-Id: I25fb0e2e5afb39d226cffcea611db961196c8809
Closes-bug: #1600329
2016-07-08 16:34:30 -07:00
Diana Whitten 8896835353 Angular vs. Django Table Danger Button Inconsistency
A button should have either btn-default OR btn-danger ... not both.

This also removes the flashing red change this  problem caused when
adding a 'disabled' class to the button after its already been
rendered on the page.

Closes-bug: #1557729
Closes-bug: #1549957

Change-Id: I6e035868be4df653438b4d31b462729c3fe06d9f
2016-04-13 09:13:34 -07:00
Jenkins f56476c2e1 Merge "Replace "Terminate Instance" with "Delete Instance"" 2015-12-02 23:27:46 +00:00
Akihiro Motoki 5fc26b0a11 Replace "Terminate Instance" with "Delete Instance"
"Delete" is being used almost everywhere in OpenStack Dashboard
except the instance panel. Using "Delete" looks more consistent.
In addition, "Delete" tells non-native English speakers that
deleted instances will be no longer usable again compared to
"Terminate".

DocImpact
Closes-Bug: #1502773
Change-Id: Idccaf3c45566f20f11d02ada64c1d3934a6f3002
2015-11-30 03:55:19 +09:00
Floren Llanos da1130792e Add symbol equal "=" in several filter texts
Are some filters text that not finalized with the symbol equals "="
(like in the majority).

This filters are in:
  - Project --> Compute --> Instances ("Instance Name")
  - Admin --> System --> Images ("Min. Size (MB)", "Max. Size (MB)")
  - Admin --> System --> Instance ("Name")

Change-Id: I2ee0c51993349b227d3b2297ec5d6c556bacecf8
Closes-Bug: #1520997
2015-11-27 01:45:00 +01:00
Cedric Brandily 9bee1c103c Enable compute shelve/unshelve commands
This change enables shelve/unshelve commands in user/admin views.

Closes-Bug: #1285389
Implements: blueprint horizon-shelving-command
Change-Id: I15e1e5d2fdb3d246a7f3e7e676c4b364694410fb
2015-09-11 12:08:42 +00:00
Alan Fung 6ed0c7c09f Correct Admin Instances actions to reference Admin ones
Currently "Console" and "View Log" actions are referencing the Project
version of these pages instead of the Admin version.

i.e. "Console" action redirects to Project > Instances > Detail page

Additionally, the Admin instance detail page is using the collection
of actions from the Project instance table.

This change corrects these references to redirect to the detail page
under the Admin panel group; updates the Admin detail page to use the
collection of actions from the Admin instance table.

Change-Id: I7043d8283c4f3a85e52b360a790aa3487b9a4ff7
Closes-Bug: 1421318
2015-05-11 17:23:44 -07:00
Jenkins 4bb8bf762f Merge "equal(=) added in project filter option" 2015-03-19 11:01:47 +00:00
LIU Yulong 3b2b07d8f8 Add help text to BatchAction
Add appropriate help text to some important batch actions.

NOTE:
    The another patch:
    https://review.openstack.org/#/c/139920/
    to add appropriate help text to some important delete actions.

Implements blueprint: add-batchactions-help-text

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

Change-Id: Ide21a4fbcb327ed7edfc98f3e36b54aa527e0084
2015-02-27 15:12:34 +08:00
Jenkins 1655989c5a Merge "Remove not required parentheses for tables.Column(link=..)" 2015-02-24 06:30:18 +00:00
Jenkins 5fe579d3ac Merge "Make size columns be text wrapped in admin dashboard" 2015-02-13 00:17:27 +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 1a866d36fd Make size columns be text wrapped in admin dashboard
The size columns are not consistent in admin or project.
This patch make size columns be text wrapped in admin.

Change-Id: I4da6f230f5b17b53ecc8cc7cb201db363ba9bc07
Closes-Bug: #1415652
2015-02-03 19:57:46 +08:00
Masco Kaliyamoorthy d6c06f0b22 equal(=) added in project filter option
In admin's instance table, the filter with
'project' option filtering by exact matching
not by partial match.

the equal(=) symbol is missing at the end of the option.
there should be the = symbol to tell the user
it is doing exact match like other options.

in this patch the = symbol is added at the end of
the project option.

Change-Id: I2f81e4168d33d2dd34963039db85456a17cdbaf3
Closes-Bug: #1413534
2015-01-22 15:44:01 +05:30
liyingjun 2f68530a3c Do not show progress bar for shelved instance
Add shelved:True to instance status mapping to disable progress
bar when a instance is shelved.

Change-Id: Iad5cdce74bce829b11a902f13a774a008c3c425c
Closes-bug: #1406441
2015-01-12 15:55:53 +08:00
Doug Fish a60fa55a70 Make Task state translatable.
The Task state None is currently not translated because it is the
literal value None.  Update to make sure it gets displayed as translated.
Also add in other missing task_states: 'reboot_pending', 'reboot_started',
'reboot_pending_hard', 'reboot_started_hard'

Change-Id: I4f9f8d22711896b2e9d39ef1bf5e803ca7bcbc0a
Closes-Bug: #1392848
2014-11-19 10:09:53 -06:00
Doug Fish 5c75a59c8b Make Power State column on admin instances translatable
Add missing reference to make the admin instances power state column
translatable.  Note that this improves the i18n behavior without requiring any
new translations.

Change-Id: I1a1a7640cb2a9efdf084227d325ad03a28fca6f9
Closes-Bug: #1392834
2014-11-14 12:48:35 -06:00
Sam Betts 9ca494e6e3 Ensure DataTableView applies filter after redirect
Non-API bound filters were not persisting across pages changes,
this patch adds an additional check to make sure the DataTable looks
for any non api bound filters in the session and applies them on page load.
Also added some logic to make Project filter in Admin->Instances API
bound using the tenant_id.

Change-Id: Ieab9f2b92b59401809725a4f37628757dc4c8f13
Closes-Bug: 1369014
2014-10-15 10:19:45 +01:00
Akihiro Motoki 969ff4828b Use action_present/past methods in BatchAction
action_present/past methods were introduced in BatchAction to allow
translators to control word orders and plural forms. This patch
replaces the remaining old attribute version of action_present/past
with the method version.

Change-Id: I9f1cc8ff862471f33a5cb40f9e210c5222b7fb94
Partial-Bug: #1307476
2014-10-05 02:16:11 +09:00
Akihiro Motoki 7b47906118 Fix E127 errors in openstack_dashboard/dashboards/admin/
E127 continuation line over-indented for visual indent

Partial-Bug: #1375931
Change-Id: I0c3a95633e267294fc3b5576be2fc3c374b4b5d8
2014-10-02 19:46:52 +09:00
Matthias Runge b5b09140b1 Change column uptime
Renamed misleading column uptime

Change-Id: Id72c10a7166943fcfef68c338a1412897ad9cc4b
Closes-Bug: #1156563
2014-10-01 14:00:31 +02:00
Sam Betts 107cf8b328 Add mixin to replace replicated get_policy_target
Fix adds a mixin to replace the replicated get_policy_target
function. Duplicated code is removed from many classes and mixin is
inherited.

project_id, user_id and domain_id are now default in the generated
policy_target dict but are set to None if the data doesn't support it,
this is to provide the most flexibility for operators writing policy.json
as discussed in the bug report.

policy_target_attrs attribute added by the mixin is overwrittable by
sub-classes of the mixin to override the defaults for custom policy_target
information.

Change-Id: I26759f145b8756bd1eef585c8107160277061523
Closes-Bug: 1317238
2014-09-23 17:39:55 +09:00
masco 531ffe462d Not display loading image for shelved instances
If, any of the instances are shelved through CLI
those instances status are displayed as shelved offloaded
with a loading image.
Displaying the loading image for this status are not correct.
Displaying the loading image is removed for
the shelved offloaded status.
This problem is reported and fixed in #1318558 but this fix is
working only for rescue not for shelved offloaded.
Now it is fixed for shelved offloaded also.

Change-Id: I39d1e2fc1428923824b303f0837b25d736dc0e3c
Closes-Bug: #1352140
Co-Authored-By: Mizielski Robert <robert.mizielski@cloudwatt.com>
2014-08-12 16:32:29 +05:30
Justin Pomeroy 21d0fb59c3 Add API filtering to paged tables
This adds the ability to filter paged tables (admin instances,
admin images, and project instances) based on supported API
query attributes.

Change-Id: I53cae922e3d349e2f01e8d0d688ddf04d65d84e4
Implements: blueprint table-filtering-by-api-query
2014-08-08 09:17:42 -05:00
Radomir Dopieralski 0eca7449cc Fix Flake8 style warnings in openstack_dashboard/
Warnings H904, H307 and H405 are new or considerably changed, and will
be fixed in a separate patch.

Closes-bug: #1349820
Partial-bug: #1347472

Change-Id: I4fd28990dacf16f03a4eaa6074ef59c37f1a2c14
2014-07-30 14:13:24 +02:00
Jenkins 8314fb1367 Merge "not display loading image for rescued instances" 2014-05-21 03:43:27 +00:00
masco 40c220471e not display loading image for rescued instances
If, any of the instances are rescued or shelved through CLI
those instances status are displayed as rescue or shelved offloaded
with a loading image.

Displaying the loading image for this two status are not correct.

Displaying the loading image is removed for
the rescue and shelved offloaded status.

Change-Id: Ic29da8bc4a6bc75ae9269280f5b28e9ad6a63c2e
Closes-Bug: #1318558
Co-Authored-By: Mizielski Robert <robert.mizielski@cloudwatt.com>
2014-05-13 17:20:57 +05:30