From 3b5d9764fe0a93498993124379ea9e95fa58430b Mon Sep 17 00:00:00 2001 From: Hiroyuki Eguchi Date: Thu, 16 Jun 2016 01:05:07 +0000 Subject: [PATCH] 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 --- .../dashboards/project/ngvolumes/__init__.py | 0 .../dashboards/project/ngvolumes/panel.py | 23 ++++++++++++++ .../dashboards/project/ngvolumes/urls.py | 22 ++++++++++++++ .../dashboards/project/ngvolumes/views.py | 19 ++++++++++++ .../enabled/_1041_project_ng_volumes_panel.py | 30 +++++++++++++++++++ 5 files changed, 94 insertions(+) create mode 100644 openstack_dashboard/dashboards/project/ngvolumes/__init__.py create mode 100644 openstack_dashboard/dashboards/project/ngvolumes/panel.py create mode 100644 openstack_dashboard/dashboards/project/ngvolumes/urls.py create mode 100644 openstack_dashboard/dashboards/project/ngvolumes/views.py create mode 100644 openstack_dashboard/enabled/_1041_project_ng_volumes_panel.py diff --git a/openstack_dashboard/dashboards/project/ngvolumes/__init__.py b/openstack_dashboard/dashboards/project/ngvolumes/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/openstack_dashboard/dashboards/project/ngvolumes/panel.py b/openstack_dashboard/dashboards/project/ngvolumes/panel.py new file mode 100644 index 000000000..1ab2c7619 --- /dev/null +++ b/openstack_dashboard/dashboards/project/ngvolumes/panel.py @@ -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',) diff --git a/openstack_dashboard/dashboards/project/ngvolumes/urls.py b/openstack_dashboard/dashboards/project/ngvolumes/urls.py new file mode 100644 index 000000000..85c92331a --- /dev/null +++ b/openstack_dashboard/dashboards/project/ngvolumes/urls.py @@ -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'), +] diff --git a/openstack_dashboard/dashboards/project/ngvolumes/views.py b/openstack_dashboard/dashboards/project/ngvolumes/views.py new file mode 100644 index 000000000..fd1a327fa --- /dev/null +++ b/openstack_dashboard/dashboards/project/ngvolumes/views.py @@ -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' diff --git a/openstack_dashboard/enabled/_1041_project_ng_volumes_panel.py b/openstack_dashboard/enabled/_1041_project_ng_volumes_panel.py new file mode 100644 index 000000000..36baf8e1c --- /dev/null +++ b/openstack_dashboard/enabled/_1041_project_ng_volumes_panel.py @@ -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'