mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 18:59:48 +01:00
Update index.php
Changed Chart Icon and List Icon to ones that are similar in react web interface. Signed-off-by: Pazekal90 <mail@pascal-pischel.de>
This commit is contained in:
@@ -1,51 +1,59 @@
|
||||
<?php
|
||||
/* Pi-hole: A black hole for Internet advertisements
|
||||
* (c) 2017 Pi-hole, LLC (https://pi-hole.net)
|
||||
* Network-wide ad blocking via your own hardware.
|
||||
*
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
function gravity_last_update($raw = false){
|
||||
/*
|
||||
@walter-exit <walter@exclusive-it.nl> | April 23rd, 2018:
|
||||
Checks when the gravity list was last updated, if it exists at all.
|
||||
Returns the info in human-readable format for use on the dashboard,
|
||||
or raw for use by the API.
|
||||
*/
|
||||
$gravitylist = "/etc/pihole/gravity.list";
|
||||
if (file_exists($gravitylist)){
|
||||
$date_file_created_unix = filemtime($gravitylist);
|
||||
$date_file_created = date_create("@".$date_file_created_unix);
|
||||
$date_now = date_create("now");
|
||||
$gravitydiff = date_diff($date_file_created,$date_now);
|
||||
if($raw){
|
||||
$output = array(
|
||||
"file_exists"=> true,
|
||||
"absolute" => $date_file_created_unix,
|
||||
"relative" => array(
|
||||
"days" => $gravitydiff->format("%a"),
|
||||
"hours" => $gravitydiff->format("%H"),
|
||||
"minutes" => $gravitydiff->format("%I"),
|
||||
)
|
||||
);
|
||||
}else{
|
||||
if($gravitydiff->d > 1){
|
||||
$output = $gravitydiff->format("Blocking list updated %a days, %H:%I ago");
|
||||
}elseif($gravitydiff->d == 1){
|
||||
$output = $gravitydiff->format("Blocking list updated one day, %H:%I ago");
|
||||
}else{
|
||||
$output = $gravitydiff->format("Blocking list updated %H:%I ago");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if($raw){
|
||||
$output = array("file_exists"=>false);
|
||||
}else{
|
||||
$output = "Blocking list not found";
|
||||
}
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
/* Pi-hole: A black hole for Internet advertisements
|
||||
* (c) 2017 Pi-hole, LLC (https://pi-hole.net)
|
||||
* Network-wide ad blocking via your own hardware.
|
||||
*
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
require "scripts/pi-hole/php/database.php";
|
||||
|
||||
function gravity_last_update($raw = false)
|
||||
{
|
||||
$db = SQLite3_connect(getGravityDBFilename());
|
||||
$date_file_created_unix = $db->querySingle("SELECT value FROM info WHERE property = 'updated';");
|
||||
if($date_file_created_unix === false)
|
||||
{
|
||||
if($raw)
|
||||
{
|
||||
// Array output
|
||||
return array("file_exists" => false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// String output
|
||||
return "Gravity database not available";
|
||||
}
|
||||
}
|
||||
$date_file_created = date_create("@".intval($date_file_created_unix));
|
||||
$date_now = date_create("now");
|
||||
$gravitydiff = date_diff($date_file_created,$date_now);
|
||||
if($raw)
|
||||
{
|
||||
// Array output
|
||||
return array(
|
||||
"file_exists"=> true,
|
||||
"absolute" => $date_file_created_unix,
|
||||
"relative" => array(
|
||||
"days" => $gravitydiff->format("%a"),
|
||||
"hours" => $gravitydiff->format("%H"),
|
||||
"minutes" => $gravitydiff->format("%I"),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if($gravitydiff->d > 1)
|
||||
{
|
||||
// String output (more than one day ago)
|
||||
return $gravitydiff->format("Blocking list updated %a days, %H:%I (hh:mm) ago");
|
||||
}
|
||||
elseif($gravitydiff->d == 1)
|
||||
{
|
||||
// String output (one day ago)
|
||||
return $gravitydiff->format("Blocking list updated one day, %H:%I (hh:mm) ago");
|
||||
}
|
||||
|
||||
// String output (less than one day ago)
|
||||
return $gravitydiff->format("Blocking list updated %H:%I (hh:mm) ago");
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -199,7 +199,9 @@
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
|
||||
<link href="style/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="style/vendor/font-awesome-5.6.3/css/all.min.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<link href="style/vendor/font-awesome-5.11.2/css/all.min.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<link href="style/vendor/dataTables.bootstrap.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="style/vendor/daterangepicker.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
@@ -208,10 +210,6 @@
|
||||
<link href="style/pi-hole.css" rel="stylesheet" type="text/css" />
|
||||
<link rel="icon" type="image/png" sizes="160x160" href="img/logo.svg" />
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="scripts/vendor/html5shiv.min.js"></script>
|
||||
<script src="scripts/vendor/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body class="skin-blue sidebar-mini <?php if($boxedlayout){ ?>layout-boxed<?php } ?>">
|
||||
<!-- JS Warning -->
|
||||
|
||||
@@ -28,14 +28,14 @@
|
||||
<span class="fa fa-key form-control-feedback"></span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-8">
|
||||
<div class="col-xs-8 visible-md">
|
||||
<ul>
|
||||
<li><samp>Return</samp> → Log in and go to requested page (<?php echo $scriptname; ?>)</li>
|
||||
<li><samp>Ctrl+Return</samp> → Log in and go to Settings page</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<div class="form-group">
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<div class="form-group pull-left">
|
||||
<div class="checkbox pull-right"><label><input type="checkbox" id="logincookie" name="persistentlogin">Remember me for 7 days</label></div>
|
||||
</div>
|
||||
<button type="submit" href="#" class="btn btn-primary pull-right"><i class="glyphicon glyphicon-log-in"></i> Log in</button>
|
||||
|
||||
Reference in New Issue
Block a user