rev1
This commit is contained in:
4 files changed
+187
-127
No files matched your search
+176
-123
@@ -4,98 +4,118 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Log Parser & Viewer</title>
|
||||
<title>Compact Log Parser</title>
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/dataTables.bootstrap5.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
<style>
|
||||
body {
|
||||
background-color: #f8f9fa;
|
||||
padding: 20px;
|
||||
background-color: #f4f7f6;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
#drop-zone {
|
||||
border: 2px dashed #007bff;
|
||||
border-radius: 10px;
|
||||
padding: 40px;
|
||||
border: 2px dashed #0d6efd;
|
||||
background: #fff;
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
background: white;
|
||||
transition: 0.3s;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
margin-bottom: 20px;
|
||||
transition: 0.2s;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
#drop-zone.dragover {
|
||||
background: #e7f1ff;
|
||||
border-color: #0056b3;
|
||||
}
|
||||
|
||||
.stack-trace {
|
||||
font-family: monospace;
|
||||
font-size: 0.85rem;
|
||||
color: #d63384;
|
||||
white-space: pre-wrap;
|
||||
display: block;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.lvl-ERR {
|
||||
color: #dc3545;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.lvl-INF {
|
||||
color: #0d6efd;
|
||||
}
|
||||
|
||||
.lvl-DBG {
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
.lvl-TRC {
|
||||
color: #6610f2;
|
||||
#drop-zone:hover {
|
||||
background: #f0f7ff;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
background: white;
|
||||
padding: 20px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
|
||||
background: #fff;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
/* Level Colors */
|
||||
.badge-ERR {
|
||||
background-color: #dc3545;
|
||||
}
|
||||
|
||||
.badge-INF {
|
||||
background-color: #0dcaf0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.badge-DBG {
|
||||
background-color: #6c757d;
|
||||
}
|
||||
|
||||
.badge-TRC {
|
||||
background-color: #6610f2;
|
||||
}
|
||||
|
||||
/* Row styling */
|
||||
td.details-control {
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
color: #0d6efd;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.exception-box {
|
||||
background: #fff5f5;
|
||||
border-left: 4px solid #dc3545;
|
||||
padding: 10px;
|
||||
font-family: monospace;
|
||||
font-size: 0.8rem;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.clickable-text {
|
||||
color: #0d6efd;
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.props-cell {
|
||||
max-width: 200px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 0.75rem;
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container-fluid">
|
||||
<h2 class="mb-4">Log File Parser</h2>
|
||||
|
||||
<div id="drop-zone">
|
||||
<h4>Drag & Drop log file here</h4>
|
||||
<p class="text-muted">or click to select a file</p>
|
||||
<input type="file" id="file-input" style="display: none;" accept=".log,.txt">
|
||||
<div class="container-fluid py-3">
|
||||
<div id="drop-zone" onclick="document.getElementById('file-input').click()">
|
||||
<strong><i class="bi bi-cloud-arrow-up"></i> Drop Log File Here</strong> or Click to Browse
|
||||
<input type="file" id="file-input" hidden accept=".log,.txt">
|
||||
</div>
|
||||
|
||||
<div class="table-container shadow-sm">
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Filter by Level</label>
|
||||
<select id="level-filter" class="form-select">
|
||||
<div class="table-container">
|
||||
<div class="d-flex gap-3 mb-3">
|
||||
<div style="width: 200px;">
|
||||
<select id="level-filter" class="form-select form-select-sm">
|
||||
<option value="">All Levels</option>
|
||||
<option value="INF">INF (Info)</option>
|
||||
<option value="ERR">ERR (Error)</option>
|
||||
<option value="DBG">DBG (Debug)</option>
|
||||
<option value="TRC">TRC (Trace)</option>
|
||||
<option value="INF">INF</option>
|
||||
<option value="ERR">ERR</option>
|
||||
<option value="DBG">DBG</option>
|
||||
<option value="TRC">TRC</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="log-table" class="table table-hover table-bordered w-100">
|
||||
<thead class="table-light">
|
||||
<table id="log-table" class="table table-sm table-hover w-100" style="border-top: 1px solid #dee2e6;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Time</th>
|
||||
<th>Level</th>
|
||||
<th>ID</th>
|
||||
<th>Tag</th>
|
||||
<th width="30"></th>
|
||||
<th width="100">Time</th>
|
||||
<th width="70">Level</th>
|
||||
<th width="50">Tag</th>
|
||||
<th>Message</th>
|
||||
<th>Properties</th>
|
||||
</tr>
|
||||
@@ -105,76 +125,113 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="logModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Full Log Detail</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="modal-content-text"
|
||||
style="white-space: pre-wrap; font-family: monospace; background: #f8f9fa; padding: 15px; border-radius: 5px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="js/jquery-3.7.0.min.js"></script>
|
||||
<script src="js/jquery.dataTables.min.js"></script>
|
||||
<script src="js/dataTables.bootstrap5.min.js"></script>
|
||||
<script src="js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
const MAX_MSG_LEN = 80;
|
||||
|
||||
// DataTable Formatting Function for Child Row (Exceptions)
|
||||
function format(d) {
|
||||
if (!d.exception) return null;
|
||||
return `<div class="exception-box"><strong>Stack Trace:</strong><br>${d.exception}</div>`;
|
||||
}
|
||||
|
||||
let table = $('#log-table').DataTable({
|
||||
order: [[0, 'asc']],
|
||||
pageLength: 25,
|
||||
dom: '<"d-flex justify-content-between"lf>rtip',
|
||||
columns: [
|
||||
{ data: 'time', width: '10%' },
|
||||
{
|
||||
className: 'details-control',
|
||||
orderable: false,
|
||||
data: null,
|
||||
defaultContent: '',
|
||||
render: function (data, type, row) {
|
||||
return row.exception ? '<i class="bi bi-plus-square"></i>' : '';
|
||||
}
|
||||
},
|
||||
{ data: 'time' },
|
||||
{
|
||||
data: 'level',
|
||||
width: '5%',
|
||||
render: function (data) {
|
||||
return `<span class="lvl-${data}">${data}</span>`;
|
||||
}
|
||||
render: l => `<span class="badge badge-${l}">${l}</span>`
|
||||
},
|
||||
{ data: 'id', width: '5%' },
|
||||
{ data: 'tag', width: '8%' },
|
||||
{ data: 'tag' },
|
||||
{
|
||||
data: 'message',
|
||||
render: function (data) {
|
||||
// Split message and stack trace if exists
|
||||
const parts = data.split('\n');
|
||||
const mainMsg = parts.shift();
|
||||
const stack = parts.join('\n');
|
||||
return `<strong>${mainMsg}</strong>` + (stack ? `<span class="stack-trace">${stack}</span>` : '');
|
||||
render: function (data, type, row) {
|
||||
if (data.length > MAX_MSG_LEN) {
|
||||
return `${data.substr(0, MAX_MSG_LEN)}... <span class="clickable-text show-full" data-full="${btoa(unescape(encodeURIComponent(data)))}">[more]</span>`;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{ data: 'props', width: '20%' }
|
||||
]
|
||||
{
|
||||
data: 'props',
|
||||
className: 'props-cell',
|
||||
render: p => p ? `<span title="${p}">${p}</span>` : ''
|
||||
}
|
||||
],
|
||||
order: [[1, 'asc']],
|
||||
dom: 'ltipr'
|
||||
});
|
||||
|
||||
// Custom filtering for Log Level
|
||||
// Handle Click to Expand (Exception)
|
||||
$('#log-table tbody').on('click', 'td.details-control', function () {
|
||||
let tr = $(this).closest('tr');
|
||||
let row = table.row(tr);
|
||||
|
||||
if (row.child.isShown()) {
|
||||
row.child.hide();
|
||||
$(this).html('<i class="bi bi-plus-square"></i>');
|
||||
} else if (row.data().exception) {
|
||||
row.child(format(row.data())).show();
|
||||
$(this).html('<i class="bi bi-dash-square text-danger"></i>');
|
||||
}
|
||||
});
|
||||
|
||||
// Handle Click for Full Modal
|
||||
$('#log-table tbody').on('click', '.show-full', function () {
|
||||
const fullText = decodeURIComponent(escape(atob($(this).data('full'))));
|
||||
$('#modal-content-text').text(fullText);
|
||||
new bootstrap.Modal('#logModal').show();
|
||||
});
|
||||
|
||||
// Filtering logic
|
||||
$('#level-filter').on('change', function () {
|
||||
table.column(1).search(this.value).draw();
|
||||
table.column(2).search(this.value).draw();
|
||||
});
|
||||
|
||||
// File Handling
|
||||
const dropZone = $('#drop-zone');
|
||||
const fileInput = $('#file-input');
|
||||
|
||||
dropZone.on('click', () => fileInput.click());
|
||||
|
||||
dropZone.on('dragover', (e) => {
|
||||
// Drag & Drop / File Input
|
||||
$('#file-input').on('change', e => handleFile(e.target.files[0]));
|
||||
$('#drop-zone').on('dragover', e => { e.preventDefault(); $(this).addClass('bg-light'); });
|
||||
$('#drop-zone').on('drop', e => {
|
||||
e.preventDefault();
|
||||
dropZone.addClass('dragover');
|
||||
});
|
||||
|
||||
dropZone.on('dragleave', () => dropZone.removeClass('dragover'));
|
||||
|
||||
dropZone.on('drop', (e) => {
|
||||
e.preventDefault();
|
||||
dropZone.removeClass('dragover');
|
||||
const file = e.originalEvent.dataTransfer.files[0];
|
||||
if (file) handleFile(file);
|
||||
});
|
||||
|
||||
fileInput.on('change', (e) => {
|
||||
if (e.target.files[0]) handleFile(e.target.files[0]);
|
||||
handleFile(e.originalEvent.dataTransfer.files[0]);
|
||||
});
|
||||
|
||||
function handleFile(file) {
|
||||
if (!file) return;
|
||||
const reader = new FileReader();
|
||||
reader.onload = function (e) {
|
||||
const content = e.target.result;
|
||||
const parsedData = parseLogs(content);
|
||||
table.clear().rows.add(parsedData).draw();
|
||||
reader.onload = e => {
|
||||
const logs = parseLogs(e.target.result);
|
||||
table.clear().rows.add(logs).draw();
|
||||
};
|
||||
reader.readAsText(file);
|
||||
}
|
||||
@@ -182,37 +239,33 @@
|
||||
function parseLogs(text) {
|
||||
const lines = text.split(/\r?\n/);
|
||||
const logs = [];
|
||||
// Regex to match: Time [LVL] ID | (TAG) Message (PROPS)
|
||||
const logHeaderRegex = /^(\d{2}:\d{2}:\d{2}\.\d{3})\s\[(\w+)\]\s(\d+)\s\|\s\((.*?)\)\s(.*)$/;
|
||||
const headerRegex = /^(\d{2}:\d{2}:\d{2}\.\d{3})\s\[(\w+)\]\s(\d+)\s\|\s\((.*?)\)\s(.*)$/;
|
||||
|
||||
lines.forEach(line => {
|
||||
if (!line.trim()) return;
|
||||
|
||||
const match = line.match(logHeaderRegex);
|
||||
const match = line.match(headerRegex);
|
||||
|
||||
if (match) {
|
||||
let messagePart = match[5];
|
||||
let msg = match[5];
|
||||
let props = "";
|
||||
|
||||
// Extract props inside parentheses at the end of the line
|
||||
const propMatch = messagePart.match(/\(([^)]+:[^)]+)\)$/);
|
||||
const propMatch = msg.match(/\((idtask:.*)\)$/);
|
||||
if (propMatch) {
|
||||
props = propMatch[1];
|
||||
messagePart = messagePart.replace(propMatch[0], "").trim();
|
||||
msg = msg.replace(propMatch[0], "").trim();
|
||||
}
|
||||
|
||||
logs.push({
|
||||
time: match[1],
|
||||
level: match[2],
|
||||
id: match[3],
|
||||
tag: match[4],
|
||||
message: messagePart,
|
||||
props: props
|
||||
message: msg,
|
||||
props: props,
|
||||
exception: ""
|
||||
});
|
||||
} else {
|
||||
// If it doesn't match the header, it's likely a stack trace or multi-line message
|
||||
// It's a stack trace / exception line
|
||||
if (logs.length > 0) {
|
||||
logs[logs.length - 1].message += "\n" + line.trim();
|
||||
logs[logs.length - 1].exception += line + "\n";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* Bootstrap v5.3.0 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e()}(this,(function(){"use strict";const t=new Map,e={set(e,i,n){t.has(e)||t.set(e,new Map);const s=t.get(e);s.has(i)||0===s.size?s.set(i,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(e,i)=>t.has(e)&&t.get(e).get(i)||null,remove(e,i){if(!t.has(e))return;const n=t.get(e);n.delete(i),0===n.size&&t.delete(e)}},i="transitionend",n=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),s=t=>{t.dispatchEvent(new Event(i))},o=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),r=t=>o(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(n(t)):null,a=t=>{if(!o(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},l=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),c=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?c(t.parentNode):null},h=()=>{},d=t=>{t.offsetHeight},u=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,f=[],p=()=>"rtl"===document.documentElement.dir,m=t=>{var e;e=()=>{const e=u();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(f.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of f)t()})),f.push(e)):e()},g=(t,e=[],i=t)=>"function"==typeof t?t(...e):i,_=(t,e,n=!0)=>{if(!n)return void g(t);const o=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let r=!1;const a=({target:n})=>{n===e&&(r=!0,e.removeEventListener(i,a),g(t))};e.addEventListener(i,a),setTimeout((()=>{r||s(e)}),o)},b=(t,e,i,n)=>{const s=t.length;let o=t.indexOf(e);return-1===o?!i&&n?t[s-1]:t[0]:(o+=i?1:-1,n&&(o=(o+s)%s),t[Math.max(0,Math.min(o,s-1))])},v=/[^.]*(?=\..*)\.|.*/,y=/\..*/,w=/::\d+$/,A={};let E=1;const T={mouseenter:"mouseover",mouseleave:"mouseout"},C=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function O(t,e){return e&&`${e}::${E++}`||t.uidEvent||E++}function x(t){const e=O(t);return t.uidEvent=e,A[e]=A[e]||{},A[e]}function k(t,e,i=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===i))}function L(t,e,i){const n="string"==typeof e,s=n?i:e||i;let o=N(t);return C.has(o)||(o=t),[n,s,o]}function S(t,e,i,n,s){if("string"!=typeof e||!t)return;let[o,r,a]=L(e,i,n);if(e in T){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};r=t(r)}const l=x(t),c=l[a]||(l[a]={}),h=k(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=O(r,e.replace(v,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return M(s,{delegateTarget:r}),n.oneOff&&P.off(t,s.type,e,i),i.apply(r,[s])}}(t,i,r):function(t,e){return function i(n){return M(n,{delegateTarget:t}),i.oneOff&&P.off(t,n.type,e),e.apply(t,[n])}}(t,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function D(t,e,i,n,s){const o=k(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function I(t,e,i,n){const s=e[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&D(t,e,i,r.callable,r.delegationSelector)}function N(t){return t=t.replace(y,""),T[t]||t}const P={on(t,e,i,n){S(t,e,i,n,!1)},one(t,e,i,n){S(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=L(e,i,n),a=r!==e,l=x(t),c=l[r]||{},h=e.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))I(t,l,i,e.slLine truncated
|
||||
//# sourceMappingURL=bootstrap.bundle.min.js.map
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
/*! DataTables Bootstrap 5 integration
|
||||
* 2020 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
!function(t){var n,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(n=require("jquery"),r=function(e,a){a.fn.dataTable||require("datatables.net")(e,a)},"undefined"==typeof window?module.exports=function(e,a){return e=e||window,a=a||n(e),r(e,a),t(a,0,e.document)}:(r(window,n),module.exports=t(n,window,window.document))):t(jQuery,window,document)}(function(x,e,r,o){"use strict";var i=x.fn.dataTable;return x.extend(!0,i.defaults,{dom:"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>><'row dt-row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",renderer:"bootstrap"}),x.extend(i.ext.classes,{sWrapper:"dataTables_wrapper dt-bootstrap5",sFilterInput:"form-control form-control-sm",sLengthSelect:"form-select form-select-sm",sProcessing:"dataTables_processing card",sPageButton:"paginate_button page-item"}),i.ext.renderer.pageButton.bootstrap=function(d,e,s,a,l,c){function u(e,a){for(var t,n,r=function(e){e.preventDefault(),x(e.currentTarget).hasClass("disabled")||b.page()==e.data.action||b.page(e.data.action).draw("page")},o=0,i=a.length;o<i;o++)if(t=a[o],Array.isArray(t))u(e,t);else{switch(f=p="",t){case"ellipsis":p="…",f="disabled";break;case"first":p=g.sFirst,f=t+(0<l?"":" disabled");break;case"previous":p=g.sPrevious,f=t+(0<l?"":" disabled");break;case"next":p=g.sNext,f=t+(l<c-1?"":" disabled");break;case"last":p=g.sLast,f=t+(l<c-1?"":" disabled");break;default:p=t+1,f=l===t?"active":""}p&&(n=-1!==f.indexOf("disabled"),n=x("<li>",{class:m.sPageButton+" "+f,id:0===s&&"string"==typeof t?d.sTableId+"_"+t:null}).append(x("<a>",{href:n?null:"#","aria-controls":d.sTableId,"aria-disabled":n?"true":null,"aria-label":w[t],role:"link","aria-current":"active"===f?"page":null,"data-dt-idx":t,tabindex:n?-1:d.iTabIndex,class:"page-link"}).html(p)).appendTo(e),d.oApi._fnBindAction(n,{action:t},r))}}var p,f,t,b=new i.Api(d),m=d.oClasses,g=d.oLanguage.oPaginate,w=d.oLanguage.oAria.paginate||{},e=x(e);try{t=e.find(r.activeElement).data("dt-idx")}catch(e){}var n=e.children("ul.pagination");n.length?n.empty():n=e.html("<ul/>").children("ul").addClass("pagination"),u(n,a),t!==o&&e.find("[data-dt-idx="+t+"]").trigger("focus")},i});
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
/*! DataTables 2.0.8
|
||||
* © SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
!function(n){"use strict";var a;"function"==typeof define&&define.amd?define(["jquery"],function(t){return n(t,window,document)}):"object"==typeof exports?(a=require("jquery"),"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||a(t),n(e,t,t.document)}:module.exports=n(a,window,window.document)):window.DataTable=n(jQuery,window,document)}(function(V,q,_){"use strict";function g(t){var e=parseInt(t,10);return!isNaN(e)&&isFinite(t)?e:null}function o(t,e,n){var a=typeof t,r="string"==a;return"number"==a||"bigint"==a||!!y(t)||(e&&r&&(t=R(t,e)),n&&r&&(t=t.replace(P,"")),!isNaN(parseFloat(t))&&isFinite(t))}function l(t,e,n){var a;return!!y(t)||("string"!=typeof t||!t.match(/<(input|select)/i))&&(y(a=t)||"string"==typeof a)&&!!o(I(t),e,n)||null}function v(t,e,n,a){var r=[],o=0,i=e.length;if(void 0!==a)for(;o<i;o++)t[e[o]][n]&&r.push(t[e[o]][n][a]);else for(;o<i;o++)t[e[o]]&&r.push(t[e[o]][n]);return r}function h(t,e){var n,a=[];void 0===e?(e=0,n=t):(n=e,e=t);for(var r=e;r<n;r++)a.push(r);return a}function b(t){for(var e=[],n=0,a=t.length;n<a;n++)t[n]&&e.push(t[n]);return e}var C,U,e,t,$=function(t,H){var W,X,B;return $.factory(t,H)?$:this instanceof $?V(t).DataTable(H):(X=void 0===(H=t),B=(W=this).length,X&&(H={}),this.api=function(){return new U(this)},this.each(function(){var n=1<B?Zt({},H,!0):H,a=0,t=this.getAttribute("id"),r=!1,e=$.defaults,o=V(this);if("table"!=this.nodeName.toLowerCase())Z(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{V(this).trigger("options.dt",n),nt(e),at(e.column),z(e,e,!0),z(e.column,e.column,!0),z(e,V.extend(n,o.data()),!0);for(var i=$.settings,a=0,l=i.length;a<l;a++){var s=i[a];if(s.nTable==this||s.nTHead&&s.nTHead.parentNode==this||s.nTFoot&&s.nTFoot.parentNode==this){var E=(void 0!==n.bRetrieve?n:e).bRetrieve,k=(void 0!==n.bDestroy?n:e).bDestroy;if(X||E)return s.oInstance;if(k){new $.Api(s).destroy();break}return void Z(s,0,"Cannot reinitialise DataTable",3)}if(s.sTableId==this.id){i.splice(a,1);break}}null!==t&&""!==t||(t="DataTables_Table_"+$.ext._unique++,this.id=t);var u=V.extend(!0,{},$.models.oSettings,{sDestroyWidth:o[0].style.width,sInstance:t,sTableId:t,colgroup:V("<colgroup>").prependTo(this),fastData:function(t,e,n){return G(u,t,e,n)}}),t=(u.nTable=this,u.oInit=n,i.push(u),u.api=new U(u),u.oInstance=1===W.length?W:o.dataTable(),nt(n),n.aLengthMenu&&!n.iDisplayLength&&(n.iDisplayLength=Array.isArray(n.aLengthMenu[0])?n.aLengthMenu[0][0]:V.isPlainObject(n.aLengthMenu[0])?n.aLengthMenu[0].value:n.aLengthMenu[0]),n=Zt(V.extend(!0,{},e),n),Q(u.oFeatures,n,["bPaginate","bLengthChange","bFilter","bSort","bSortMulti","bInfo","bProcessing","bAutoWidth","bSortClasses","bServerSide","bDeferRender"]),Q(u,n,["ajax","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","iStateDuration","bSortCellsTop","iTabIndex","sDom","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId","caption","layout",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]),Q(u.oScroll,n,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]),Q(u.oLanguage,n,"fnInfoCallback"),K(u,"aoDrawCallback",n.fnDrawCallback),K(u,"aoStateSaveParams",n.fnStateSaveParams),K(u,"aoStateLoadParams",n.fnStateLoadParams),K(u,"aoStateLoaded",n.fnStateLoaded),K(u,"aoRowCallback",n.fnRowCallback),K(u,"aoRowCreatedCallback",n.fnCreatedRow),K(u,"aoHeaderCallback",n.fnHeaderCallback),K(u,"aoFooterCallback",n.fnFooterCallback),K(u,"aoInitComplete",n.fnInitComplete),K(u,"aoPreDrawCallback",n.fnPreDrawCallback),u.rowIdFn=J(n.rowId),u),c=($.__browser||(P={},$.__browser=P,j=V("<div/>").css({position:"fixed",top:0,left:-1*q.pageXOffset,height:1,width:1,overflow:"hidden"}).append(V("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(V("<div/>").css({width:"100%",height:10}))).appendTo("body"),p=j.children(),O=p.children(),P.barWidth=p[0].offsetWidth-p[0].clientWidth,P.bScrollbarLeft=1!==Math.round(O.offset().left),j.remove()),V.extend(t.oBrowser,$.__browser),t.oScroll.iBarWidth=$.__browser.barWidth,u.oClasses),d=(V.extend(c,$.ext.classes,n.oClasses),o.addClass(c.table),u.oFeatures.bPaginate||(n.iDisplayStart=0),void 0===u.iInitDisplayStart&&(u.iInitDisplayStart=n.iDisplayStart,u._iDisplayStart=n.iDisplayStart),u.oLanguage),f=(V.extend(!0,d,n.oLanguage),d.sUrl?(V.ajax({dataType:"json",url:d.sUrl,success:function(t){z(e.oLanguage,t),V.extend(!0,d,t,u.oInit.oLanguage),tt(u,null,"i18n",[u],!0),Et(u)},error:function(){Z(u,0,"i18n file loading error",21),Et(u)}}),r=!0):tt(u,null,"i18n",[u]),[]),h=this.getElementsByTagName("thead"),p=It(u,h[0]);if(n.aoColumns)f=n.aoColumns;else if(p.length)for(l=p[a=0].length;a<l;a++)f.push(null);for(a=0,l=f.length;a<l;a++)rt(u);var g,m,v,b,y,D,x,S=u,T=n.aoColumnDefs,w=f,M=p,_=function(t,e){ot(u,t,e)},C=S.aoColumns;if(w)for(g=0,m=w.length;g<m;g++)w[gLine truncated
|
||||
Reference in new issue
Block a user