Skip to content

Commit

Permalink
HAWKULAR-5: Create a plugin to show a fixed chart.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtho11 committed Feb 3, 2015
1 parent 647cbd2 commit aa67d69
Show file tree
Hide file tree
Showing 14 changed files with 303 additions and 24 deletions.
113 changes: 108 additions & 5 deletions dist/hawkular-metrics.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
/// <reference path="../libs/hawtio-utilities/defs.d.ts"/>
/// Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.

/// <reference path="../../includes.ts"/>
/// Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
var HawkularMetrics;
(function (HawkularMetrics) {
HawkularMetrics.pluginName = "hawkular-metrics";
Expand All @@ -10,28 +38,103 @@ var HawkularMetrics;

/// <reference path="../../includes.ts"/>
/// <reference path="metricsGlobals.ts"/>
/// Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
var HawkularMetrics;
(function (HawkularMetrics) {
HawkularMetrics._module = angular.module(HawkularMetrics.pluginName, []);
var tab = undefined;
var metricsTab;
HawkularMetrics._module.config(['$locationProvider', '$routeProvider', 'HawtioNavBuilderProvider', function ($locationProvider, $routeProvider, navBuilder) {
tab = navBuilder.create().id(HawkularMetrics.pluginName).title(function () { return "Metrics"; }).href(function () { return "/metrics"; }).subPath("Graphs", "graphs", navBuilder.join(HawkularMetrics.templatePath, 'graphs.html')).build();
navBuilder.configureRouting($routeProvider, tab);
metricsTab = navBuilder.create().id(HawkularMetrics.pluginName).title(function () { return "Metrics"; }).href(function () { return "/metrics"; }).subPath("Config", "config", navBuilder.join(HawkularMetrics.templatePath, 'config.html')).subPath("Graphs", "graphs", navBuilder.join(HawkularMetrics.templatePath, 'graphs.html')).subPath("Advanced", "advanced", navBuilder.join(HawkularMetrics.templatePath, 'advanced.html')).build();
navBuilder.configureRouting($routeProvider, metricsTab);
$locationProvider.html5Mode(true);
}]);
HawkularMetrics._module.run(['HawtioNav', function (HawtioNav) {
HawtioNav.add(tab);
HawtioNav.add(metricsTab);
HawkularMetrics.log.debug("loaded");
console.warn("loaded");
}]);
hawtioPluginLoader.addModule(HawkularMetrics.pluginName);
})(HawkularMetrics || (HawkularMetrics = {}));

/// <reference path="metricsPlugin.ts"/>
/// Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
var HawkularMetrics;
(function (HawkularMetrics) {
HawkularMetrics.AdvancedController = HawkularMetrics._module.controller("HawkularMetrics.AdvancedController", ['$scope', function ($scope) {
$scope.advancedName = "Advanced Stuff";
}]);
})(HawkularMetrics || (HawkularMetrics = {}));

/// <reference path="metricsPlugin.ts"/>
/// Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
var HawkularMetrics;
(function (HawkularMetrics) {
HawkularMetrics.ConfigController = HawkularMetrics._module.controller("HawkularMetrics.ConfigController", ['$scope', function ($scope) {
$scope.configName = "My Configuration";
}]);
})(HawkularMetrics || (HawkularMetrics = {}));

/// <reference path="metricsPlugin.ts"/>
/// Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
var HawkularMetrics;
(function (HawkularMetrics) {
HawkularMetrics.MetricsController = HawkularMetrics._module.controller("HawkularMetrics.MetricsController", ['$scope', function ($scope) {
$scope.searchId = "";
}]);
})(HawkularMetrics || (HawkularMetrics = {}));

angular.module("hawkular-metrics-templates", []).run(["$templateCache", function($templateCache) {$templateCache.put("plugins/metrics/html/graphs.html","<div class=\"row\" ng-controller=\"HawkularMetrics.MetricsController\">\n <div class=\"col-md-12\">\n <h1>Hawkular Metrics Graphs</h1>\n </div>\n <div class=\"col-md-8\" ng-controller=\"HawkularMetrics.MetricsController\">\n <form class=\"form-horizontal\" name=\"chartForm\" role=\"form\" novalidate>\n\n <div class=\"form-group\">\n <label class=\"col-sm-2 control-label\">ID</label>\n\n <div class=\"col-sm-5\">\n <input type=\"text\" class=\"form-control\" name=\"searchId\" ng-model=\"searchId\"\n placeholder=\"Enter Id...\" required ng-minlength=\"1\">\n <span class=\"error-message\"\n ng-show=\"chartForm.searchId.$dirty && chartForm.searchId.$error.required\"> * Required.</span>\n <span class=\"help-block\">Example: 100, apache3.cpu1 </span>\n </div>\n </div>\n </form>\n </div>\n</div>\n");}]); hawtioPluginLoader.addModule("hawkular-metrics-templates");
angular.module("hawkular-metrics-templates", []).run(["$templateCache", function($templateCache) {$templateCache.put("plugins/metrics/html/advanced.html","<div class=\"row\" ng-controller=\"HawkularMetrics.AdvancedController\">\n <div class=\"col-md-12\">\n <h1>Advanced Settings: {{advancedName}}</h1>\n TBD\n </div>\n</div>\n");
$templateCache.put("plugins/metrics/html/config.html","<div class=\"row\" ng-controller=\"HawkularMetrics.ConfigController\">\n <div class=\"col-md-12\">\n <h1>Metrics Graph Config</h1>\n <h3>{{configName}}</h3>\n TBD\n </div>\n</div>\n");
$templateCache.put("plugins/metrics/html/graphs.html","<div class=\"row\" ng-controller=\"HawkularMetrics.MetricsController\">\n <div class=\"col-md-12\">\n <h1>Hawkular Metrics Graphs</h1>\n </div>\n <div class=\"col-md-8\" ng-controller=\"HawkularMetrics.MetricsController\">\n <form class=\"form-horizontal\" name=\"chartForm\" role=\"form\" novalidate>\n\n <div class=\"form-group\">\n <label class=\"col-sm-2 control-label\">ID</label>\n\n <div class=\"col-sm-5\">\n <input type=\"text\" class=\"form-control\" name=\"searchId\" ng-model=\"searchId\"\n placeholder=\"Enter Id...\" required ng-minlength=\"1\">\n <span class=\"error-message\"\n ng-show=\"chartForm.searchId.$dirty && chartForm.searchId.$error.required\"> * Required.</span>\n <span class=\"help-block\">Example: 100, apache3.cpu1 </span>\n </div>\n </div>\n </form>\n </div>\n</div>\n");}]); hawtioPluginLoader.addModule("hawkular-metrics-templates");
17 changes: 17 additions & 0 deletions plugins/alerts/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

var gulp = require('gulp'),
wiredep = require('wiredep').stream,
eventStream = require('event-stream'),
Expand Down
4 changes: 4 additions & 0 deletions plugins/metrics/d.ts/metrics/ts/advanced.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// <reference path="metricsPlugin.d.ts" />
declare module HawkularMetrics {
var AdvancedController: ng.IModule;
}
4 changes: 4 additions & 0 deletions plugins/metrics/d.ts/metrics/ts/config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// <reference path="metricsPlugin.d.ts" />
declare module HawkularMetrics {
var ConfigController: ng.IModule;
}
2 changes: 2 additions & 0 deletions plugins/metrics/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/metrics/ts/metricsGlobals.d.ts"/>
/// <reference path="d.ts/metrics/ts/metricsPlugin.d.ts"/>
/// <reference path="d.ts/metrics/ts/advanced.d.ts"/>
/// <reference path="d.ts/metrics/ts/config.d.ts"/>
/// <reference path="d.ts/metrics/ts/graphs.d.ts"/>
17 changes: 17 additions & 0 deletions plugins/metrics/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

var gulp = require('gulp'),
wiredep = require('wiredep').stream,
eventStream = require('event-stream'),
Expand Down
15 changes: 15 additions & 0 deletions plugins/metrics/plugins/includes.ts
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
/// <reference path="../libs/hawtio-utilities/defs.d.ts"/>

/// Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
6 changes: 6 additions & 0 deletions plugins/metrics/plugins/metrics/html/advanced.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="row" ng-controller="HawkularMetrics.AdvancedController">
<div class="col-md-12">
<h1>Advanced Settings: {{advancedName}}</h1>
TBD
</div>
</div>
7 changes: 7 additions & 0 deletions plugins/metrics/plugins/metrics/html/config.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="row" ng-controller="HawkularMetrics.ConfigController">
<div class="col-md-12">
<h1>Metrics Graph Config</h1>
<h3>{{configName}}</h3>
TBD
</div>
</div>
26 changes: 26 additions & 0 deletions plugins/metrics/plugins/metrics/ts/advanced.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/// <reference path="metricsPlugin.ts"/>

/// Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.

module HawkularMetrics {


export var AdvancedController = _module.controller("HawkularMetrics.AdvancedController", ['$scope', ($scope) => {
$scope.advancedName = "Advanced Stuff";

}]);

}
26 changes: 26 additions & 0 deletions plugins/metrics/plugins/metrics/ts/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/// <reference path="metricsPlugin.ts"/>

/// Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.

module HawkularMetrics {


export var ConfigController = _module.controller("HawkularMetrics.ConfigController", ['$scope', ($scope) => {
$scope.configName = "My Configuration";

}]);

}
18 changes: 16 additions & 2 deletions plugins/metrics/plugins/metrics/ts/graphs.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
/// <reference path="metricsPlugin.ts"/>
module HawkularMetrics {

/// Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.

module HawkularMetrics {

export var MetricsController = _module.controller("HawkularMetrics.MetricsController", ['$scope', ($scope) => {
$scope.searchId = "";


}]);

}
16 changes: 16 additions & 0 deletions plugins/metrics/plugins/metrics/ts/metricsGlobals.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
/// <reference path="../../includes.ts"/>

/// Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.

module HawkularMetrics {

export var pluginName = "hawkular-metrics";
Expand Down

0 comments on commit aa67d69

Please sign in to comment.