mirror of
https://github.com/pi-hole/web.git
synced 2025-12-23 04:08:39 +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() {
|
||||
|
||||
$('#btnAdd').on('click', addAdlist);
|
||||
@@ -61,8 +66,8 @@ $(document).ready(function() {
|
||||
$('.deleteAdlist').on('click', deleteAdlist);
|
||||
},
|
||||
"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;
|
||||
$('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() {
|
||||
|
||||
$('#btnAdd').on('click', addDomain);
|
||||
$( function() { $( document ).tooltip(); } );
|
||||
|
||||
get_groups();
|
||||
|
||||
@@ -62,7 +68,8 @@ $(document).ready(function() {
|
||||
$('.deleteDomain').on('click', deleteDomain);
|
||||
},
|
||||
"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">'+
|
||||
'<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">
|
||||
<script src="style/vendor/bootstrap/js/bootstrap-toggle.min.js"></script>
|
||||
<link rel="stylesheet" href="style/vendor/bootstrap/css/bootstrap-toggle.min.css">
|
||||
<script src="scripts/vendor/moment.min.js"></script>
|
||||
<?php } ?>
|
||||
|
||||
<script src="scripts/vendor/jquery.dataTables.min.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user