Skip to content

Commit

Permalink
ALERTS Plugin - status 0
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasponce committed Feb 25, 2015
1 parent 900bd9f commit 109dfb1
Show file tree
Hide file tree
Showing 28 changed files with 2,497 additions and 57 deletions.
7 changes: 6 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@
"hawtio-core-navigation": "2.0.17",
"hawtio-utilities": "2.0.16",
"hawkular-charts": "~0.1.13",
"hawkular-ui-services": "https://github.com/hawkular/hawkular-ui-services.git"
"hawkular-ui-services": "https://github.com/hawkular/hawkular-ui-services.git",
"d3": "3.4.8",
"event-drops": "0.1.1",
"angular-bootstrap": "0.11.0",
"angular-ui-select": "0.9.9"
},
"devDependencies": {
"bootstrap": "3.3.2",
"bootstrap-select": "1.6",
"patternfly": "1.1.3",
"hawtio-core-dts": "2.0.9"
}
Expand Down
658 changes: 648 additions & 10 deletions dist/hawkular-alerts.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion plugins/alerts/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@
"dependencies": {
"hawtio-core": "2.0.9",
"hawtio-core-navigation": "2.0.17",
"hawtio-utilities": "2.0.16"
"hawtio-utilities": "2.0.16",
"d3": "3.4.8",
"event-drops": "0.1.1",
"hawkular-ui-service": "https://github.com/hawkular/hawkular-ui-services.git#master",
"angular-bootstrap": "0.11.0",
"angular-ui-select": "0.9.9"
},
"devDependencies": {
"bootstrap": "3.3.2",
"bootstrap-select": "1.6",
"patternfly": "1.1.3",
"hawtio-core-dts": "2.0.9"
}
Expand Down
4 changes: 0 additions & 4 deletions plugins/alerts/d.ts/alerts/ts/alerts.d.ts

This file was deleted.

46 changes: 46 additions & 0 deletions plugins/alerts/d.ts/alerts/ts/dashboard.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/// <reference path="alertsPlugin.d.ts" />
declare module HawkularAlerts {
interface IDashboardController {
showRefreshForm(): void;
hideRefreshForm(): void;
updateRefresh(): void;
}
class DashboardController implements IDashboardController {
private $scope;
private $interval;
private $log;
private HawkularAlert;
static $inject: string[];
private stopInterval;
private g;
constructor($scope: any, $interval: ng.IIntervalService, $log: ng.ILogService, HawkularAlert: any);
showRefreshForm(): void;
hideRefreshForm(): void;
updateRefresh(): void;
closeAlertMsg(index: number): void;
private getAlerts();
private cancelRefresh();
private addAlertMsg(reason);
}
class Graph {
private static _instance;
private _initialized;
private _chartPlaceholder;
private _width;
private _margin;
private _startTime;
private _endTime;
private _color;
private _data;
private _seriesIndexes;
private _storage;
private _graph;
private _element;
private _scaleDomain;
constructor();
static getInstance(): Graph;
init(dashboardId: string, width: number, margin: any, startTime: number, endTime: number, hoverCallBack: Function): void;
addEvent(event: any): void;
getEvent(name: any, date: any): any;
}
}
50 changes: 50 additions & 0 deletions plugins/alerts/d.ts/alerts/ts/definitions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/// <reference path="alertsPlugin.d.ts" />
declare module HawkularAlerts {
interface IDefinitionsController {
allDefinitions(): void;
newDefinition(): void;
saveDefinition(): void;
viewDefinition(id: string): void;
deleteDefinition(id: string): void;
closeAlertMsg(index: number): void;
newCondition(): void;
changeConditionType(): void;
viewCondition(conditionId: string): void;
saveCondition(): void;
deleteCondition(conditionId: string, className: string): void;
cancelCondition(): void;
saveDampening(): void;
reloadDefinitions(): void;
}
class DefinitionsController implements IDefinitionsController {
private $scope;
private $window;
private $log;
private HawkularAlert;
static $inject: string[];
constructor($scope: any, $window: any, $log: ng.ILogService, HawkularAlert: any);
allDefinitions(): void;
newDefinition(): void;
saveDefinition(): void;
viewDefinition(id: string): void;
deleteDefinition(id: string): void;
closeAlertMsg(index: number): void;
private addAlertMsg(reason);
private allNotifiers();
private allConditions(triggerId);
private getDampening(triggerId);
saveDampening(): void;
private deleteDampening(triggerId);
viewDampening(triggerId: string): void;
private getDescription(className, condition);
private getOperator(opCode);
newCondition(): void;
changeConditionType(): void;
viewCondition(condition: any): void;
saveCondition(): void;
deleteCondition(conditionId: string, className: string): void;
cancelCondition(): void;
reloadDefinitions(): void;
private prepareCondition(className, condition);
}
}
26 changes: 26 additions & 0 deletions plugins/alerts/d.ts/alerts/ts/notifiers.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/// <reference path="alertsPlugin.d.ts" />
declare module HawkularAlerts {
interface INotifiersController {
allNotifiers(): void;
newNotifier(): void;
viewNotifier(notifierId: string): void;
saveNotifier(): void;
deleteNotifier(notifierId: string): void;
closeAlertMsg(index: number): void;
}
class NotifiersController implements INotifiersController {
private $scope;
private $interval;
private $log;
private HawkularAlert;
static $inject: string[];
constructor($scope: any, $interval: ng.IIntervalService, $log: ng.ILogService, HawkularAlert: any);
allNotifiers(): void;
newNotifier(): void;
viewNotifier(notifierId: string): void;
saveNotifier(): void;
deleteNotifier(notifierId: string): void;
private addAlertMsg(reason);
closeAlertMsg(index: number): void;
}
}
4 changes: 3 additions & 1 deletion plugins/alerts/defs.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/// <reference path="d.ts/includes.d.ts"/>
/// <reference path="d.ts/alerts/ts/alertsGlobals.d.ts"/>
/// <reference path="d.ts/alerts/ts/alertsPlugin.d.ts"/>
/// <reference path="d.ts/alerts/ts/alerts.d.ts"/>
/// <reference path="d.ts/alerts/ts/dashboard.d.ts"/>
/// <reference path="d.ts/alerts/ts/definitions.d.ts"/>
/// <reference path="d.ts/alerts/ts/notifiers.d.ts"/>
7 changes: 7 additions & 0 deletions plugins/alerts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<link rel="stylesheet" href="libs/patternfly/dist/css/patternfly.css" />

