This test adds unit tests that improve coverage and describe necessary code paths.
Change-Id: I93eb79a3b9d09cba777d6e1ac84196f8584c70dd
Partially-Implements: blueprint angularize-images-table
Since large Glance images even temporarily stored on dashboard side
tend to fill up Web Server filesystem, it is desirable to route image
payload directly to Glance service (which usually streams it to
storage backend, which in turn has plenty of space).
To make it possible we need to trick Django into thinking that a file
was selected inside FileInput, while its contents are not actually
transferred to Django server. Then, once image is created client-side
code needs to know the exact url the image payload needs to be
transferred to. Both tasks are solved via using ExternalFileField /
ExternalUploadMeta classes which allow to work around the usual Django
form processing workflow with minimal changes to CreateImage form
business logic.
The client-side code relies on CORS being enabled for Glance service
(otherwise browser would forbid the PUT request to a location
different from the one form content came from). In a Devstack setup
you'll need to edit [cors] section of glance-api.conf file, setting
`allowed_origin` setting to the full hostname of the web server (say,
http://<HOST_IP>/dashboard) and restart glance-api process.
A progress bar is implemented to track the progress of a file upload,
in case a really huge image is transferred.
The new machinery could be easily switched on/off with a single
setting `HORIZON_IMAGES_UPLOAD_MODE` set to 'direct' / 'legacy'.
Related-Bug: #1467890
Closes-Bug: #1403129
Implements blueprint: horizon-glance-large-image-upload
Change-Id: I01d02f75268186b43066df6fd966aa01c08e01d7
This patch adds more Nova API features for instances. It establishes
several new proxy APIs and provides the various JavaScript libraries for
accessing those APIs as well.
Change-Id: I016be1d0598faf78b1fb02f4d0768efdaf6cb7bf
Partially-Implements: blueprint angularize-instances-table
Create Image service uses $scope captured in a closure var `scope` to
pass the upload progress of the local image file to Glance service
into modal form controller.
Implements blueprint: horizon-glance-large-image-upload
Change-Id: I98711e6a5e59c91ef71a726a6ff094767d421ef7
First, now there are 2 '/api/glance/images/ API wrapper endpoints for
creating a new image - POST and PUT. The POST endpoint which existed
before now resides at PUT. This was done to support legacy
(i.e. proxied by web-server) file uploads in Angular Create Image,
because Django (which we need to use in that case) doesn't correctly
process PUT request. So, if local file binary payload is added to the
form contents, we send it using POST request.
Second, speaking of '/api/glance/images' PUT request previously known
as POST... Where before the POST call to Horizon REST API wrappers
returned the final image object that Glance just created, now there
are two possibilities for what happens after PUT is sent.
* When Create Image form Source Type is set to URL, then everything is
going as before.
* When Source Type is set to File, then just a file name instead of an
actual Blob is sent to '/api/glance/images', then the Glance Image
is queued for creation and Horizon web-server responds with an Image
object which dict() representation has 2 additional keys:
'upload_url' and 'token_id'. The 'upload_url' tells the location for
the subsequent CORS request, while 'token_id' is passed as a header
in that request, so Keystone would let it in. CORS upload is started
immediately as Image is queued for creation (first promise is
resolved) and returns the second promise, which is resolved once the
upload finishes. The modal form hangs until second promise resolves
to indicate that upload is in progress. Upload progress notification
is added in a follow-up patch.
DEPLOY NOTES
The client-side code relies on CORS being enabled for Glance service
(otherwise browser would forbid the PUT request to a location
different from the one form content came from). In a Devstack setup
you'll need to edit [cors] section of glance-api.conf file, setting
`allowed_origin` setting to the full hostname of the web server (say,
http://<HOST_IP>/dashboard).
Related-Bug: #1467890
Implements blueprint: horizon-glance-large-image-upload
Change-Id: I5d842d614c16d3250380ea1dc1c6e0289d206fb5
System Information End points should be big enough for URL labels
by default.
Closes-bug: #1609138
Change-Id: Ic936072435055502e268fe15c07076620e4acde3
This patch follows on the example that the Containers set, providing
a 'switch' in the panel-enablement file that currently defaults to
'legacy' (Python-based Images panel) and allows for 'angular' (Angular-
based Images panel).
To be clear, this does NOT enable Angular Images. It's just setting the
stage to do so at some point, or to allow deployers/devs to easily switch
between the two.
A switch both for HORIZON_CONFIG and for integration tests is necessary
due to the way integration tests operate.
Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com>
Change-Id: I12cd33552218ed1082d2d9a2ae8982639a217a6a
Partially-Implements: blueprint angularize-images-table
project/vpn: Add IPSec Policy: HInt test has a bulleted list that
looks odd and is hard to read, see here: https://i.imgur.com/1jlPBBj.png
Took the opportunity to also clean up the IKE Policy and VPN views as
well.
Closes-bug: #1570526
Change-Id: Idfff6c48a237ce703756b3ab8e0dd37705a35b22
As follow on work to restoring the old network topology, this patch
separates embedded CSS in one of the html files into a separate SCSS
file.
This change is not intended to make topology themable. There is still
much work that needs to be done and will follow up soon.
Change-Id: I46b7152a24fc1f7a26a1752ba22d80e31ff1ffdb
Horizon radio buttons were using the standard browser radio buttons.
The default radio buttons have been altered to allow for a highly
customized experience through the use of CSS pseudo elements and
Icon Fonts. This allows the color, size, and unselected and selected
states of the checkbox to be altered. The 'default' theme uses the
standard Font Awesome radio button icons. The 'material' theme uses
the Material Design radio buttons. It was noted, during this refactor,
that there was an error in the _themable_checkbox template. This has
been fixed.
Change-Id: I1ca2e39e893b45adddf513c0dcb2670b2876594f
Partially-Implements: blueprint horizon-theme-css-reorg
This patch adds Angular Schema Form[1] and its requirements to Horizon.
There are a number of advantages to this over the current methods of
defining forms and workflows:
- All fields have an individual template, making theming improvements,
bug fixes, and bootstrap conformity easier.
- The file and line count, especially for workflows, is dramatically
reduced. The Create Net workflow, for example, goes from 12+ files to
2, with a big reduction in boilerplate HTML.
- All field validation messages are standardised, so we can match them
across Horizon and plugins
What this patch contains:
- Many common form fields, including things like the themable checkboxes
and selects.
- A basic modal template that can be passed with ui-bootstraps $modal
service to take advantage of schema-form
Next steps:
- Remove the other modal templates so we can standardise. A single
template opened from the $modal service is fine, and we shouldn't need
several directives. In this case, we should deprecate them, as the
modal forms will be used elsewhere.
- Map commonly used form items, like transfer tables, to a schema form
type like array (they serve similar purposes, so maybe thats what
should be replaced)
- Use themable selects instead of regular ones
1. http://schemaform.io/
Co-Authored-By: Tyr Johanson <tyr@hpe.com>
Implements: blueprint angular-schema-form
Change-Id: Ib22b2d0db2c4d4775fdef62a180cc994e8ae6280
Using the transitional-states framework defined in
https://review.openstack.org/#/c/346174
The images generic panel now defines a call-back method for determining
if an image is in a transitional state. Thid call-back is registered in
the registry for later use by the table.
Change-Id: Ibdb51157a540a2c23d5f5bb324d37a918c2e51ab
Co-Authored-By: Tyr Johanson tyr@hpe.com
Partially-Implements: blueprint angularize-images-table
There is a hole in the policy service caching layer
that has something to do with ng-repeat. The angular
http cache service doesn't seem to work within a single
digest cycle or something... so I simplfied and
improved performance by using memoize to
prevent redundant checks which were happening in
hz-dynamic-table.
See bug for details on verifying this manually.
Change-Id: Ib0b3a806d1c6b065e20cb22b8255048bd836dd1b
Closes-Bug: 1608623
hz-dynamic-table doesn't have any way to dynamically determine
whether or not to display a column. For example,
in openstack dashboard, we may want to display a column
only in certain policies pass check, if certain settings
are enabled, or services are enabled. In addition, a generic
allowed function can just be set on the column config.
This patch adds this ability as a reusable service.
The reusable service will make it possible for horizon
to easily check common sets of permissions on a
variety of objects including the hz-dynamic-table columns
(in this patch).
Child patches demonstrate its use on the images table.
Change-Id: I9f92b69d86d830387a83c28ec5829fb3c43fc4a6
Partially-Implements: blueprint angularize-images-table
Co-Authored-By: Matt Borland <matt.borland@hpe.com>
Array metadata appends an operator automatically, which
means the value will still contain something and it
doesn't get detected for removal.
In addition, bad APIs like glance v1 will store a property
with mixed case, but then return only lower case when
listing them. However, it will not remove the property
when you request to remove it unless it matches the original
case (sad panda). So, this patch will reset the proper
casing for properties defined as metadata definitions before
making the request to save the metadata.
Change-Id: I1e5a6fde35b7be6118f21ac46ad0aea088280215
Closes-Bug: 1606988
Running eslint is effectively useless nowdays because of the
overwhelming number of warnings returned.
This patch fixes the existing "space-in-parens" errors.
I've decided to only fix those errors here to keep the patch small, and
not destroy any chance of success by needing to rebase every 5 minutes.
Other fixes will be incoming.
Change-Id: Ie9292da293eea6a93751e6c17d24068b66c5d62a
Partial-Bug: #1554824
When the "path" portion of a route contains a '/', prevent Angular
from truncating it. This is common if the resource has a complex
key and wants to use '/' as a separator. For example:
/project/ngdns/zone/<zone_id>/recordset/<recordset_id>
Change-Id: I7b4fe1ba2b2f657ccee91de50cc9d5267544b51e
Closes-Bug: 1605670
We should not use toastService to test if an API call
went through successfully. This is extraneous.
This patch was motivated by the fact that we want to
remove conf.js, so we are moving the toast config
options to toast.service.js.
Change-Id: I966fb0d492ae8e9ae70af2882655cd36b4214a4a
The Image drawer should use the hz-property so it is kept in sync with all other
uses of the properties (in tables, etc.).
Gets rid of filters in favor of simple mappings or functions.
Moves several functions out of the module into a basic images-service so
it's easy to access/test functions.
Change-Id: I4d881744a398f9aa076830b576cb9f66335d8ba9
Partially-Implements: blueprint angular-registry
- cleanup help text in workflow and slide-out help panel (it's repetitive)
- add required asterisk to some form labels
- remove unnecessary css styles
- remove unnecessary eslint-disable/enable flags
Change-Id: I7de0dc7ee19816392003242431459eb73d141555
Closes-Bug: #1560594
Allow users to choose a server group when booting a VM. Adds
an optional workflow step to the launch instance workflow that
shows the available server groups and details about each group.
The ability to choose a server groups already exists for the
legacy launch instance workflow as a dropdown list, but having
it as a separate step in the angular workflow provides the added
capability of seeing group details.
To test this patch, create a server group via the nova CLI. Example:
nova server-group-create group1 affinity
And use the angular launch instance workflow to select a server
group. To validate the new instance was added to the server group,
use the nova CLI:
nova server-group-get [ID of server group]
Change-Id: I651817850ef8a5afec047a9a481843a5eddbf5a9
Implements: blueprint nova-server-groups
This patch overrides a Bootstrap's default property that disables
mouse events on elements with .form-control-feedback class. The password
icon had pointer-events: none; affecting password reveal functionality
in login form and Identity->Users->Create User. It also modifies the default
cursor for the password icon with pointer.
This patch also fixes a bug where the Eye Icon is misaligned when passwords
don't match (See #1604196)
Change-Id: I052321a5cc9adc1a7ffdfce4da0b55c245481a2d
Closes-bug: #1593430
Closes-bug: #1604196
This patch modifies the way in which the metadata is saved so that:
* it responds to metadata-changed events properly
* it saves the metadata
* it saves the image record
Change-Id: If21a7170e7a33f61619e1fa20faa32adc4bb3a90
Closes-Bug: 1584218
Material progress bars are so thin, that when you add text to them, its
unplesant. We need to support a progress bar type containing text that
is bigger by default.
Used this opportunity to align other progress bar experiences, and in
addition, generalize the text progress bar and progress loader bar for
general use everywhere.
Change-Id: I3d51c6a4582e3dc043f30632b6635a9ff17f5fbf
Closes-bug: #1602880