Vincent Fournier 844d9e0e6e Clean config.js and remove container
Change-Id: Ieeb6980232c02ec72a6a0caa707dddbacb008a6f
2015-08-26 16:45:55 -04:00

30 lines
1.4 KiB
JavaScript

'use strict';
angular.module('bansho.tile')
.directive('banshoTileServiceMetrics', function () {
return {
restrict: 'E',
templateUrl: 'components/custom_directive/tile/service_metrics/service_metrics.html',
controller: ['$scope', 'templateManager', 'surveilStatus', 'iframeUrl',
function ($scope, templateManager, surveilStatus, iframeUrl) {
var hostname = templateManager.getPageParam('host_name'),
serviceDescription = templateManager.getPageParam('service_description');
$scope.metrics = [];
surveilStatus.getServiceMetricNames(hostname, serviceDescription).then(function (metricNames) {
angular.forEach(metricNames, function (metricName) {
$scope.metrics.push({
title: metricName,
iframeUrl: iframeUrl.getIFrameUrl("metric_" + metricName, hostname, serviceDescription)
});
surveilStatus.getServiceMetric(hostname, serviceDescription, metricName).then(function (data) {
// TODO: waiting for ORBER BY DESC support in InfluxDB
});
});
});
}]
};
});