{% if filetype_loop == 0 %}Deployment ID,Total Active NAD,Name,Declared Type,Global Scope,Scope,Type Substituted,Name,Active NAD Count,Cisco Provided,Default Profile,RADIUS Supported,TACACS Supported,TrustSec Supported,Total NAD Count,Vendor
{%-    for item in deploymentInfoJSON.nodeList.nodeAndScope %}
{%-        for hit in item.content %}
{{ deploymentInfoJSON.deploymentID }},{{ deploymentInfoJSON.nadcountInfo.totalActiveNADCount }},{{ hit.name }},{{ hit.declaredType }},{{ hit.globalScope }},{{ hit.scope }},{{ hit.typeSubstituted }},{{ hit.value.name }},{{ hit.value.activeNADCount }},{{ hit.value.isCiscoProvided }},{{ hit.value.isDefProfile }},{{ hit.value.isRadiusSupported }},{{ hit.value.isTacacsSupported }},{{ hit.value.isTrustSecSupported }},{{ hit.value.totalNADCount }},{{ hit.value.vendorName }}
{%-        endfor %}
{%-    endfor %}
{% else %}{% if filetype_loop == 1 %}
# ISE Deployment NAD Info
| Deployment ID | Total Active NAD | Name | Declared Type | Global Scope | Scope | Type Substituted | Active NAD Count | Cisco Provided | Default Profile | RADIUS Supported | TACACS Supported | TrustSec Supported | Total NAD Count | Vendor |
| ------------- | ---------------- | ---- | ------------- | ------------ | ----- | ---------------- | ---------------- | -------------- | --------------- | ---------------- | ---------------- | ------------------ | --------------- | ------ |
{%-    for item in deploymentInfoJSON.nodeList.nodeAndScope %}
{%-        for hit in item.content %}
| {{ deploymentInfoJSON.deploymentID }} | {{ deploymentInfoJSON.nadcountInfo.totalActiveNADCount }} | {{ hit.name }} | {{ hit.declaredType }} | {{ hit.globalScope }} | {{ hit.scope }} | {{ hit.typeSubstituted }} | {{ hit.value.name }} | {{ hit.value.activeNADCount }} | {{ hit.value.isCiscoProvided }} | {{ hit.value.isDefProfile }} | {{ hit.value.isRadiusSupported }} | {{ hit.value.isTacacsSupported }} | {{ hit.value.isTrustSecSupported }} | {{ hit.value.totalNADCount }} | {{ hit.value.vendorName }} |
{%-        endfor %}
{%-    endfor %}
{% else %}{% if filetype_loop == 2 %}
<html>
<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://cdn.datatables.net/1.11.4/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/2.0.0/js/dataTables.buttons.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
    <script src="https://cdn.datatables.net/buttons/2.0.0/js/buttons.html5.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/2.0.0/js/buttons.print.min.js"></script>
    <script src="https://cdn.datatables.net/colreorder/1.5.4/js/dataTables.colReorder.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/2.0.0/js/buttons.colVis.min.js"></script>
    <script src="https://cdn.datatables.net/keytable/2.6.4/js/dataTables.keyTable.min.js"></script>
    <script src="https://cdn.datatables.net/select/1.3.3/js/dataTables.select.min.js"></script>
    <script src="https://cdn.datatables.net/fixedheader/3.1.9/js/dataTables.fixedHeader.min.js"></script>
    <link rel="stylesheet" href="https://cdn.datatables.net/fixedheader/3.1.9/css/fixedHeader.dataTables.min.css">
    <link rel="stylesheet" href="https://cdn.datatables.net/select/1.3.3/css/select.dataTables.min.css">
    <link rel="stylesheet" href="https://cdn.datatables.net/keytable/2.6.4/css/keyTable.dataTables.min.css">
    <link rel="stylesheet" href="https://cdn.datatables.net/1.11.4/css/jquery.dataTables.min.css">
