mirror of
https://github.com/pi-hole/web.git
synced 2025-12-23 12:18:26 +00:00
Add tooltips for creation and modification times for domains and adlists.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -35,6 +35,11 @@ $.fn.redraw = function(){
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function datetime(date)
|
||||||
|
{
|
||||||
|
return moment.unix(Math.floor(date)).format("Y-MM-DD HH:mm:ss z");
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('#btnAdd').on('click', addAdlist);
|
$('#btnAdd').on('click', addAdlist);
|
||||||
@@ -61,8 +66,8 @@ $(document).ready(function() {
|
|||||||
$('.deleteAdlist').on('click', deleteAdlist);
|
$('.deleteAdlist').on('click', deleteAdlist);
|
||||||
},
|
},
|
||||||
"rowCallback": function( row, data ) {
|
"rowCallback": function( row, data ) {
|
||||||
$('td:eq(0)', row).html( '<code>'+data["address"]+'</code>' );
|
const tooltip = 'Added: '+datetime(data["date_added"])+'\nLast modified: '+datetime(data["date_modified"]);
|
||||||
|
$('td:eq(0)', row).html( '<code title="'+tooltip+'">'+data["address"]+'</code>' );
|
||||||
|
|
||||||
const disabled = data["enabled"] === 0;
|
const disabled = data["enabled"] === 0;
|
||||||
$('td:eq(1)', row).html( '<input type="checkbox" id="status"'+(disabled?'':' checked')+'>');
|
$('td:eq(1)', row).html( '<input type="checkbox" id="status"'+(disabled?'':' checked')+'>');
|
||||||
|
|||||||
@@ -35,9 +35,15 @@ $.fn.redraw = function(){
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function datetime(date)
|
||||||
|
{
|
||||||
|
return moment.unix(Math.floor(date)).format("Y-MM-DD HH:mm:ss z");
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('#btnAdd').on('click', addDomain);
|
$('#btnAdd').on('click', addDomain);
|
||||||
|
$( function() { $( document ).tooltip(); } );
|
||||||
|
|
||||||
get_groups();
|
get_groups();
|
||||||
|
|
||||||
@@ -62,7 +68,8 @@ $(document).ready(function() {
|
|||||||
$('.deleteDomain').on('click', deleteDomain);
|
$('.deleteDomain').on('click', deleteDomain);
|
||||||
},
|
},
|
||||||
"rowCallback": function( row, data ) {
|
"rowCallback": function( row, data ) {
|
||||||
$('td:eq(0)', row).html( '<code>'+data["domain"]+'</code>' );
|
const tooltip = 'Added: '+datetime(data["date_added"])+'\nLast modified: '+datetime(data["date_modified"]);
|
||||||
|
$('td:eq(0)', row).html( '<code title="'+tooltip+'">'+data["domain"]+'</code>' );
|
||||||
|
|
||||||
$('td:eq(1)', row).html( '<select id="type" class="form-control">'+
|
$('td:eq(1)', row).html( '<select id="type" class="form-control">'+
|
||||||
'<option value="0"'+(data["type"]===0?' selected':'')+'>Exact whitelist</option>'+
|
'<option value="0"'+(data["type"]===0?' selected':'')+'>Exact whitelist</option>'+
|
||||||
|
|||||||
@@ -224,6 +224,7 @@
|
|||||||
<link rel="stylesheet" href="style/vendor/bootstrap/css/bootstrap-multiselect.css">
|
<link rel="stylesheet" href="style/vendor/bootstrap/css/bootstrap-multiselect.css">
|
||||||
<script src="style/vendor/bootstrap/js/bootstrap-toggle.min.js"></script>
|
<script src="style/vendor/bootstrap/js/bootstrap-toggle.min.js"></script>
|
||||||
<link rel="stylesheet" href="style/vendor/bootstrap/css/bootstrap-toggle.min.css">
|
<link rel="stylesheet" href="style/vendor/bootstrap/css/bootstrap-toggle.min.css">
|
||||||
|
<script src="scripts/vendor/moment.min.js"></script>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<script src="scripts/vendor/jquery.dataTables.min.js"></script>
|
<script src="scripts/vendor/jquery.dataTables.min.js"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user