diff --git a/README.md b/README.md index 235f7607..b111bc14 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,11 @@ Monasca UI is implemented as a horizon plugin that adds panels to horizon. It is by monasca-vagrant. For a UI development setup: * git clone https://github.com/openstack/horizon.git # clone horizon * git clone https://github.com/stackforge/monasca-ui.git # clone monasca-ui +* git clone https://github.com/hpcloud-mon/grafana.git * cd horizon * cp ../monasca-ui/enabled/* openstack_dashbaord/local/enabled # Copy enabled files * ln -s ../monasca-ui/monitoring monitoring +* ln -s ../../../grafana/src monitoring/static/grafana * tools/with_venv.sh pip install -r ../monasca-ui/requirements.txt # License diff --git a/cosmos/overcloud/__init__.py b/cosmos/overcloud/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/enabled/_40_cosmos.py b/enabled/_40_cosmos.py deleted file mode 100644 index c4879a8d..00000000 --- a/enabled/_40_cosmos.py +++ /dev/null @@ -1,10 +0,0 @@ -# The name of the dashboard to be added to HORIZON['dashboards']. Required. -DASHBOARD = 'overcloud' - -# A list of applications to be added to INSTALLED_APPS. -ADD_INSTALLED_APPS = [ - 'openstack_dashboard.dashboards.overcloud', -] - -# If set to True, this dashboard will not be added to the settings. -DISABLED = False diff --git a/enabled/_40_router.py.example b/enabled/_40_router.py.example deleted file mode 100644 index 36a888dd..00000000 --- a/enabled/_40_router.py.example +++ /dev/null @@ -1,5 +0,0 @@ -# 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 diff --git a/enabled/_45_monitoring_panel_group.py b/enabled/_45_monitoring_panel_group.py deleted file mode 100644 index 3b8a80e9..00000000 --- a/enabled/_45_monitoring_panel_group.py +++ /dev/null @@ -1,6 +0,0 @@ -# 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' diff --git a/enabled/_50_admin_add_monitoring_panel.py b/enabled/_50_admin_add_monitoring_panel.py index 75e53aad..df5aac65 100644 --- a/enabled/_50_admin_add_monitoring_panel.py +++ b/enabled/_50_admin_add_monitoring_panel.py @@ -1,18 +1,7 @@ -# The name of the panel to be added to HORIZON_CONFIG. Required. -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 = 'monitoring' - -DEFAULT_PANEL = 'alarms' - -# Python panel class of the PANEL to be added. -ADD_PANEL = \ - 'monitoring.alarms.panel.Monitoring' +DASHBOARD = "monitoring" # A list of applications to be added to INSTALLED_APPS. -ADD_INSTALLED_APPS = ['monitoring', 'grafana'] +ADD_INSTALLED_APPS = ['monitoring'] # A list of angular modules to be added as dependencies to horizon app. ADD_ANGULAR_MODULES = ['monitoringApp'] diff --git a/enabled/_60_admin_add_notification_panel.py b/enabled/_60_admin_add_notification_panel.py deleted file mode 100644 index 0426abf8..00000000 --- a/enabled/_60_admin_add_notification_panel.py +++ /dev/null @@ -1,17 +0,0 @@ -# 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'] - diff --git a/monitoring/alarms/constants.py b/monitoring/alarms/constants.py index d7030b8e..b974b297 100644 --- a/monitoring/alarms/constants.py +++ b/monitoring/alarms/constants.py @@ -15,8 +15,8 @@ # under the License. -URL_PREFIX = 'horizon:overcloud:alarms:' -TEMPLATE_PREFIX = 'overcloud/alarms/' +URL_PREFIX = 'horizon:monitoring:alarms:' +TEMPLATE_PREFIX = 'monitoring/alarms/' CRITICAL_ICON = '/static/monitoring/img/critical-icon.png' WARNING_ICON = '/static/monitoring/img/warning-icon.png' diff --git a/monitoring/alarms/panel.py b/monitoring/alarms/panel.py index a7c42bc5..154856bd 100644 --- a/monitoring/alarms/panel.py +++ b/monitoring/alarms/panel.py @@ -18,7 +18,12 @@ from django.utils.translation import ugettext_lazy as _ # noqa import horizon +from monitoring import dashboard -class Monitoring(horizon.Panel): + +class Alarms(horizon.Panel): name = _("Alarms") slug = 'alarms' + + +dashboard.Monitoring.register(Alarms) diff --git a/monitoring/alarms/templates/alarms/create.html b/monitoring/alarms/templates/alarms/create.html index 4a5daf46..e43e063d 100644 --- a/monitoring/alarms/templates/alarms/create.html +++ b/monitoring/alarms/templates/alarms/create.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'overcloud/alarms/_create.html' %} + {% include 'monitoring/alarms/_create.html' %} {% endblock %} diff --git a/monitoring/alarms/templates/alarms/detail.html b/monitoring/alarms/templates/alarms/detail.html index 0c244c30..cba076d8 100644 --- a/monitoring/alarms/templates/alarms/detail.html +++ b/monitoring/alarms/templates/alarms/detail.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'overcloud/alarms/_detail.html' %} + {% include 'monitoring/alarms/_detail.html' %} {% endblock %} diff --git a/monitoring/alarms/templates/alarms/edit.html b/monitoring/alarms/templates/alarms/edit.html index a675905f..f8fb6e69 100644 --- a/monitoring/alarms/templates/alarms/edit.html +++ b/monitoring/alarms/templates/alarms/edit.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'overcloud/alarms/_edit.html' %} + {% include 'monitoring/alarms/_edit.html' %} {% endblock %} diff --git a/monitoring/alarms/templates/alarms/index.html b/monitoring/alarms/templates/alarms/index.html index b93d744d..48e41c5a 100644 --- a/monitoring/alarms/templates/alarms/index.html +++ b/monitoring/alarms/templates/alarms/index.html @@ -8,8 +8,8 @@ {% load url from future %} {% block main %}
- {% trans 'All Alarms' %} + {% trans 'All Alarms' %} {% trans 'Dashboard' %}
- {% include 'overcloud/alarms/monitor.html' %} + {% include 'monitoring/alarms/monitor.html' %} {% endblock %} \ No newline at end of file diff --git a/monitoring/alarms/templates/alarms/monitor.html b/monitoring/alarms/templates/alarms/monitor.html index 8b36475d..9c520a20 100644 --- a/monitoring/alarms/templates/alarms/monitor.html +++ b/monitoring/alarms/templates/alarms/monitor.html @@ -56,7 +56,7 @@ {$ group.name $}
- +
diff --git a/cosmos/overcloud/dashboard.py b/monitoring/dashboard.py similarity index 79% rename from cosmos/overcloud/dashboard.py rename to monitoring/dashboard.py index fdbfe52c..585dcc76 100644 --- a/cosmos/overcloud/dashboard.py +++ b/monitoring/dashboard.py @@ -19,10 +19,11 @@ from django.utils.translation import ugettext_lazy as _ import horizon -class OverCloud(horizon.Dashboard): - name = _("OverCloud") - slug = "overcloud" - panels = () +class Monitoring(horizon.Dashboard): + name = _("Monitoring") + slug = "monitoring" + panels = ('alarms', 'notifications') + default_panel = 'alarms' -horizon.register(OverCloud) +horizon.register(Monitoring) diff --git a/cosmos/overcloud/models.py b/monitoring/models.py similarity index 100% rename from cosmos/overcloud/models.py rename to monitoring/models.py diff --git a/monitoring/notifications/constants.py b/monitoring/notifications/constants.py index 14f94f6e..caeff19d 100644 --- a/monitoring/notifications/constants.py +++ b/monitoring/notifications/constants.py @@ -38,5 +38,5 @@ PHONE_VALIDATOR = validators.RegexValidator( EMAIL_VALIDATOR = validators.EmailValidator( message=_("Address must contain a valid email address.")) -URL_PREFIX = 'horizon:overcloud:notifications:' -TEMPLATE_PREFIX = 'overcloud/notifications/' +URL_PREFIX = 'horizon:monitoring:notifications:' +TEMPLATE_PREFIX = 'monitoring/notifications/' diff --git a/monitoring/notifications/panel.py b/monitoring/notifications/panel.py index f46a2e46..f2e8b8e5 100644 --- a/monitoring/notifications/panel.py +++ b/monitoring/notifications/panel.py @@ -17,8 +17,12 @@ from django.utils.translation import ugettext_lazy as _ # noqa import horizon +from monitoring import dashboard class Notifications(horizon.Panel): name = _("Notifications") slug = 'notifications' + + +dashboard.Monitoring.register(Notifications) \ No newline at end of file diff --git a/monitoring/notifications/templates/notifications/create.html b/monitoring/notifications/templates/notifications/create.html index 6ac22546..c9ee38e6 100644 --- a/monitoring/notifications/templates/notifications/create.html +++ b/monitoring/notifications/templates/notifications/create.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'overcloud/notifications/_create.html' %} + {% include 'monitoring/notifications/_create.html' %} {% endblock %} diff --git a/monitoring/notifications/templates/notifications/detail.html b/monitoring/notifications/templates/notifications/detail.html index 8a8c57eb..34ab71ac 100644 --- a/monitoring/notifications/templates/notifications/detail.html +++ b/monitoring/notifications/templates/notifications/detail.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'overcloud/notifications/_detail.html' %} + {% include 'monitoring/notifications/_detail.html' %} {% endblock %} diff --git a/monitoring/notifications/templates/notifications/edit.html b/monitoring/notifications/templates/notifications/edit.html index a14e4343..cb099e00 100644 --- a/monitoring/notifications/templates/notifications/edit.html +++ b/monitoring/notifications/templates/notifications/edit.html @@ -7,5 +7,5 @@ {% endblock page_header %} {% block main %} - {% include 'overcloud/notifications/_edit.html' %} + {% include 'monitoring/notifications/_edit.html' %} {% endblock %} diff --git a/monitoring/static/monitoring/js/controllers.js b/monitoring/static/monitoring/js/controllers.js index 1a36b586..58e5394d 100644 --- a/monitoring/static/monitoring/js/controllers.js +++ b/monitoring/static/monitoring/js/controllers.js @@ -2,7 +2,7 @@ angular.module('monitoring.controllers', []) .controller('monitoringController', function ($scope, $http, $timeout) { $scope.fetchStatus = function() { - $http({method: 'GET', url: '/overcloud/status'}). + $http({method: 'GET', url: '/monitoring/status'}). success(function(data, status, headers, config) { // this callback will be called asynchronously // when the response is available diff --git a/setup.cfg b/setup.cfg index 4ace433c..3065ec2d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,7 +21,6 @@ classifier = [files] packages = monitoring - cosmos enabled [pbr]