lsp
by Kabeer Rifaye
JavaScript
ngElastic.controller('lspMeshDetailsCntController', function($scope, $http, $timeout, $routeParams, $window) {
// Title
$scope.allroutes = "All Routers";
$scope.stateview = "State View";
$scope.reset = "Active Routers";
$scope.statusViewDD = [{
"value": "pri_cnt",
"text": "Primary"
}, {
"value": "sec_cnt",
"text": "Secondary"
}, {
"value": "ter_cnt",
"text": "Tertiary"
}];
$scope.statusSourceDD = [{
"value": "region_r1",
"text": "AMR"
}, {
"value": "region_r2",
"text": "EMEIA"
}, {
"value": "region_r3",
"text": "APAC"
}];
$scope.destStatus = [{
"value": "amr",
"text": "AMR"
}, {
"value": "emeia",
"text": "EMEIA"
}, {
"value": "apac",
"text": "APAC"
}];
$scope.loadAll;
$scope.cnt = $routeParams.cnt;
$scope.flag = $routeParams.svflag == undefined ? false : $routeParams.svflag;
// Load initially when the table page called.
$scope.initTable = function() {
if ($scope.flag == "true") {
// $http.get('/proxy/lsp_grid_complete/heading/_search?size=10000&pretty&query:matchAll').success(function(d) {
$http.get('/api/lspmeshcompleteheading').success(function(d) {
$scope.header(d);
});
if ($scope.cnt == 'pri_cnt' || $scope.cnt == 'sec_cnt' || $scope.cnt == 'ter_cnt') {
var key;
if ($scope.cnt == 'pri_cnt')
key = "";
else if ($scope.cnt == 'sec_cnt')
key = "Secondary";
else if ($scope.cnt == 'ter_cnt')
key = "Teritary";
else
key = ""
$scope.label = "LSP Mesh Detail - All Routers - " + key;
// $http.get('/proxy/lsp_grid_complete/stats/_search?size=10000&pretty&query:matchAll&sort=sort_rtr:asc&_source=pri_cnt').success(function(d) {
$http.get('/api/lspmeshcomplete/source/' + $scope.cnt).success(function(d) {
$scope.loadOneItemPerSec(d);
});
} else if ($scope.cnt == 'amr' || $scope.cnt == 'emeia' ||...