Commit Graph

25 Commits

Author SHA1 Message Date
wei.ying ce283b4a31 Add angular server groups panel
This patch adds angular server groups panel under the
project->compute panel group.

To be added in subsequent patches:
 - Create Action
 - Delete Action
 - Detais

To view the server groups panel only the 'ServerGroups' nova API
extension is available.

Change-Id: Ide9f54439c52cce9642c2dd417f9e7a8ad98e846
Implements: blueprint ng-server-groups
2018-03-10 17:29:41 +08:00
Jenkins f5b2561a09 Merge "Use POST not GET for keypair generation" 2017-06-16 09:00:05 +00:00
Beth Elwell 12fe351823 Adds basic angular QoS panel to Horizon
This patch adds the QoS panel which displays Neutron QoS policies.
This patch allows read only view of the policies, displaying the name,
id, description and shared status of each policy. Policy actions and
rules to be added in follow-up patches.

To test:
Neutron's QoS plugin must be enabled in your setup.
To enable the QoS plugin in devstack please add the following lines
in the local.conf

    enable_plugin neutron git://git.openstack.org/openstack/neutron
    enable_service q-qos

and rebuild your stack (./stack.sh).

Create some qos policies via CLI (neutron qos-policy-create policy1).
now you can list the policies using this patch.

Based on initial commit: https://review.openstack.org/#/c/247997
Co-Authored-By: Masco <mkaliyam@redhat.com>
Co-Authored-By: Rob Cresswell <robert.cresswell@outlook.com>

Change-Id: If46aeb04879d91a1a9305a94a23cecea2041d378
Implements: blueprint network-bandwidth-limiting-qos
2017-06-13 16:36:29 +01:00
Matt Borland d07fedc45f Use POST not GET for keypair generation
This patch fixes the Cross-Site Request Forgery (CSRF) attack against
the keypair generation pages:
- HORIZON_URL/project/key_pairs/PAIRNAME/generate/
- HORIZON_URL/project/key_pairs/PAIRNAME/download/
These pages exposed creating and/or overwriting a keypair with a given
name via a CSRF attack.

This patch closes these holes by using only POST-based keypair creation,
and exposing the keypair in the contents of a modal dialog instead of a
download, which ultimately requires a GET.  It uses the same client-side
features for both the Launch Instance keypair creation and Compute / Key
Pairs panel.

Closes-Bug: 1575913
Change-Id: Ie5ca28ff2bd806eb1481eba6f419b797b68856b6
2017-06-08 11:13:31 -07:00
Lajos Katona 3524b3d4f7 New readonly panel for trunks
Enable display of trunks on the project dashboard.

To test it devstack needs to have neutron with trunk support, eg:

 local.conf:
 enable_plugin neutron https://git.openstack.org/openstack/neutron
 enable_service q-trunk

No special horizon config is needed. As long as the 'trunk'
API extension is available (openstack extension show trunk)
the panel should automatically appear under Project/Network/Trunks.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Co-Authored-By: Bence Romsics <bence.romsics@ericsson.com>
Change-Id: Iacb83f22f81e09457953622e61065f0bb2c27407
Partially-Implements: blueprint neutron-trunk-ui
2017-05-24 02:34:33 +00:00
Cindy Lu c73e1c8fa8 NG details view route should not be '/project/...'
Right now the route includes the name 'project'
but we may have details view for 'identity' and
'admin' too, so it should be more general.

Picked just 'ngdetails' instead and moved this out as a
constant. Since this constant needs to be used
by the config blocks, I moved it out into its own
constant module.

Change-Id: I7603250dd70eb40568aa74be2ae4821ee8fcefcc
Closes-Bug: #1641250
2017-02-13 13:24:02 -08:00
Matt Borland e8e84c2db4 Flavors panel can switch to Angular
This patch enables all of the features for the Flavors panel to use Angular but
disables it, so that it is easy to switch on/off.

Note that we add integration test switches since it can't read the Django
conf.

Note that I changed the common tests to allow for testing of api calls that
don't produce error toasts, because we needed better branch coverage, and
the deleteFlavor api wasn't fully branch-tested.