<!-- bower:css -->
<link rel="stylesheet" href="libs/angular-ui-select/dist/select.css" />
<!-- endbower -->

<!-- ES6/ES6 shim -->
Expand Down Expand Up @@ -41,10 +42,16 @@
<script src="libs/hawtio-utilities/dist/sugar.js"></script>
<script src="libs/hawtio-utilities/dist/angular-file-upload.js"></script>
<script src="libs/hawtio-utilities/dist/hawtio-utilities.js"></script>
<script src="libs/d3/d3.js"></script>
<script src="libs/angular-resource/angular-resource.js"></script>
<script src="libs/hawkular-ui-service/dist/hawkular-ui-service.js"></script>
<script src="libs/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="libs/angular-ui-select/dist/select.js"></script>
<!-- endbower -->

<script src="libs/bootstrap/dist/js/bootstrap.js"></script>
<script src="libs/patternfly/dist/js/patternfly.js"></script>
<script src="libs/event-drops/src/eventDrops.js"></script>

</head>

Expand Down
1 change: 1 addition & 0 deletions plugins/alerts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"devDependencies": {
"bower": "1.3.12",
"event-drops": "0.1.1",
"event-stream": "3.1.7",
"gulp": "3.8.11",
"gulp-angular-templatecache": "1.5.0",
Expand Down
9 changes: 0 additions & 9 deletions plugins/alerts/plugins/alerts/html/alerts.html

This file was deleted.

88 changes: 88 additions & 0 deletions plugins/alerts/plugins/alerts/html/dashboard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<style>
.zoom {
fill: transparent;
cursor: pointer;
}

.y-axis path,
.y-axis line,
.x-axis path,
.x-axis line {
stroke: black;
fill: none;
stroke-width: 1px;
}

.y-axis g line {
stroke: grey;
fill: none;
stroke-width: 1px;
}

.graph-body .line circle {
opacity: 0.2;
}

.start, .end {
font-weight: bold;
}

g.line text {
}
</style>
<div class="row">
<div class="col-md-12" ng-controller="HawkularAlerts.DashboardController as dsc">
<h1>Alerts Dashboard</h1>
<div id="alertsDashboard"></div>
<div class="col-md-8 col-md-offset-2" ng-show="legend != null">
<div class="dataTables_wrapper no-footer">
<div class="dataTables_header">
<div class="dataTables_info">Alert at <b>{{ legend.date | date:'d MMM, y hh:mm:ss a' }}</b></div>
</div>
<table class="datatable table table-striped table-bordered dataTable no-footer" role="grid">
<thead>
<tr role="row">
<th> EvalSet</th>
<th> Conditions</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="evalSet in legend.evalSets" ng-class-odd="'gradeA odd'" ng-class-even="'gradeA even'" >
<td></td>
<td>
<ul class="list-unstyled">
<li ng-repeat="condition in evalSet">
<b>{{ condition.log }}</b> at <i>{{ condition.evalTimestamp | date:'d MMM, y hh:mm:ss a'}}</i>
</li>
</ul>
{{ match.time | date:'d MMM, y hh:mm:ss a'}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-6">
<p>
<a href ng-click="dsc.showRefreshForm()"><span class="pficon pficon-refresh"></span> Refresh Config</a>
</p>
<form ng-if="showRefresh" class="form-horizontal" ng-submit="dsc.updateRefresh()">
<div class="form-group">
<label class="col-md-4 control-label" for="refreshInput">
Refresh (ms):
</label>
<div class="col-md-3">
<input type="number" id="refreshInput" ng-model="refresh.interval" class="form-control" ng-minlength="1" required>
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<button type="submit" class="btn btn-primary">Change</button>
<button type="button" class="btn btn-default" ng-click="dsc.hideRefreshForm()">Cancel</button>
</div>
</div>
</form>
<alert ng-repeat="alertMsg in msgs" type="{{alertMsg.type}}" close="dsc.closeAlertMsg($index)">{{alertMsg.msg}}</alert>
</div>
</div>
</div>
11 changes: 11 additions & 0 deletions plugins/alerts/plugins/alerts/html/definitions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div class="row">
<div class="col-md-12" ng-controller="HawkularAlerts.DefinitionsController as dc">

<div ng-if="status == 'all'" ng-include="'plugins/alerts/html/definitionsAll.html'"></div>

<div ng-if="status == 'new'" ng-include="'plugins/alerts/html/definitionsNew.html'"></div>

<div ng-if="status == 'edit'" ng-include="'plugins/alerts/html/definitionsEdit.html'"></div>

</div>
</div>
44 changes: 44 additions & 0 deletions plugins/alerts/plugins/alerts/html/definitionsAll.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<h1>Trigger Definitions</h1>
<div class="dataTables_wrapper no-footer">
<div class="dataTables_header">
<div class="text-right">
<button ng-click="dc.newDefinition()" type="button" class="btn btn-primary">New Trigger</button>
<button ng-click="dc.allDefinitions()" type="button" class="btn btn-info">Refresh</button>
<button ng-click="dc.reloadDefinitions()" type="button" class="btn btn-success">Reload</button>
</div>
</div>
<table class="datatable table table-striped table-bordered dataTable no-footer" role="grid">
<thead>
<tr role="row">
<th class="vert-align">Id</th>
<th class="vert-align">Enabled</th>
<th class="vert-align">Name</th>
<th class="vert-align">Description</th>
<th class="vert-align">Match</th>
<th class="vert-align">Notifiers</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="trigger in triggers | orderBy:['id', 'name']:false" ng-class-odd="'gradeA odd'" ng-class-even="'gradeA even'" >
<td class="vert-align">{{ trigger.id }}</td>
<td class="vert-align">{{ trigger.enabled }}</td>
<td class="vert-align">{{ trigger.name }}</td>
<td class="vert-align">{{ trigger.description }}</td>
<td class="vert-align">{{ trigger.match }}</td>
<td class="vert-align">
<ul class="list-unstyled">
<li ng-repeat="notifier in trigger.notifiers">{{ notifier }}</li>
</ul>
</td>
<td style="vertical-align: middle;">
<div class="text-right">
<a ng-click="dc.viewDefinition(trigger.id)" class="btn btn-primary">View</a>
<a class="btn btn-danger" ng-click="dc.deleteDefinition(trigger.id)">Delete</a>
</div>
</td>
</tr>
</tbody>
</table>
</div>

0 comments on commit 109dfb1

Please sign in to comment.