This patch allows administrators to set disk_formats only for glance,
while horizon will retrieve list of supported formats from glance API.
IMAGE_BACKEND_SETTINGS still may be used to redefine display name
of the format or additionally limit list of availble ones.
Change-Id: Ia4ea513023895f4ad2a87f91e3d2837c7668d9ae
Closes-Bug: 1853822
Horizon's AngularJS pages (for example Images and Keypairs)
display dates using browser's timezone now. This change makes
AngularJS pages use Horizon's Settings Timezone instead of
browser's timezone and if Timezone is not set under Settings,
AngularJS pages will display dates in 'UTC' timezone.
Closes-Bug: 1832768
Change-Id: Ibbed19600bfe6b13c43b9f09fa484cb78524b0d6
Currently horizon defines default values of settings in the logic
using getattr(settings, <setting name>, <default value>) and
it is not easy to handle the default values of available settings.
This commit starts the effort to define default settings explicitly.
This is a preparation for ini-based-configurations.
It covers settings in openstack_dashboard/api.
Part of blueprint ini-based-configuration
Change-Id: Id4c3287f0a572fd14ea93b54bcab8fabda39e583
Several Angular based dashboards, such as images and snapshots,
not regenerated after some item on this page changes its status
from transition state.
For example, an image may be shown forever in the "Creating" state
with running progress bar. To improve UI this patch re-upload items
list until some item in transition state.
If status of item changed, then 'trackBy' field changed and
Angular will re-render row with this particular item with
ng-repeat-start directive and won't re-render all entire page.
Change-Id: I2308baebb65b11180d66bd69d834386022c2ad84
Closes-bug: #1797592
Since the APIVersionManager stored the version numbers as ints and
floats, it was not possible to distinguish between version 1.2 and 1.20,
and also version 1.2 would be considered higher than version 1.13. With
the introduction of microversioning in some services, the version
numbers inflate quickly, making this a problem.
This patch wraps the version numbers in a Version object, that stores
the information as a semantic_version and correctly compares with other
Version objects, as well as ints, floats and strings.
It also removes the check for version being specified as a string, so
that it's possible to specify versions such as 1.20 without having to
explicitly create Version objects.
Change-Id: I0b0d87582d617290f08359ad181216cb99edb768
Closes-Bug: #1649819
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
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
This original method to retrieve user settings has been
replaced by https://review.openstack.org/#/c/170351/.
Remove old way to prevent confusion.
Change-Id: I4fec94a78168d48fee5b21d24064200b2aefce91
Closes-Bug: #1455246
This patch provides the rest API needed to
get settings that allow conditionally
displaying the volume device name
and admin password.
Examples:
settingsService.ifEnabled('setting').then(doThis);
settingsService.ifEnabled('setting', 'expected', 'default').then(doThis, elseThis);
Change-Id: I8d16f4b974786157c5aa562e2675e6e60aabc412
Partial-Bug: #1439906
Partial-Bug: #1439905
We have a lot of new angular widgets and panels coming, and some of them
will need access to configs stored in settings. Right now, the default way to
get them is through _conf.html or _script.html. We should really fetch them
through the new REST layer instead. This ensures we are following the same
pattern already set up for angular panels and services.
This version:
- add localstorage for caching config front-end
Change-Id: I94ce8ef3e8367be99bbba2f6ddd7e4529d819d58
Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
Implements: blueprint config-restful