Change-Id: I92b1b57bd486e5eb87179cb8d44b7551e9de2e0f
Partially-Implements: blueprint ng-flavors
2016-10-11 15:49:55 -07:00
Jenkins c5cc56db3d Merge "hz-dynamic-table: Column level permissions" 2016-07-30 02:16:42 +00:00
Travis Tripp 65f0f74390 hz-dynamic-table: Column level permissions
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>
2016-07-29 21:25:32 +00:00
Tyr Johanson 8f77a68547 Allow ngdetails path to contain '/'
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
2016-07-22 09:18:30 -06:00
Matt Borland 3aa3cc934b Adding generic table extensibility
This patch adds several features:
 * Global Actions (registry, extensible)
 * Drawer Templates (registry, replaceable)
 * Table Columns (registry, extensible)

I moved the resource registrations into their own module so it doesn't
clutter the app core module, and to help minimize memory utilization
at the app.core level.

Change-Id: I4a74a6630cb6ef6515b240855ee68283ef41eff3
Partially-Implements: blueprint angular-registry
2016-06-01 12:54:32 +00:00
Matt Borland 11968c840c Generic details display framework
This patch provides the ability for the registered detail views for
any resource type to be generically presented.

This patch does the following:
 * Adds a directive that displays a set of views (i.e. details sub-views)
 * Adds a Generic Detail display for routed pages
 * Adds the concept of a Descriptor which contains a resource type name
   and an identifier.  The identifier can be something as simple as
   a string, but may also be an object (if the resource type needs more
   than one value to look up its data, e.g. Pool Members)
 * Adds the ability for a resource type to have knowledge about how one
   of its items may be loaded, so any detail page can fetch the information
   given a basic context
 * Adds a generic Angular page (since they all just route to ng-views).
   We will see this used in subsequent patches as well.
 * Sets up a Django route to a non-navigational panel for the Details

Change-Id: Ie116b52ba196f9240fdc6bbc4a12d37beb9b9fcf
Partially-Implements: blueprint angular-registry
2016-05-16 11:39:57 -06:00
Jenkins ea8e7a504a Merge "[TrivialFix]Remove duplicated OS::Nova::Flavor registration" 2016-05-16 11:52:56 +00:00
jing.liuqing 25010e104c [TrivialFix]Remove duplicated OS::Nova::Flavor registration
Change-Id: I19b3c87fa855aca33ca57f185c615f8672992740
2016-05-15 21:16:41 +08:00
Travis Tripp bf10711608 Add OS::Nova::Hypervisor display name registration
OS::Nova::Hypervisor is not registered in the angular
resource registry. This add the base registration
with a display name.

See before and after screenshots here (searchlight-ui):

http://imgur.com/a/agze3

Change-Id: I9f42558c3620f5ac42620cab6f7d19a5e58564ee
Partially-Implements: blueprint angular-registry
2016-05-13 11:08:58 -06:00
Tyr Johanson 6192bfd7ac Images tables uses action promises
This patch demonstrates how promises returned by actions are
used by the images table. In particular, notice how specific
action event handlers do not need to be registered. This
allows a view to support a wide variety of actions without
needing to setup a specific event listener for each type of
event the action might emit.

One could argue that if action events were standardized, they
could still be used, which is true. Consider a generic SUCCESS
event. However, promises have additional benefits and avoid
some of the problems of events.

One advantage is that promises make it easy to "chain" multiple
handlers to a single success or failure. For example, once ALL
of these actions have completed successfully, then update a status
icon. We see another example of this in the delete-action.service
which uses a promise chain to convert the data returned by the
delete-modal.service into a standardized form used by actions.

Also, promises don't require that the caller have a parent scope.
In angular, events "bubble" from child scope to the parent
scope. These scopes are effectively the view hierarchy, where
a panel contains a table, which contains rows, which contain
buttons. However, actions are not view elements lke a table or
input box. Actions, like "delete image" are a behavior
that may be invoked independently, and the code that cares about
the success or failure of that action may not be a scope parent.

Added an action-result service that provides a convenience object
for creating such results.

Co-Authored-By: Matt Borland <matt.borland@hpe.com>

Partially-Implements: blueprint angular-registry
Change-Id: Id6725664e5654a4f75508993b9640a0de80c6884
2016-05-05 14:06:18 -06:00
Travis Tripp 0d84df74ae Change Registry Label for Server to Instance
The registry has OS::Nova::Server registered with a label of Server.

This is not consistent with "instance" naming in horizon.
This impacts usage in the search panel.

Before:
http://pasteboard.co/8wghjVS.png

After:
http://pasteboard.co/8whGcA1.png

