{"version":3,"sources":["scripts/app-3b21e18f03.js"],"names":["angular","module","frontendMonitor","restrict","templateUrl","controller","FrontendMonitorController","controllerAs","bindToController","scope","frontend","frontendId","directive","backendMonitor","BackendMonitorController","backend","backendId","config","$stateProvider","state","url","$inject","ProvidersController","$scope","$interval","$log","Providers","vm","this","providers","get","intervalId","error","$on","cancel","d3","HealthController","Health","updateTotalStatusCodeCount","totalStatusCodeCount","graph","data","values","code","hasOwnProperty","push","label","value","api","update","updateAverageResponseTimeGraph","x","y","averageResponseTime","length","shift","loadData","health","unixtime","average_response_time_sec","total_status_code_count","erroData","options","chart","type","height","margin","top","right","bottom","left","d","showValues","valueFormat","format","transitionDuration","yAxis","axisLabelDistance","title","enable","text","css","textAlign","key","useInteractiveGuideline","xAxis","tickFormat","time","Date","initialPoint","now","color","$urlRouterProvider","otherwise","$resource","factory","runBlock","debug","run","constant","moment","$logProvider","debugEnabled","$templateCache","put"],"mappings":"CAAA,WACE,YAEAA,SAAQC,OAAO,oDAIjB,WACE,YAME,SAASC,KACP,OACEC,SAAU,KACVC,YAAa,gEACbC,WAAYC,EACZC,aAAc,eACdC,kBAAkB,EAClBC,OACEC,SAAU,IACVC,WAAY,MAKlB,QAASL,MAlBXN,QACGC,OAAO,8CACPW,UAAU,kBAAmBV,MAsBlC,WACE,YAEAF,SACGC,OAAO,mDAIZ,WACE,YAME,SAASY,KACP,OACEV,SAAU,KACVC,YAAa,8DACbC,WAAYS,EACZP,aAAc,cACdC,kBAAkB,EAClBC,OACEM,QAAS,IACTC,UAAW,MAKjB,QAASF,MAlBXd,QACGC,OAAO,6CACPW,UAAU,iBAAkBC,MAsBjC,WACE,YAWE,SAASI,GAAOC,GAEdA,EAAeC,MAAM,YACnBC,IAAK,IACLhB,YAAa,wCACbC,WAAY,sBACZE,aAAc,kBAflBU,EAAOI,SAAW,kBAApBrB,QACGC,OAAO,6BACN,wBACA,4CACA,+CAEDgB,OAAOA,MAgBZ,WACE,YAOE,SAASK,GAAoBC,EAAQ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cesContent":["(function () {\n 'use strict';\n\n angular.module('traefik.section.providers.frontend-monitor', []);\n\n})();\n\n(function () {\n 'use strict';\n\n angular\n .module('traefik.section.providers.frontend-monitor')\n .directive('frontendMonitor', frontendMonitor);\n\n function frontendMonitor() {\n return {\n restrict: 'EA',\n templateUrl: 'app/sections/providers/frontend-monitor/frontend-monitor.html',\n controller: FrontendMonitorController,\n controllerAs: 'frontendCtrl',\n bindToController: true,\n scope: {\n frontend: '=',\n frontendId: '='\n }\n };\n }\n\n function FrontendMonitorController() {\n // Nothing\n }\n\n})();\n\n(function () {\n 'use strict';\n\n angular\n .module('traefik.section.providers.backend-monitor', []);\n\n})();\n\n(function () {\n 'use strict';\n\n angular\n .module('traefik.section.providers.backend-monitor')\n .directive('backendMonitor', backendMonitor);\n\n function backendMonitor() {\n return {\n restrict: 'EA',\n templateUrl: 'app/sections/providers/backend-monitor/backend-monitor.html',\n controller: BackendMonitorController,\n controllerAs: 'backendCtrl',\n bindToController: true,\n scope: {\n backend: '=',\n backendId: '='\n }\n };\n }\n\n function BackendMonitorController() {\n // Nothing\n }\n\n})();\n\n(function () {\n 'use strict';\n\n angular\n .module('traefik.section.providers', [\n 'traefik.core.provider',\n 'traefik.section.providers.backend-monitor',\n 'traefik.section.providers.frontend-monitor'\n ])\n .config(config);\n\n /** @ngInject */\n function config($stateProvider) {\n\n $stateProvider.state('provider', {\n url: '/',\n templateUrl: 'app/sections/providers/providers.html',\n controller: 'ProvidersController',\n controllerAs: 'providersCtrl'\n });\n\n }\n\n})();\n\n(function () {\n 'use strict';\n\n angular\n .module('traefik.section.providers')\n .controller('ProvidersController', ProvidersController);\n\n /** @ngInject */\n function ProvidersController($scope, $interval, $log, Providers) {\n var vm = this;\n\n vm.providers = Providers.get();\n\n var intervalId = $interval(function () {\n Providers.get(function (providers) {\n vm.providers = providers;\n }, function (error) {\n vm.providers = {};\n $log.error(error);\n });\n }, 2000);\n\n $scope.$on('$destroy', function () {\n $interval.cancel(intervalId);\n });\n }\n\n})();\n\n(function () {\n 'use strict';\n\n angular.module('traefik.section.health', ['traefik.core.health'])\n .config(config);\n\n /** @ngInject */\n function config($stateProvider) {\n\n $stateProvider.state('health', {\n url: '/health',\n templateUrl: 'app/sections/health/health.html',\n controller: 'HealthController',\n controllerAs: 'healthCtrl'\n });\n\n }\n\n})();\n\n/* global d3:false */\n(function (d3) {\n 'use strict';\n\n angular\n .module('traefik.section.health')\n .controller('HealthController', HealthController);\n\n /** @ngInject */\n function HealthController($scope, $interval, $log, Health) {\n\n var vm = this;\n\n vm.graph = {\n averageResponseTime: {},\n totalStatusCodeCount: {}\n };\n\n vm.graph.totalStatusCodeCount.options = {\n \"chart\": {\n type: 'discreteBarChart',\n height: 200,\n margin: {\n top: 20,\n right: 20,\n bottom: 40,\n left: 55\n },\n x: function (d) {\n return d.label;\n },\n y: function (d) {\n return d.value;\n },\n showValues: true,\n valueFormat: function (d) {\n return d3.format('d')(d);\n },\n transitionDuration: 50,\n yAxis: {\n axisLabelDistance: 30\n }\n },\n \"title\": {\n \"enable\": true,\n \"text\": \"Total Status Code Count\",\n \"css\": {\n \"textAlign\": \"center\"\n }\n }\n };\n\n vm.graph.totalStatusCodeCount.data = [\n {\n key: \"Total Status Code Count\",\n values: [\n {\n \"label\": \"200\",\n \"value\": 0\n }\n ]\n }\n ];\n\n /**\n * Update Total Status Code Count graph\n *\n * @param {Object} totalStatusCodeCount Object from API\n */\n function updateTotalStatusCodeCount(totalStatusCodeCount) {\n\n // extract values\n vm.graph.totalStatusCodeCount.data[0].values = [];\n for (var code in totalStatusCodeCount) {\n if (totalStatusCodeCount.hasOwnProperty(code)) {\n vm.graph.totalStatusCodeCount.data[0].values.push({\n label: code,\n value: totalStatusCodeCount[code]\n });\n }\n }\n\n // Update Total Status Code Count graph render\n if (vm.graph.totalStatusCodeCount.api) {\n vm.graph.totalStatusCodeCount.api.update();\n } else {\n $log.error('fail');\n }\n\n }\n\n vm.graph.averageResponseTime.options = {\n chart: {\n type: 'lineChart',\n height: 200,\n margin: {\n top: 20,\n right: 40,\n bottom: 40,\n left: 55\n },\n transitionDuration: 50,\n x: function (d) {\n return d.x;\n },\n y: function (d) {\n return d.y;\n },\n useInteractiveGuideline: true,\n xAxis: {\n tickFormat: function (d) {\n return d3.time.format('%X')(new Date(d));\n }\n },\n yAxis: {\n tickFormat: function (d) {\n return d3.format(',.1f')(d);\n }\n }\n },\n \"title\": {\n \"enable\": true,\n \"text\": \"Average response time\",\n \"css\": {\n \"textAlign\": \"center\"\n }\n }\n };\n\n var initialPoint = {\n x: Date.now() - 3000,\n y: 0\n };\n vm.graph.averageResponseTime.data = [\n {\n values: [initialPoint],\n key: 'Average response time (ms)',\n type: 'line',\n color: '#2ca02c'\n }\n ];\n\n /**\n * Update average response time graph\n *\n * @param {Number} x Coordinate X\n * @param {Number} y Coordinate Y\n */\n function updateAverageResponseTimeGraph(x, y) {\n\n // x multiply 1000 by because unix time is in seconds and JS Date are in milliseconds\n var data = {\n x: x * 1000,\n y: y * 1000\n };\n vm.graph.averageResponseTime.data[0].values.push(data);\n // limit graph entries\n if (vm.graph.averageResponseTime.data[0].values.length > 100) {\n vm.graph.averageResponseTime.data[0].values.shift();\n }\n\n // Update Average Response Time graph render\n if (vm.graph.averageResponseTime.api) {\n vm.graph.averageResponseTime.api.update();\n }\n }\n\n /**\n * Load all graph's datas\n *\n * @param {Object} health Health data from server\n */\n function loadData(health) {\n // Load datas and update Average Response Time graph render\n updateAverageResponseTimeGraph(health.unixtime, health.average_response_time_sec);\n\n // Load datas and update Total Status Code Count graph render\n updateTotalStatusCodeCount(health.total_status_code_count);\n\n // set data's view\n vm.health = health;\n }\n\n /**\n * Action when load datas failed\n *\n * @param {Object} error Error state object\n */\n function erroData(error) {\n vm.health = {};\n $log.error(error);\n }\n\n // first load\n Health.get(loadData, erroData);\n\n // Auto refresh data\n var intervalId = $interval(function () {\n Health.get(loadData, erroData);\n }, 3000);\n\n // Stop auto refresh when page change\n $scope.$on('$destroy', function () {\n $interval.cancel(intervalId);\n });\n\n }\n\n})(d3);\n\n(function () {\n 'use strict';\n\n angular\n .module('traefik.section', [\n 'ui.router',\n 'ui.bootstrap',\n 'nvd3',\n 'traefik.section.providers',\n 'traefik.section.health'\n ]);\n\n})();\n\n(function () {\n 'use strict';\n\n angular\n .module('traefik.section')\n .config(config);\n\n /** @ngInject */\n function config($urlRouterProvider) {\n $urlRouterProvider.otherwise('/');\n }\n\n})();\n\n(function () {\n 'use strict';\n\n angular\n .module('traefik.core.provider', ['ngResource'])\n .factory('Providers', Providers);\n\n /** @ngInject */\n function Providers($resource) {\n return $resource('/api/providers');\n }\n\n})();\n\n(function () {\n 'use strict';\n\n angular\n .module('traefik.core.health', ['ngResource'])\n .factory('Health', Health);\n\n /** @ngInject */\n function Health($resource) {\n return $resource('/health');\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('traefik', ['ngAnimate', 'ngCookies', 'ngSanitize', 'ngMessages', 'ngAria', 'ngResource', 'ui.router', 'ui.bootstrap', 'traefik.section']);\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('traefik')\n .run(runBlock);\n\n /** @ngInject */\n function runBlock($log) {\n\n $log.debug('runBlock end');\n }\n\n})();\n\n/* global moment:false */\n(function() {\n 'use strict';\n\n angular\n .module('traefik')\n .constant('moment', moment);\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('traefik')\n .config(config);\n\n /** @ngInject */\n function config($logProvider) {\n // Enable log\n $logProvider.debugEnabled(true);\n\n }\n\n})();\n\nangular.module(\"traefik\").run([\"$templateCache\", function($templateCache) {$templateCache.put(\"app/sections/health/health.html\",\"
Health
- Total response time :{{healthCtrl.health.total_response_time}}
- PID :{{healthCtrl.health.pid}}
- Uptime :{{healthCtrl.health.uptime}}
- Total count :{{healthCtrl.health.total_count}}
- Count :{{healthCtrl.health.count}}
\");\n$templateCache.put(\"app/sections/providers/providers.html\",\"\");\n$templateCache.put(\"app/sections/providers/backend-monitor/backend-monitor.html\",\" {{backendCtrl.backendId}}
\");\n$templateCache.put(\"app/sections/providers/frontend-monitor/frontend-monitor.html\",\" {{frontendCtrl.frontendId}}
Route | Rule | Value |
{{routeId}} | {{route.rule}} | {{route.value}} |
\");}]);"],"sourceRoot":"/source/"}