<commit_before>﻿<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>SDNCore - Devices</title>

    <!-- Bootstrap Core CSS -->
    <link href="../bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="../bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">

    <!-- DataTables CSS -->
    <link href="../bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet">

    <!-- DataTables Responsive CSS -->
    <link href="../bower_components/datatables-responsive/css/dataTables.responsive.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="../dist/css/sb-admin-2.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="../bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>

    <div id="wrapper">

        <!-- Navigation -->
        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="index.html">SDNCore - Network Management System</a>
            </div>
            <!-- /.navbar-header -->
            <!-- /.navbar-top-links -->
            <div class="navbar-default sidebar" role="navigation">
                <div class="sidebar-nav navbar-collapse">
                    <ul class="nav" id="side-menu">
                        <li>
                            <a href="index.html"><i class="fa fa-home fa-fw"></i> Controller (Home) </a>
                        </li>
                        <li>
                            <a href="switches.html"><i class="fa fa-exchange"></i> Switches</a>
                        </li>
                        <li>
                            <a href="hosts.html"><i class="fa fa-desktop fa-fw"></i> Hosts</a>
                        </li>

                        <li>
                            <a href="topology.html"><i class="fa fa-sitemap fa-fw"></i> Topology</a>
                        </li>
                        <li>
                            <a href="firewall.html"><i class="fa fa-warning fa-fw"></i>  Firewall</a>
                        </li>
                        <li>
                            <a href="acl.html"><i class="fa fa-warning fa-fw"></i> Access Control Lists</a>
                        </li>

                        <li>
                            <a href="statistics.html"><i class="fa fa-bar-chart-o fa-fw"></i> Statistics</a>
                        </li><li>
    <a href="login.html"><i class="fa fa-sign-out"></i> Logout</a>
</li>
                    </ul>
                </div>
                <!-- /.sidebar-collapse -->
            </div>
            <!-- /.navbar-static-side -->
        </nav>

        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h3 class="page-header">Hosts</h3>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                         Hosts Connected
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="tableHosts">
                                    <thead>
                                        <tr>
                                            <th>MAC </th>
                                            <th>IPv4 Address</th>
                                            <th>IPv6 Address</th>
                                            <th>Switch</th>
                                            <th>Port</th>
                                            <th>Last Seen</th>
                                        </tr>
                                    </thead>
                                    <tbody></tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->


                    
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="../bower_components/jquery/dist/jquery.min.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script src="../bower_components/metisMenu/dist/metisMenu.min.js"></script>

    <!-- DataTables JavaScript -->
    <script src="../bower_components/datatables/media/js/jquery.dataTables.min.js"></script>
    <script src="../bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js"></script>

    <!-- Custom Theme JavaScript -->
    <script src="../dist/js/sb-admin-2.js"></script>
    <script src="../js/jquery.cookie.js"></script>
    <!-- Page-Level Demo Scripts - Tables - Use for reference -->
    <script src="../js/querystringparser.js"></script>

    <script>
        var ipaddress = $.cookie('cip'); if (ipaddress == null || ipaddress == "") window.location.href = "login.html";
        var restport = $.cookie('cport'); if (restport == null || restport == "") window.location.href = "login.html";

        var url = "http://" +ipaddress+ ":" +restport+ "/wm/device/";

      


        $(document).ready(function () {

            $('#tableHosts').DataTable({
                responsive: true,
                ajax:
               {
                   url: url,
                   dataSrc: ''
               },
               columns: [
                   { data: 'mac' },
                   { data: 'ipv4' },
               { data: 'ipv6' },
               { data: 'attachmentPoint[0].switchDPID' },
               { data: 'attachmentPoint[0].port' },
               { data: 'lastSeen' }


               ]
            });

        });
       

    </script>

</body>

</html>
<commit_msg>Working on displaying data more intuitively. NOT STABLE<commit_after>﻿<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>SDNCore - Devices</title>

    <!-- Bootstrap Core CSS -->
    <link href="../bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="../bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">

    <!-- DataTables CSS -->
    <link href="../bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css"
          rel="stylesheet">

    <!-- DataTables Responsive CSS -->
    <link href="../bower_components/datatables-responsive/css/dataTables.responsive.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="../dist/css/sb-admin-2.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="../bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>