Change-Id: I41e24b56afea127fdc6fc4f66d9d3b119807b649
Closes-Bug: 1569493
2016-04-13 03:34:07 +00:00
Matt Borland 8f878166f3 Adding Resource Type registration
This patch adds to the registry service to allow for resource types
to have their properties registered with configuration information.

It provides various convenience methods for outputting the property
labels and values, all determined through the registry, and provides
for singular and plural names to be defined.

This patch also registers many of the OpenStack resource types so
they may be used by implementations.  Ideally those are broken into
component modules, but until those are written they can reside here.

Change-Id: I71bebe253452944ff518f85b8840cfe921602544
Partially-Implements: blueprint angularize-images-table
2016-03-01 15:28:33 -07:00
Matt Borland 622ab37514 Adding resource type registry service
In the Angular code we have established Actions that we are using in
table rows and headings.  These actions right now are collected by
individual custom services which are in turn used by pages that need
the actions (Image table page uses Image row and batch actions).

This patch eliminates the need to write custom services and instead
centralizes the registration of these actions.  On registraton they are
associated with a string which is a resource-type specification (used
in Searchlight, for example: 'OS::Glance::Image').  This makes the actions
available to any party needing to use them.

The actions are registered in modules' run clauses so they are
automatically registered, with the desired actions injected into the
registration.  This makes it easy for people to add their own actions
or their own resource types.

Change-Id: Ied6040b41513e9eaccecf59e82da1634df6ac08b
Partially-Implements: blueprint angularize-images-table
2016-02-18 16:02:16 -07:00
Szymon Wroblewski f030262521 Angular metadata update modal
This patch adds metadata update modal dialog widet written in js
and some required REST API methods.

To see it in action checkout following patch
https://review.openstack.org/#/c/184275/
which replaces old metadata modals with new ones written in angular.

Co-Authored-By: Shaoquan Chen <sean.chen2@hp.com>
Co-Authored-By: Rajat Vig <rajatv@thoughtworks.com>

Partially-Implements: blueprint angularize-metadata-update-modals
Change-Id: I36bfb91f8b6bbba49fed6bb01cd1dd266261cfdb
2015-08-25 15:20:47 +02:00
Nathan Zeplowitz 6470157efe JSCS Cleanup - Fix ng-di errors on cloud-services
Split the cloud-services.js into multiple files and
associated spec files

Use $inject to manually identify the dependencies for components
inside cloud-services as recommended at
https://github.com/johnpapa/angular-styleguide#style-y091

Change-Id: Ide815e8755d90e51e9fd18630c56502409084630
Partially-Implements: blueprint jscs-cleanup
2015-08-04 08:16:41 +00:00
Shaoquan Chen 0d4cf1661e Dashboard ReOrg - Move APIs into app/core
This patch relocates the 'openstack-service-api' directory because
they are application specific, but needed by multiple dashboards.

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

Change-Id: Ie5455f3ca4cfaacb99cbccd66c95fb3ad31da272
Partial-Bug: #1478717
2015-08-03 14:25:37 -06:00
Travis Tripp eaf27075b6 Adding Angular Project Images Table
This patch adds the images table to the projects panel.

It follows the pattern established by the following review:
https://review.openstack.org/#/c/197373/

However, it pre-fixes the table files with images- to make them
easier to find via search in tools like the pycharms debugger
and it the javascript console on various browsers.

To be added in subsequent patches:
 - Actions
 - Forms
 - Common images table directive (TBD)
 - Filters via Magic Search
 - Integration to Searchlight

To test set DISABLED = False in _203_project_images_panel.py

Change-Id: I5e509fb807c356d3fb4b58e974ffa160828dbf88
Partially-Implements: blueprint angularize-images-table
2015-07-27 11:50:50 -06:00
Shaoquan Chen fede7c2a7e Dashboard ReOrg - Move workflow into app/core
This patch relocates the 'workflow' directory because
it is application specific, but needed by multiple dashboards.

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

Change-Id: I0c2d8bb9bfd5ea14c2d970293ad2707e324fd5ab
Partially-Bug: #1458697
2015-07-13 21:48:41 +00:00
Shaoquan Chen ae9f5ce4b0 Dashboard ReOrg - Create app/core directory
This patch creates the app/core directory. This will be the home
for code that is application specific, but needed by multiple
dashboards, such as the API files.

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

Change-Id: I93386a3b3bafe65f51eee72ff93283f1688de016
Partially-Bug: #1458697
2015-07-09 14:32:19 -07:00