</head>
<body>
<h1>ISE Deployment NAD Info</h1>
<table id = "ise">
  <tr>
    <td>Deployment ID</th>
    <th>Total Active NAD</th>
    <th>Name</th>
    <th>Declared Type</th>
    <th>Global Scope</th>
    <th>Scope</th>
    <th>Type Substituted</th>
    <th>Active NAD Count</th>
    <th>Cisco Provided</th>
    <th>Default Profile</th>
    <th>RADIUS Supported</th>
    <th>TACACS Supported</th>
    <th>TrustSec Supported</th>
    <th>Total NAD Count</th>
    <th>Vendor</th>
  </tr>
{%-    for item in deploymentInfoJSON.nodeList.nodeAndScope %}
{%-        for hit in item.content %}  
  <tr>
    <td>{{ deploymentInfoJSON.deploymentID }}</td>
    <td>{{ deploymentInfoJSON.nadcountInfo.totalActiveNADCount }}</td>
    <td>{{ hit.name }}</td>
    <td>{{ hit.declaredType }}</td>
    <td>{{ hit.globalScope }}</td>
    <td>{{ hit.scope }}</td>
    <td>{{ hit.typeSubstituted }}</td>
    <td>{{ hit.value.name }}</td>
    <td>{{ hit.value.activeNADCount }}</td>
    <td>{{ hit.value.isCiscoProvided }}</td>
    <td>{{ hit.value.isDefProfile }}</td>
    <td>{{ hit.value.isRadiusSupported }}</td>
    <td>{{ hit.value.isTacacsSupported }}</td>
    <td>{{ hit.value.isTrustSecSupported }}</td>
    <td>{{ hit.value.totalNADCount }}</td>
    <td>{{ hit.value.vendorName }}</td>
  </tr>
{%-        endfor %}
{%-    endfor %}  
</table>
<script type = "text/javascript">
  $(document).ready(function(){
    $('#ise thead tr')
    .clone(true)
    .addClass('filters')
    .appendTo('#ise thead');

    var table = $('#ise').DataTable({
        keys: true,
        dom: 'Bfrtip',
        lengthMenu: [
            [ 10, 25, 50, -1 ],
            [ '10 rows', '25 rows', '50 rows', 'Show all' ]
        ],
        buttons: [
        'pageLength','colvis','copy', 'csv', 'excel', 'pdf', 'print'
        ],
        colReorder: true,
        select: true,            
        orderCellsTop: true,
        fixedHeader: true,
        initComplete: function () {
        var api = this.api();

        // For each column
        api
            .columns()
            .eq(0)
            .each(function (colIdx) {
                // Set the header cell to contain the input element
                var cell = $('.filters th').eq(
                    $(api.column(colIdx).header()).index()
                );
                var title = $(cell).text();
                $(cell).html('<input type="text" placeholder="' + title + '" />');

                // On every keypress in this input
                $(
                    'input',
                    $('.filters th').eq($(api.column(colIdx).header()).index())
                )
                    .off('keyup change')
                    .on('keyup change', function (e) {
                        e.stopPropagation();

                        // Get the search value
                        $(this).attr('title', $(this).val());
                        var regexr = '({search})'; //$(this).parents('th').find('select').val();

                        var cursorPosition = this.selectionStart;
                        // Search the column for that value
                        api
                            .column(colIdx)
                            .search(
                                this.value != ''
                                    ? regexr.replace('{search}', '(((' + this.value + ')))')
                                    : '',
                                this.value != '',
                                this.value == ''
                            )
                            .draw();

                        $(this)
                            .focus()[0]
                            .setSelectionRange(cursorPosition, cursorPosition);
                    });
            });
    },
});
});        
</script>
</body></html>
{%- else %}
# ISE Deployment NAD Info
## {{ deploymentInfoJSON.deploymentID }}
### Total Active NAD Count: {{ deploymentInfoJSON.nadcountInfo.totalActiveNADCount }}
{%-    for item in deploymentInfoJSON.nodeList.nodeAndScope %}
{%-        for hit in item.content %}  
### Name: {{ hit.name }}
#### Declared Type:{{ hit.declaredType }}
#### Global Scope: {{ hit.globalScope }}
#### Scope: {{ hit.scope }}
#### Type Substituted: {{ hit.typeSubstituted }}
#### Value Name: {{ hit.value.name }}
##### Active NAD Count: {{ hit.value.activeNADCount }}
##### Cisco Provided: {{ hit.value.isCiscoProvided }}
##### Default Profile: {{ hit.value.isDefProfile }}
##### RADIUS Supported: {{ hit.value.isRadiusSupported }}
##### TACACS Supported: {{ hit.value.isTacacsSupported }}
##### TrustSec Supported: {{ hit.value.isTrustSecSupported }}
##### Total NAD: {{ hit.value.totalNADCount }}
##### Vendor: {{ hit.value.vendorName }}
{%-        endfor %}
{%-    endfor %}  

{%- endif %}{% endif %}{% endif %}