-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from lucasponce/ALERTS-REBASED
ALERTS Plugin - status 0
- Loading branch information
Showing
28 changed files
with
2,497 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
Oops, something went wrong.