<commit_before>/*
 * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
 */

/*
 * vRouter Networks tab
 */
monitorInfraComputeNetworksClass = (function() {
    
    this.parseVNData = function(response){
        var data = jsonPath(response,'$..VnSandeshData')[0];
        var ret = [];
        if(data != null){
            if(!(data instanceof Array)){
                data = [data];
            }
            $.each(data, function (idx, obj) {
                var rawJson = obj, acl = noDataStr, vrf = noDataStr;
                if(!$.isEmptyObject(obj['acl_uuid'])){
                    acl = obj['acl_uuid'];
                }
                if(!$.isEmptyObject(obj['vrf_name'])){
                    vrf = obj['vrf_name'];
                }
                ret.push({
                    acl_uuid:acl,
                    vrf_name:vrf,
                    name:obj['name'],
                    raw_json:rawJson
                });
            });
            return ret;
        }
        else {
            return [];
        }
    }
    
    this.populateVNTab = function (obj) {
        layoutHandler.setURLHashParams({tab:'networks',node: obj['name']},{triggerHashChange:false});
        if (!isGridInitialized('#gridComputeVN')) {
            $("#gridComputeVN").contrailGrid({
                header : {
                    title : {
                        text : 'Networks'
                    }
                },
                columnHeader : {
                    columns:[
                             {
                                 field:"name",
                                 id:"name",
                                 name:"Name"
                             },
                             {
                                 field:"acl_uuid",
                                 id:"acl",
                                 name:"ACLs",
                                 cssClass: 'cell-hyperlink-blue',
                                 events: {
                                     onClick: function(e,dc){
                                         var tabIdx = $.inArray("acl", computeNodeTabs);
                                         selectTab(computeNodeTabStrip,tabIdx);
                                     }
                                  }
                             },
                             {
                                 field:"vrf_name",
                                 id:"vrf",
                                 name:"VRF",
                                 cssClass: 'cell-hyperlink-blue',
                                 events: {
                                     onClick: function(e,dc){
                                         var tabIdx = $.inArray("routes", computeNodeTabs);
                                         selectTab(computeNodeTabStrip,tabIdx);
                                     }
                                  }
                             }
                         ],
                },
                body : {
                    options : {
                        //checkboxSelectable: true,
                        forceFitColumns: true,
                        detail:{
                            template: $("#gridsTemplateJSONDetails").html()
                        },
                        actionCell: [
                             {
                                 title: 'Configure',
                                 iconClass: 'icon-cog',
                                 onClick: function(rowIndex){
                                     var rowData = vnGrid._dataView.getItem(rowIndex);
                                     //window.location.href = "/tenants/monitor/network\\#p=config_net_vn&q=";
                                     layoutHandler.setURLHashParams({},{p:'config_net_vn',merge:false});
                                 }
                             },
                             {
                                 title: 'Monitor',
                                 iconClass: 'icon-tasks',
                                 onClick: function(rowIndex){
                                     var rowData = vnGrid._dataView.getItem(rowIndex);
                                     //window.location.href = "/tenants/monitor/network\\#p=mon_net_networks&q[fqName]=" + rowData['name'];
                                     layoutHandler.setURLHashParams({fqnName:rowData['name']},{p:'mon_net_networks',merge:false});
                                 }
                             },
                             {
                                 title: 'View Object Logs',
                                 iconClass: 'icon-list-alt',
                                 onClick: function(rowIndex){
                                     var rowData = vnGrid._dataView.getItem(rowIndex);
                                     showObjLog(rowData['name'],'vn');
                                 }<commit_msg>Fix for Bug https://bugs.launchpad.net/juniperopenstack/+bug/1324002 Fixed the type in fqName.<commit_after>/*
 * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
 */

/*
 * vRouter Networks tab
 */
monitorInfraComputeNetworksClass = (function() {
    
    this.parseVNData = function(response){
        var data = jsonPath(response,'$..VnSandeshData')[0];
        var ret = [];
        if(data != null){
            if(!(data instanceof Array)){
                data = [data];
            }
            $.each(data, function (idx, obj) {
                var rawJson = obj, acl = noDataStr, vrf = noDataStr;
                if(!$.isEmptyObject(obj['acl_uuid'])){
                    acl = obj['acl_uuid'];
                }
                if(!$.isEmptyObject(obj['vrf_name'])){
                    vrf = obj['vrf_name'];
                }
                ret.push({
                    acl_uuid:acl,
                    vrf_name:vrf,
                    name:obj['name'],
                    raw_json:rawJson
                });
            });
            return ret;
        }
        else {
            return [];
        }
    }
    
    this.populateVNTab = function (obj) {
        layoutHandler.setURLHashParams({tab:'networks',node: obj['name']},{triggerHashChange:false});
        if (!isGridInitialized('#gridComputeVN')) {
            $("#gridComputeVN").contrailGrid({
                header : {
                    title : {
                        text : 'Networks'
                    }
                },
                columnHeader : {
                    columns:[
                             {
                                 field:"name",
                                 id:"name",
                                 name:"Name"
                             },
                             {
                                 field:"acl_uuid",
                                 id:"acl",
                                 name:"ACLs",
                                 cssClass: 'cell-hyperlink-blue',
                                 events: {
                                     onClick: function(e,dc){
                                         var tabIdx = $.inArray("acl", computeNodeTabs);
                                         selectTab(computeNodeTabStrip,tabIdx);
                                     }
                                  }
                             },
                             {
                                 field:"vrf_name",
                                 id:"vrf",
                                 name:"VRF",
                                 cssClass: 'cell-hyperlink-blue',
                                 events: {
                                     onClick: function(e,dc){
                                         var tabIdx = $.inArray("routes", computeNodeTabs);
                                         selectTab(computeNodeTabStrip,tabIdx);
                                     }
                                  }
                             }
                         ],
                },
                body : {
                    options : {
                        //checkboxSelectable: true,
                        forceFitColumns: true,
                        detail:{
                            template: $("#gridsTemplateJSONDetails").html()
                        },
                        actionCell: [
                             {
                                 title: 'Configure',
                                 iconClass: 'icon-cog',
                                 onClick: function(rowIndex){
                                     var rowData = vnGrid._dataView.getItem(rowIndex);
                                     layoutHandler.setURLHashParams({},{p:'config_net_vn',merge:false});
                                 }
                             },
                             {
                                 title: 'Monitor',
                                 iconClass: 'icon-tasks',
                                 onClick: function(rowIndex){
                                     var rowData = vnGrid._dataView.getItem(rowIndex);
                                     layoutHandler.setURLHashParams({fqName:rowData['name']},{p:'mon_net_networks',merge:false});
                                 }
                             },
                             {
                                 title: 'View Object Logs',
                                 iconClass: 'icon-list-alt',
                                 onClick: function(rowIndex){
                                     var rowData = vnGrid._dataView.getItem(rowIndex);
                                     showObjLog(rowData['name'],'vn');
                                 }
{'fraction_non_alphanumeric': 0.0951448304298526, 'fraction_numerical': 0.0017523966601381302, 'mean_word_length': 0.7114129476098078, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 89, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5397077', 'n_tokens_mistral': 2093, 'n_tokens_neox': 1996, 'n_words': 293}