<div id="wrapper">

    <!-- Navigation -->
    <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="index.html">SDNCore - Network Management System</a>
        </div>
        <!-- /.navbar-header -->
        <!-- /.navbar-top-links -->
        <div class="navbar-default sidebar" role="navigation">
            <div class="sidebar-nav navbar-collapse">
                <ul class="nav" id="side-menu">
                    <li>
                        <a href="index.html"><i class="fa fa-home fa-fw"></i> Controller (Home) </a>
                    </li>
                    <li>
                        <a href="switches.html"><i class="fa fa-exchange"></i> Switches</a>
                    </li>
                    <li>
                        <a href="hosts.html"><i class="fa fa-desktop fa-fw"></i> Hosts</a>
                    </li>

                    <li>
                        <a href="topology.html"><i class="fa fa-sitemap fa-fw"></i> Topology</a>
                    </li>
                    <li>
                        <a href="firewall.html"><i class="fa fa-warning fa-fw"></i> Firewall</a>
                    </li>
                    <li>
                        <a href="acl.html"><i class="fa fa-warning fa-fw"></i> Access Control Lists</a>
                    </li>

                    <li>
                        <a href="statistics.html"><i class="fa fa-bar-chart-o fa-fw"></i> Statistics</a>
                    </li>
                    <li>
                        <a href="login.html"><i class="fa fa-sign-out"></i> Logout</a>
                    </li>
                </ul>
            </div>
            <!-- /.sidebar-collapse -->
        </div>
        <!-- /.navbar-static-side -->
    </nav>

    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h3 class="page-header">Hosts</h3>
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        Hosts Connected
                    </div>
                    <!-- /.panel-heading -->
                    <div class="panel-body">
                        <div class="dataTable_wrapper">
                            <table class="table table-striped table-bordered table-hover" id="tableHosts">
                                <thead>
                                <tr>
                                    <th>MAC</th>
                                    <th>IPv4 Address</th>
                                    <th>IPv6 Address</th>
                                    <th>Switch</th>
                                    <th>Port</th>
                                    <th>Last Seen</th>
                                </tr>
                                </thead>
                                <tbody></tbody>
                            </table>
                        </div>
                        <!-- /.table-responsive -->
                    </div>
                    <!-- /.panel-body -->
                </div>
                <!-- /.panel -->


            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->
    </div>
    <!-- /#page-wrapper -->

</div>
<!-- /#wrapper -->

<!-- jQuery -->
<script src="../bower_components/jquery/dist/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

<!-- Metis Menu Plugin JavaScript -->
<script src="../bower_components/metisMenu/dist/metisMenu.min.js"></script>

<!-- DataTables JavaScript -->
<script src="../bower_components/datatables/media/js/jquery.dataTables.min.js"></script>
<script src="../bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js"></script>

<!-- Custom Theme JavaScript -->
<script src="../dist/js/sb-admin-2.js"></script>
<script src="../js/jquery.cookie.js"></script>
<!-- Page-Level Demo Scripts - Tables - Use for reference -->
<script src="../js/querystringparser.js"></script>

<script>
    var ipaddress = $.cookie('cip');
    if (ipaddress == null || ipaddress == "") window.location.href = "login.html";
    var restport = $.cookie('cport');
    if (restport == null || restport == "") window.location.href = "login.html";

    var url = "http://" + ipaddress + ":" + restport + "/wm/device/";


    $(document).ready(function () {

        $.ajax({
            url: url, // your url where the php is
            dataType: 'json',
     
            success: function(data_response){

            }
        });

        $('#tableHosts').DataTable({
            responsive: true,
            ajax: {
                url: url,
                dataSrc: ''
            },
            "createdRow": function (data) {
                data.lastSeen = Date(data.lastSeen);
                console.log(data);
            },

            columns: [
                {data: 'mac'},
                {data: 'ipv4'},
                {data: 'ipv6'},
                {data: 'attachmentPoint[0].switchDPID'},
                {data: 'attachmentPoint[0].port'},
                {data: 'lastSeen'}
            ]
        });

    });


</script>

</body>

</html>

{'fraction_non_alphanumeric': 0.17307692307692307, 'fraction_numerical': 0.004723346828609987, 'mean_word_length': 1.3118078302916862, 'pattern_counts': {'":': 3, '<': 373, '<?xml version=': 0, '>': 373, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 23, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5348261', 'n_tokens_mistral': 4224, 'n_tokens_neox': 3943, 'n_words': 738}