Comments (8)
Ah-hah! This explains a few things...
api.php
used to just pull the output of chronometer.sh -j
(in which the divide by zero error was fixed)
Since the introduction of all the lovely graphs, the calculations were moved into data.php
, but it looks like the fix wasn't ported across.. good catch! Thanks
from web.
I was actually troubleshooting the panel itself. The charts were spinning and I didn't see any issues in any of the XHR requests. Looking through the php logs I found the error, I fixed it locally on my server...
However the root of the problem was that dnsmasq failed to start when I rebooted my server. Im using Ubuntu and not a pi.
Maybe as a future enhancement have the system make sure all necessary services are running? It would be cool to see an alert warning you that dnsmasq is not running.
I just installed this a few days ago and have yet to play with it. So far I'm pretty impressed! Great work!
from web.
Ah, yeah the Ubuntu thing is a known issue link 1 link 2
There is a workaround in the above two links, but it's something we're looking into!
from web.
Can you make a pull request with your fix, or just post it here and we'll look at it?
from web.
This should do it, right?
if ($dns_queries_today != 0) {
$ads_percentage_today = $ads_blocked_today / $dns_queries_today * 100;
}
else {
$ads_percentage_today = 0;
};
from web.
There are about 3 ways you could do it, I ended up doing...
$ads_percentage_today = $dns_queries_today ? ($ads_blocked_today / $dns_queries_today * 100) : 0;
However your way much easier to read for the casual programmer.
from web.
Or a fancy one liner :) (did not know PHP did that, I'm a C# programmer at heart)
from web.
It's a common one line if statement. Java has it too. :)
from web.
Related Issues (20)
- Query Log table - long client names create a horizontal scrollbar in boxed layout
- Click on query log details causes Uncaught TypeError HOT 1
- Group assignment dropdown not always populated HOT 4
- Local DNS records and CNAME don't show pagination buttons HOT 11
- After clicking on the +/- icon they keep the "active" state making them nearly invisible with dark theme HOT 1
- After datatables update, tables are no longer striped HOT 1
- Save button on boxed layout outside of content area HOT 1
- SQL-Error on fresh installation on Raspberry HOT 3
- Web GUI add domain to whitelist / blacklist is added only in default group HOT 1
- No log in for a week HOT 7
- admin/scripts/pi-hole/php/customdns.php and admin/dns_records.php: CORS is something the browser handles, not the server HOT 3
- CNAME records not imported to v6 from v5 Teleport file HOT 5
- /admin/scripts/pi-hole/php/customdns.php persistently fails even with password disabled HOT 2
- Update Gravity page is redirect depending on the settings level HOT 1
- An entry in the blacklist is not being blocked HOT 10
- Mapping 2 MAC addresses to the same IP address not displayed correctly on web HOT 2
- "Total queries over last 24 hours" empty HOT 4
- NAN on Admin Stats with Multiple Containerized Pihole Admin Consoles HOT 15
- Glow effect in "Total Queries" box result in blurry text. HOT 3
- Universal Time Displayed in Firefox Instead of Local Time HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web.