First pass at refactor notifications
This commit is contained in:
parent
0533ea8168
commit
de312c7bb0
5
enabled/_40_router.py.example
Normal file
5
enabled/_40_router.py.example
Normal file
@ -0,0 +1,5 @@
|
||||
# The name of the dashboard to be added to HORIZON['dashboards']. Required.
|
||||
DASHBOARD = 'router'
|
||||
|
||||
# If set to True, this dashboard will not be added to the settings.
|
||||
DISABLED = False
|
6
enabled/_45_monitoring_panel_group.py
Normal file
6
enabled/_45_monitoring_panel_group.py
Normal file
@ -0,0 +1,6 @@
|
||||
# The name of the panel group to be added to HORIZON_CONFIG. Required.
|
||||
PANEL_GROUP = 'monitoring'
|
||||
# The display name of the PANEL_GROUP. Required.
|
||||
PANEL_GROUP_NAME = 'Monitoring'
|
||||
# The name of the dashboard the PANEL_GROUP associated with. Required.
|
||||
PANEL_GROUP_DASHBOARD = 'overcloud'
|
@ -3,9 +3,9 @@ PANEL = 'monitoring'
|
||||
# The name of the dashboard the PANEL associated with. Required.
|
||||
PANEL_DASHBOARD = 'overcloud'
|
||||
# The name of the panel group the PANEL is associated with.
|
||||
PANEL_GROUP = 'default'
|
||||
PANEL_GROUP = 'monitoring'
|
||||
|
||||
DEFAULT_PANEL = 'monitoring'
|
||||
DEFAULT_PANEL = 'alarms'
|
||||
|
||||
# Python panel class of the PANEL to be added.
|
||||
ADD_PANEL = \
|
||||
@ -16,3 +16,4 @@ ADD_INSTALLED_APPS = ['monitoring']
|
||||
|
||||
# A list of angular modules to be added as dependencies to horizon app.
|
||||
#ADD_ANGULAR_MODULE = ['monitoringApp']
|
||||
|
||||
|
17
enabled/_60_admin_add_notification_panel.py
Normal file
17
enabled/_60_admin_add_notification_panel.py
Normal file
@ -0,0 +1,17 @@
|
||||
# The name of the panel to be added to HORIZON_CONFIG. Required.
|
||||
PANEL = 'notifications'
|
||||
# The name of the dashboard the PANEL associated with. Required.
|
||||
PANEL_DASHBOARD = 'overcloud'
|
||||
# The name of the panel group the PANEL is associated with.
|
||||
PANEL_GROUP = 'monitoring'
|
||||
|
||||
# Python panel class of the PANEL to be added.
|
||||
ADD_PANEL = \
|
||||
'monitoring.notifications.panel.Notifications'
|
||||
|
||||
# A list of applications to be added to INSTALLED_APPS.
|
||||
#ADD_INSTALLED_APPS = ['monitoring']
|
||||
|
||||
# A list of angular modules to be added as dependencies to horizon app.
|
||||
#ADD_ANGULAR_MODULE = ['monitoringApp']
|
||||
|
@ -38,8 +38,8 @@ PHONE_VALIDATOR = validators.RegexValidator(
|
||||
EMAIL_VALIDATOR = validators.EmailValidator(
|
||||
message=_("Address must contain a valid email address."))
|
||||
|
||||
URL_PREFIX = 'horizon:overcloud:monitoring:'
|
||||
TEMPLATE_PREFIX = 'overcloud/monitoring/'
|
||||
URL_PREFIX = 'horizon:overcloud:alarms:'
|
||||
TEMPLATE_PREFIX = 'overcloud/alarms/'
|
||||
|
||||
CRITICAL_ICON = '/static/monitoring/img/critical-icon.png'
|
||||
WARNING_ICON = '/static/monitoring/img/warning-icon.png'
|
||||
|
0
monitoring/notifications/__init__.py
Normal file
0
monitoring/notifications/__init__.py
Normal file
25
monitoring/notifications/panel.py
Normal file
25
monitoring/notifications/panel.py
Normal file
@ -0,0 +1,25 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2013 Hewlett-Packard Development Company, 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 Notifications(horizon.Panel):
|
||||
name = _("Notifications")
|
||||
slug = 'notifications'
|
||||
permissions = ('openstack.roles.admin', )
|
46
monitoring/notifications/urls.py
Normal file
46
monitoring/notifications/urls.py
Normal file
@ -0,0 +1,46 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2013 Hewlett-Packard Development Company, 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 patterns
|
||||
from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
|
||||
urlpatterns = patterns(
|
||||
'',
|
||||
url(r'^$', views.IndexView.as_view(), name='index'),
|
||||
url(r'^status', views.StatusView.as_view(), name='status'),
|
||||
url(r'^alarm/(?P<service>[^/]+)/$',
|
||||
views.AlarmServiceView.as_view(),
|
||||
name='alarm'),
|
||||
url(r'^history/(?P<service>[^/]+)$',
|
||||
views.AlarmHistoryView.as_view(),
|
||||
name='history'),
|
||||
url(r'^meters/(?P<service>[^/]+)$',
|
||||
views.AlarmMeterView.as_view(),
|
||||
name='meters'),
|
||||
url(r'^alarm/(?P<service>[^/]+)/create$',
|
||||
views.AlarmCreateView.as_view(),
|
||||
name='alarm_create'),
|
||||
url(r'^(?P<id>[^/]+)/alarm_detail/$',
|
||||
views.AlarmDetailView.as_view(),
|
||||
name='alarm_detail'),
|
||||
url(r'^alarm/(?P<service>[^/]+)/(?P<id>[^/]+)/alarm_edit/$',
|
||||
views.AlarmEditView.as_view(),
|
||||
name='alarm_edit'),
|
||||
url(r'^notification_create$',
|
||||
views.NotificationCreateView.as_view(),
|
||||
name='notification_create'),
|
||||
)
|
@ -20,6 +20,6 @@ import horizon
|
||||
|
||||
|
||||
class Monitoring(horizon.Panel):
|
||||
name = _("Monitoring")
|
||||
slug = 'monitoring'
|
||||
name = _("Alarms")
|
||||
slug = 'alarms'
|
||||
permissions = ('openstack.roles.admin', )
|
||||
|
Loading…
Reference in New Issue
Block a user