Skip to content

Commit

Permalink
Restructure nav menu
Browse files Browse the repository at this point in the history
Signed-off-by: Christian König <ckoenig@posteo.de>
  • Loading branch information
yubiuser committed Jul 16, 2022
1 parent e6d1e9a commit f8e25e1
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 84 deletions.
6 changes: 3 additions & 3 deletions scripts/pi-hole/js/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ function countDown() {

//Stop and remove timer when user enabled early
if ($("#pihole-enable").is(":hidden")) {
ena.text("Enable");
ena.text("Enable Blocking");
return;
}

if (seconds > 0) {
setTimeout(countDown, 1000);
ena.text("Enable (" + secondsTimeSpanToHMS(seconds) + ")");
ena.text("Enable Blocking (" + secondsTimeSpanToHMS(seconds) + ")");
} else {
ena.text("Enable");
ena.text("Enable Blocking");
piholeChanged("enabled");
if (localStorage) {
localStorage.removeItem("countDownTarget");
Expand Down
161 changes: 82 additions & 79 deletions scripts/pi-hole/php/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,23 +404,46 @@ function pidofFTL()
}
?>
<ul class="sidebar-menu" data-widget="tree">
<li class="header text-uppercase">Main navigation</li>
<li class="header text-uppercase">Main</li>
<!-- Home Page -->
<li<?php if($scriptname === "index.php"){ ?> class="active"<?php } ?>>
<a href="index.php">
<i class="fa fa-fw menu-icon fa-home"></i> <span>Dashboard</span>
</a>
</li>
<!-- Logout -->
<?php
// Show Logout button if $auth is set and authorization is required
if(strlen($pwhash) > 0 && $auth) { ?>
<li>
<a href="?logout">
<i class="fa fa-fw menu-icon fa-sign-out-alt"></i> <span>Logout</span>
</a>
</li>
<?php } ?>
<!-- Login -->
<?php
// Show Login button if $auth is *not* set and authorization is required
if(strlen($pwhash) > 0 && !$auth) { ?>
<li<?php if($scriptname === "login"){ ?> class="active"<?php } ?>>
<a href="index.php?login">
<i class="fa fa-fw menu-icon fa-user"></i> <span>Login</span>
</a>
</li>
<?php } ?>
<?php if($auth){ ?>

<li class="header text-uppercase">Analysis</li>
<!-- Query Log -->
<li<?php if($scriptname === "queries.php"){ ?> class="active"<?php } ?>>
<a href="queries.php">
<i class="fa fa-fw menu-icon fa-file-alt"></i> <span>Query Log</span>
</a>
</li>
<!-- Long-term database -->
<li class="treeview<?php if($scriptname === "db_queries.php" || $scriptname === "db_lists.php" || $scriptname === "db_graph.php"){ ?> active<?php } ?>">
<a href="#">
<i class="fa fa-fw menu-icon fa-history"></i> <span>Long-term data</span>
<i class="fa fa-fw menu-icon fa-history"></i> <span>Long-term Data</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
Expand All @@ -433,7 +456,7 @@ function pidofFTL()
</li>
<li<?php if($scriptname === "db_queries.php"){ ?> class="active"<?php } ?>>
<a href="db_queries.php">
<i class="fa fa-fw menu-icon fa-file-alt"></i> Query Log
<i class="fa fa-fwDNS Control menu-icon fa-file-alt"></i> Query Log
</a>
</li>
<li<?php if($scriptname === "db_lists.php"){ ?> class="active"<?php } ?>>
Expand All @@ -443,41 +466,33 @@ function pidofFTL()
</li>
</ul>
</li>
<li class="header text-uppercase">Group Management</li>
<!-- Group Management -->
<li class="treeview<?php if (in_array($scriptname, array("groups.php", "groups-adlists.php", "groups-clients.php", "groups-domains.php"))){ ?> active<?php } ?>">
<a href="#">
<i class="fa fa-fw menu-icon fa-users-cog"></i> <span>Group Management</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li<?php if($scriptname === "groups.php"){ ?> class="active"<?php } ?>>
<a href="groups.php">
<i class="fa fa-fw menu-icon fa-user-friends"></i> Groups
</a>
</li>
<li<?php if($scriptname === "groups-clients.php"){ ?> class="active"<?php } ?>>
<a href="groups-clients.php">
<i class="fa fa-fw menu-icon fa-laptop"></i> Clients
</a>
</li>
<li<?php if($scriptname === "groups-domains.php"){ ?> class="active"<?php } ?>>
<a href="groups-domains.php">
<i class="fa fa-fw menu-icon fa-list"></i> Domains
</a>
</li>
<li<?php if($scriptname === "groups-adlists.php"){ ?> class="active"<?php } ?>>
<a href="groups-adlists.php">
<i class="fa fa-fw menu-icon fa-shield-alt"></i> Adlists
</a>
</li>
</ul>
<li<?php if($scriptname === "groups.php"){ ?> class="active"<?php } ?>>
<a href="groups.php">
<i class="fa fa-fw menu-icon fa-user-friends"></i> Groups
</a>
</li>
<li<?php if($scriptname === "groups-clients.php"){ ?> class="active"<?php } ?>>
<a href="groups-clients.php">
<i class="fa fa-fw menu-icon fa-laptop"></i> Clients
</a>
</li>
<li<?php if($scriptname === "groups-domains.php"){ ?> class="active"<?php } ?>>
<a href="groups-domains.php">
<i class="fa fa-fw menu-icon fa-list"></i> Domains
</a>
</li>
<li<?php if($scriptname === "groups-adlists.php"){ ?> class="active"<?php } ?>>
<a href="groups-adlists.php">
<i class="fa fa-fw menu-icon fa-shield-alt"></i> Adlists
</a>
</li>
<!-- Toggle -->
<li class="header text-uppercase">DNS Control</li>
<!-- Enable/Disable Blocking -->
<li id="pihole-disable" class="treeview"<?php if ($pistatus == "0") { ?> hidden<?php } ?>>
<a href="#">
<i class="fa fa-fw menu-icon fa-stop"></i> <span>Disable&nbsp;&nbsp;&nbsp;<span id="flip-status-disable"></span></span>
<i class="fa fa-fw menu-icon fa-stop"></i> <span>Disable Blocking&nbsp;&nbsp;&nbsp;<span id="flip-status-disable"></span></span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
Expand Down Expand Up @@ -514,11 +529,33 @@ function pidofFTL()
<li id="pihole-enable" class="treeview"<?php if (!in_array($pistatus,["0","-1","-2"])) { ?> hidden<?php } ?>>
<a href="#">
<i class="fa fa-fw menu-icon fa-play"></i>
<span id="enableLabel">Enable&nbsp;&nbsp;&nbsp;
<span id="enableLabel">Enable Blocking&nbsp;&nbsp;&nbsp;
<span id="flip-status-enable"></span>
</span>
</a>
</li>
<!-- Local DNS Records -->
<li class="treeview <?php if(in_array($scriptname, array("dns_records.php", "cname_records.php"))){ ?>active<?php } ?>">
<a href="#">
<i class="fa fa-fw menu-icon fa-address-book"></i> <span>Local DNS</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li<?php if($scriptname === "dns_records.php"){ ?> class="active"<?php } ?>>
<a href="dns_records.php">
<i class="fa fa-fw menu-icon fa-address-book"></i> DNS Records
</a>
</li>
<li<?php if($scriptname === "cname_records.php"){ ?> class="active"<?php } ?>>
<a href="cname_records.php">
<i class="fa fa-fw menu-icon fa-address-book"></i> CNAME Records
</a>
</li>
</ul>
</li>
<li class="header text-uppercase">System</li>
<!-- Tools -->
<li class="treeview<?php if (in_array($scriptname, array("messages.php", "gravity.php", "queryads.php", "auditlog.php", "taillog.php", "taillog-FTL.php", "debug.php", "network.php"))){ ?> active<?php } ?>">
<a href="#">
Expand Down Expand Up @@ -606,60 +643,26 @@ function pidofFTL()
<i class="fa fa-fw menu-icon fa-cog"></i> <span>Settings</span>
</a>
</li>
<!-- Local DNS Records -->
<li class="treeview <?php if(in_array($scriptname, array("dns_records.php", "cname_records.php"))){ ?>active<?php } ?>">
<a href="#">
<i class="fa fa-fw menu-icon fa-address-book"></i> <span>Local DNS</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li<?php if($scriptname === "dns_records.php"){ ?> class="active"<?php } ?>>
<a href="dns_records.php">
<i class="fa fa-fw menu-icon fa-address-book"></i> DNS Records
</a>
</li>
<li<?php if($scriptname === "cname_records.php"){ ?> class="active"<?php } ?>>
<a href="cname_records.php">
<i class="fa fa-fw menu-icon fa-address-book"></i> CNAME Records
</a>
</li>
</ul>
</li>
<!-- Logout -->
<?php
// Show Logout button if $auth is set and authorization is required
if(strlen($pwhash) > 0) { ?>
<li>
<a href="?logout">
<i class="fa fa-fw menu-icon fa-sign-out-alt"></i> <span>Logout</span>
<?php } ?>
<li class="header text-uppercase">Support</li>
<!-- Docs -->
<li>
<a href="https://docs.pi-hole.net/" rel="noopener" target="_blank">
<i class="fa fa-fw menu-icon fa-question-circle"></i> <span>Documentation</span>
</a>
</li>
<?php } ?>
<?php } ?>
<!-- Login -->
<?php
// Show Login button if $auth is *not* set and authorization is required
if(strlen($pwhash) > 0 && !$auth) { ?>
<li<?php if($scriptname === "login"){ ?> class="active"<?php } ?>>
<a href="index.php?login">
<i class="fa fa-fw menu-icon fa-user"></i> <span>Login</span>
<!-- Discourse -->
<li>
<a href="https://discourse.pi-hole.net/" rel="noopener" target="_blank">
<i class="fa fa-fw menu-icon fab fa-discourse"></i> <span>Pi-hole Forum</span>
</a>
</li>
<?php } ?>
<!-- Donate -->
<li>
<a href="https://pi-hole.net/donate/" rel="noopener" target="_blank">
<i class="fas fa-fw menu-icon fa-donate"></i> <span>Donate</span>
</a>
</li>
<!-- Docs -->
<li>
<a href="https://docs.pi-hole.net/" rel="noopener" target="_blank">
<i class="fa fa-fw menu-icon fa-question-circle"></i> <span>Documentation</span>
</a>
</li>
</ul>
</section>
<!-- /.sidebar -->
Expand Down
2 changes: 1 addition & 1 deletion style/themes/default-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ h4 {
color: #fff;
}
.sidebar-menu > li.header {
color: #556068;
color: rgb(173, 166, 156);
background-color: #1e2225;
}
.sidebar-menu > li > a {
Expand Down
2 changes: 1 addition & 1 deletion style/themes/default-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
color: #fff;
}
.sidebar-menu > li.header {
color: #4b646f;
color: rgb(173, 166, 156);
background-color: #1a2226;
}
.sidebar-menu > li > a {
Expand Down

0 comments on commit f8e25e1

Please sign in to comment.