diff --git a/monitoring/alarmdefs/forms.py b/monitoring/alarmdefs/forms.py index 79c30028..3fadb7c3 100644 --- a/monitoring/alarmdefs/forms.py +++ b/monitoring/alarmdefs/forms.py @@ -60,7 +60,6 @@ class ExpressionWidget(forms.Widget): t = get_template(constants.TEMPLATE_PREFIX + 'expression_field.html') local_attrs = { - 'service': '', 'func': ExpressionWidget.func, 'comparators': ExpressionWidget.comparators, 'operators': ExpressionWidget.operators, diff --git a/monitoring/alarmdefs/tables.py b/monitoring/alarmdefs/tables.py index 0c3e4b13..27580229 100644 --- a/monitoring/alarmdefs/tables.py +++ b/monitoring/alarmdefs/tables.py @@ -17,6 +17,7 @@ import logging from django.core import urlresolvers +from django.http import HttpResponse from django.utils.translation import ugettext_lazy as _ # noqa from horizon import tables @@ -30,12 +31,11 @@ LOG = logging.getLogger(__name__) class CreateAlarm(tables.LinkAction): name = "create_alarm" verbose_name = _("Create Alarm Definition") - classes = ("ajax-modal",) + classes = ("ajax-modal", "btn-create") icon = "plus" policy_rules = (("alarm", "alarm:create"),) ajax = True - def get_link_url(self): return urlresolvers.reverse(constants.URL_PREFIX + 'alarm_create', args=()) diff --git a/monitoring/alarmdefs/templates/alarmdefs/alarm.html b/monitoring/alarmdefs/templates/alarmdefs/alarm.html index 22af43b3..60533f1e 100644 --- a/monitoring/alarmdefs/templates/alarmdefs/alarm.html +++ b/monitoring/alarmdefs/templates/alarmdefs/alarm.html @@ -8,7 +8,6 @@ {% block css %} {% include "_stylesheets.html" %} - {% endblock %} {% block page_header %} diff --git a/monitoring/alarmdefs/templates/alarmdefs/expression_field.html b/monitoring/alarmdefs/templates/alarmdefs/expression_field.html index 4edc7fff..9fa6265d 100644 --- a/monitoring/alarmdefs/templates/alarmdefs/expression_field.html +++ b/monitoring/alarmdefs/templates/alarmdefs/expression_field.html @@ -1,95 +1,4 @@ -{% load i18n %} - -{% block js %}{% spaceless %} - -{% endspaceless %}{% endblock %} - - -
- - - -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- - - - -
-
-
- -
-
-
- -
-
-
- - - - - - - - - - -
Matching Metrics
{$name$}
{$metric[dim] | spacedim $}
-
-
-
- -
+ diff --git a/monitoring/alarmdefs/templates/alarmdefs/expression_step.html b/monitoring/alarmdefs/templates/alarmdefs/expression_step.html deleted file mode 100644 index 0ea1ca41..00000000 --- a/monitoring/alarmdefs/templates/alarmdefs/expression_step.html +++ /dev/null @@ -1,16 +0,0 @@ - - -
-
-
- {{ step.get_help_text }} -
-
-
-
- {% include "horizon/common/_form_fields.html" %} -
-
-
diff --git a/monitoring/alarmdefs/templates/alarmdefs/match_by_field.html b/monitoring/alarmdefs/templates/alarmdefs/match_by_field.html index f4fbc643..d680c33d 100644 --- a/monitoring/alarmdefs/templates/alarmdefs/match_by_field.html +++ b/monitoring/alarmdefs/templates/alarmdefs/match_by_field.html @@ -1,12 +1,15 @@ {% load i18n %} -
+
- - + on-tag-added="ctrl.saveDimKey()" + on-tag-removed="ctrl.saveDimKey()"> +
diff --git a/monitoring/alarmdefs/templates/alarmdefs/notification_step.html b/monitoring/alarmdefs/templates/alarmdefs/workflow_step.html similarity index 54% rename from monitoring/alarmdefs/templates/alarmdefs/notification_step.html rename to monitoring/alarmdefs/templates/alarmdefs/workflow_step.html index 44102b31..60b94f55 100644 --- a/monitoring/alarmdefs/templates/alarmdefs/notification_step.html +++ b/monitoring/alarmdefs/templates/alarmdefs/workflow_step.html @@ -2,13 +2,14 @@
-
+ +
-
- {% include "horizon/common/_form_fields.html" %} -
+
+ {% include "horizon/common/_form_fields.html" %} +
diff --git a/monitoring/alarmdefs/tests.py b/monitoring/alarmdefs/tests.py index 25bf0429..d0cb99a3 100644 --- a/monitoring/alarmdefs/tests.py +++ b/monitoring/alarmdefs/tests.py @@ -82,7 +82,7 @@ class AlarmDefinitionsTest(helpers.TestCase): self.assertContains(res, ' + + + +
+ +
+
{{ vm.expression }}
+
+ +
+ +
+
+ + + +
+ + + + + + + + + +
+ +
+
+
+
+ +
diff --git a/monitoring/static/monitoring/widgets/expression/sub-expression.tpl.html b/monitoring/static/monitoring/widgets/expression/sub-expression.tpl.html new file mode 100644 index 00000000..2b9d42d6 --- /dev/null +++ b/monitoring/static/monitoring/widgets/expression/sub-expression.tpl.html @@ -0,0 +1,155 @@ +
+ {{ vm.model | monExpression:false }} +
+ +
+ +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ + + + +
+
+
+ + +
+
+
+ + + + +