extends ../layout

append head
  link(rel='stylesheet', href='/css/datatables.min.css')
  script(src='/js/datatables.min.js')
  script(src='/js/dataTables.bootstrap4.min.js')

block content
  main(role='main')
    .container-fluid
      .row
        .col-12
          h3 Es werden die letzten 5.000 Einträge der Log-Datei angezeigt
        .col-12        
          table#table_log.table-striped.table-bordered.table-hover.display.table-sm.table-responsive.w-100.table-dark
            thead
              tr
                th ID
                th Zeitstempel
                th Typ
                th Protokolltext

  script.
    var datasets = !{JSON.stringify(dataSet).replace(/<\//g, '<\\/')}
    $(document).ready(function() {
      $('#table_log').DataTable( {
        "data": datasets,
        "language": { 
          "url": "/js/datatables_german.json" 
        },
        "order": [
          [ 0, "desc" ]
        ],
        "iDisplayLength": 25,
        "columns": [
          { "data": "id" },
          { "data": "log_time" },
          { "data": "log_typ" },
          { "data": "log_text" }
        ]
      });
    });
