Skip to content

Commit

Permalink
Cleanup visual alignment in alert form and add success bubble notific…
Browse files Browse the repository at this point in the history
…ation feedback when alert is created.
  • Loading branch information
mtho11 committed Mar 5, 2015
1 parent fec4126 commit c8c5a25
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
3 changes: 3 additions & 0 deletions dist/hawkular-ui-components-metrics.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,6 @@ h2 {
.response-time h1 {
margin-top: 10px;
}
#alert-radio-container {
text-align: left;
}
7 changes: 3 additions & 4 deletions dist/hawkular-ui-components-metrics.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions plugins/metrics/plugins/metrics/html/metrics-response.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ <h1>Response Time</h1>
</div>

<div ng-controller="QuickAlertController as qac" ng-show="vm.chartData.dataPoints.length > 1">
<div ng-if="!showQuickAlert" class="col-sm-9 col-md-10 content">
<div ng-show="!showQuickAlert" class="col-sm-9 col-md-10 content">
<button class="btn btn-primary pull-left" ng-click="qac.toggleQuickAlert()">Add an Alert</button>
</div>
<div ng-if="showQuickAlert" class="col-sm-9 col-md-10 content">
<div ng-show="showQuickAlert" class="col-sm-9 col-md-10 content">
<h1>Add an Alert</h1>

<form class="form-horizontal" name="addQuickAlertForm" role="form">
Expand All @@ -65,7 +65,7 @@ <h1>Add an Alert</h1>
Fire when metric is
</label>

<div class="col-md-6">
<div id="alert-radio-container" class="col-md-4">
<label class="radio-inline">
<input type="radio" ng-model="quickTrigger.operator" class="radio" value="LT"> <
</label>
Expand All @@ -85,7 +85,7 @@ <h1>Add an Alert</h1>
Of threshold
</label>

<div class="col-md-6">
<div class="col-md-2">
<input type="number" id="threshold" ng-model="quickTrigger.threshold" class="form-control"
ng-minlength="1" required>
</div>
Expand All @@ -95,7 +95,7 @@ <h1>Add an Alert</h1>
Notify to:
</label>

<div class="col-md-6">
<div class="col-md-3">
<ui-select id="notifiers" multiple ng-model="quickTrigger.notifiers" theme="bootstrap"
ng-disabled="disabled" close-on-select="false">
<ui-select-match placeholder="Select notifier...">{{$item}}</ui-select-match>
Expand Down
4 changes: 4 additions & 0 deletions plugins/metrics/plugins/metrics/less/metrics-main.less
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,7 @@ h2 {
margin-top: @grid-gutter-width;
}


#alert-radio-container{
text-align: left;
}
12 changes: 4 additions & 8 deletions plugins/metrics/plugins/metrics/ts/metricsPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@

module HawkularMetrics {

export var _module = angular.module(HawkularMetrics.pluginName, ['ngResource','ui.select', 'hawkularCharts', 'hawkular.services']);
export var _module = angular.module(HawkularMetrics.pluginName, ['ngResource', 'ui.select', 'hawkularCharts', 'hawkular.services']);

var metricsTab:any;

_module.config(['$httpProvider','$locationProvider', '$routeProvider', 'HawtioNavBuilderProvider', ($httpProvider, $locationProvider, $routeProvider:ng.route.IRouteProvider, navBuilder:HawtioMainNav.BuilderFactory) => {

/// enable CORS
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
_module.config(['$httpProvider', '$locationProvider', '$routeProvider', 'HawtioNavBuilderProvider', ($httpProvider, $locationProvider, $routeProvider:ng.route.IRouteProvider, navBuilder:HawtioMainNav.BuilderFactory) => {

metricsTab = navBuilder.create()
.id(HawkularMetrics.pluginName)
Expand All @@ -51,8 +47,8 @@ module HawkularMetrics {
_module.directive('ngEnter', function () {
return function (scope, element, attrs) {
element.bind("keydown keypress", function (event) {
if(event.which === 13) {
scope.$apply(function (){
if (event.which === 13) {
scope.$apply(function () {
scope.$eval(attrs.ngEnter);
});

Expand Down
1 change: 1 addition & 0 deletions plugins/metrics/plugins/metrics/ts/metricsResponsePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ module HawkularMetrics {
toastr.error('Error reloading alerts' + errorReload);
}
});
toastr.success('Alert Created!');
this.toggleQuickAlert();
},
(errorCondition) => {
Expand Down

0 comments on commit c8c5a25

Please sign in to comment.