getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.4.2',
'unifunc' => 'content_6763070bd6f6f3_73946052',
'has_nocache_code' => false,
'file_dependency' =>
array (
'affb24851ed623b62affa076808377b28b01c478' =>
array (
0 => 'index.tpl',
1 => 1734543111,
2 => 'file',
),
),
'includes' =>
array (
),
))) {
function content_6763070bd6f6f3_73946052 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = '/home/l/public_html/xbotcontrol/smarty/template';
?>
XBotControl
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous">
>
src="https://code.jquery.com/jquery-3.7.1.min.js">
>
src="https://cdn.jsdelivr.net/npm/bootstrap-table@1.23.5/dist/bootstrap-table.min.js">
>
src="https://cdn.jsdelivr.net/npm/bootstrap-table@1.23.5/dist/locale/bootstrap-table-zh-CN.min.js">
>
src="https://cdn.jsdelivr.net/npm/bootstrap-table@1.23.5/dist/extensions/filter-control/bootstrap-table-filter-control.js">
>
>
document.getElementById('date-from').addEventListener('change', refreshTable);
document.getElementById('limit').addEventListener('change', refreshTable);
function refreshTable() {
$('#table').bootstrapTable('refresh');
}
window.onload = function() {
const dateFrom = document.getElementById('date-from');
const dateTo = document.getElementById('date-to');
const today = new Date();
const yesterday = new Date(today);
yesterday.setDate(today.getDate() - 1);
const tomorrow = new Date(today);
tomorrow.setDate(today.getDate() + 1);
dateFrom.value = yesterday.toISOString().slice(0, 16);
dateTo.value = tomorrow.toISOString().slice(0, 16);
};
document.getElementById('date-to').addEventListener('change', refreshTable);
function initializeTable(latest_requests) {
var url = location.pathname + '/api/report/' + latest_requests;
var $table = $('#table');
if ($table.length) {
$table.bootstrapTable('destroy');
}
$.get(url, function(response) {
$table.bootstrapTable({
url: url,
sortable: true,
toolbar: '#toolbar',
showRefresh: true,
iconsPrefix: 'fa',
showColumns: true,
classes: ['table', 'table-borderless', 'table-hover', 'table-striped'],
filterControl: true,
searchable: true,
pagination: false,
sidePagination: "server",
serverSort: false,
columns: response.columns,
queryParams: queryParams,
loadingFontSize: '12px'
});
});
}
function queryParams(params) {
const limit = document.getElementById('limit').value;
const from = document.getElementById('date-from').value;
const to = document.getElementById('date-to').value;
params.limit = limit;
params.from = from;
params.to = to;
return params;
}
function buttons() {
return {
btnAdd: {
text: 'Add new list',
icon: 'fa-plus',
event: function() {
// Prompt the user for a new list name
const newListName = prompt('Enter new list name:');
// Only proceed if the user provides a valid list name
if (newListName) {
// Define the URL where the form needs to be posted
const url = '
/lists/create'; // Replace with actual URL
// Create a new hidden form element
const form = document.createElement('form');
form.method = 'POST';
form.action = url;
// Create hidden input to store the list name
const input = document.createElement('input');
input.type = 'hidden';
input.name = 'listName'; // The name expected by the server
input.value = newListName;
// Append the input to the form
form.appendChild(input);
// Append the form to the body to make it part of the DOM
document.body.appendChild(form);
// Submit the form automatically
form.submit();
} else {
// Handle case where user cancels or enters an empty name
alert('List creation was cancelled or name was empty.');
}
},
attributes: {
title: 'Add a new list to the table'
}
}
}
return {
}
}
function listFormatter(value, row, index) {
var editBtn = ' ';
var showBtn = '';
return [showBtn, editBtn, value, ].join('')
return [showBtn, value, ].join('')
}
>
>
function ipFormatter(value) {
return `${value}`;
}
document.addEventListener('mouseover', async (event) => {
const target = event.target;
if (target.classList.contains('ip-address')) {
const ipAddress = target.getAttribute('data-ip');
const popupId = `popup-${ipAddress.replace(/\./g, '-')}`;
let popup = document.getElementById(popupId);
if (!popup) {
popup = document.createElement('div');
popup.id = popupId;
popup.style.position = 'absolute';
popup.style.background = '#f9f9f9';
popup.style.border = '1px solid #ccc';
popup.style.padding = '10px';
popup.style.borderRadius = '5px';
popup.style.boxShadow = '0 0 10px rgba(0, 0, 0, 0.2)';
popup.style.zIndex = '1000';
popup.style.whiteSpace = 'nowrap';
popup.style.display = 'none';
document.body.appendChild(popup);
fetch(location.pathname + `/api/ipinfo/${ipAddress}`)
.then((response) => response.json())
.then((data) => {
const location = data.geo.continent?.names?.en + ' > ' + data.geo.country
?.names?.en + ' > ' + data.geo.city?.names?.en || 'Unknown';
const reverseDns = data.reverse_dns || 'N/A';
popup.innerHTML = `
Location: ${location}
Reverse DNS: ${reverseDns}
`;
})
.catch(() => {
popup.innerHTML = 'Error fetching data.';
});
}
popup.style.display = 'block';
popup.style.left = `${event.pageX + 10}px`;
popup.style.top = `${event.pageY + 10}px`;
}
});
document.addEventListener('mouseout', (event) => {
const target = event.target;
if (target.classList.contains('ip-address')) {
const ipAddress = target.getAttribute('data-ip');
const popupId = `popup-${ipAddress.replace(/\./g, '-')}`;
const popup = document.getElementById(popupId);
if (popup) {
popup.style.display = 'none';
}
}
});
>