Add Angular Project Volumes Panel

This patch creates a blank Volumes panel in the project dashboard.

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

To be added in subsequent patches:
 - Actions
 - Tables
 - Filters via Magic Search
 - Integration to Searchlight

To test:
It doesn't work with only this one.
You can test volumes panel and table with this patch.
https://review.openstack.org/#/c/319051/

Partially-Implements: blueprint angularize-volumes-table
Change-Id: I17fdf46162187cd127d645370673fe3a3fe39db4
This commit is contained in:
Hiroyuki Eguchi 2016-06-16 01:05:07 +00:00
parent 7df4449e2c
commit 3b5d9764fe
5 changed files with 94 additions and 0 deletions

View File

@ -0,0 +1,23 @@
# (c) Copyright 2016 NEC Corporation, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.utils.translation import ugettext_lazy as _
import horizon
class NGVolumes(horizon.Panel):
name = _("Volumes")
slug = 'ngvolumes'
permissions = ('openstack.services.volume',)

View File

@ -0,0 +1,22 @@
# (c) Copyright 2016 NEC Corporation, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.conf.urls import url
from openstack_dashboard.dashboards.project.ngvolumes import views
urlpatterns = [
url('', views.IndexView.as_view(), name='index'),
]

View File

@ -0,0 +1,19 @@
# (c) Copyright 2016 NEC Corporation, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.views import generic
class IndexView(generic.TemplateView):
template_name = 'angular.html'

View File

@ -0,0 +1,30 @@
# (c) Copyright 2016 NEC Corporation, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
# If you want the panel to show up without a panel group,
# use the panel group "default".
PANEL_GROUP = 'compute'
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'ngvolumes'
# If set to True, this settings file will not be added to the settings.
DISABLED = True
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.project.ngvolumes.panel.NGVolumes'