Commit 9d397237 authored by David Morley's avatar David Morley Committed by GitHub

More cleanup (#105)

* dash

* language tag

* do better when no podname given. make tooltip cleaner.

* kill ad, shorten tip, clean language

* users/sign_up is a ruby path, we support all now
parent 8ae5a7c3
...@@ -79,7 +79,7 @@ while ($row = pg_fetch_assoc($result)) { ...@@ -79,7 +79,7 @@ while ($row = pg_fetch_assoc($result)) {
$shortversion = $dverr[0]; $shortversion = $dverr[0];
$signup = ($jsonssl->openRegistrations ?? false) === true; $signup = ($jsonssl->openRegistrations ?? false) === true;
$softwarename = $jsonssl->software->name ?? 'unknown'; $softwarename = $jsonssl->software->name ?? 'unknown';
$name = $jsonssl->metadata->nodeName ?? 'null'; $name = $jsonssl->metadata->nodeName ?? $softwarename;
$total_users = $jsonssl->usage->users->total ?? 0; $total_users = $jsonssl->usage->users->total ?? 0;
$active_users_halfyear = $jsonssl->usage->users->activeHalfyear ?? 0; $active_users_halfyear = $jsonssl->usage->users->activeHalfyear ?? 0;
$active_users_monthly = $jsonssl->usage->users->activeMonth ?? 0; $active_users_monthly = $jsonssl->usage->users->activeMonth ?? 0;
...@@ -120,7 +120,7 @@ while ($row = pg_fetch_assoc($result)) { ...@@ -120,7 +120,7 @@ while ($row = pg_fetch_assoc($result)) {
$iplookupv4 = []; $iplookupv4 = [];
$ip = ''; $ip = '';
exec(escapeshellcmd('delv @' . $dnsserver . ' ' . $domain), $iplookupv4); exec(escapeshellcmd('delv @' . $dnsserver . ' ' . $domain . ' 2>&1'), $iplookupv4);
$dnssec = in_array('; fully validated', $iplookupv4, true) ?? false; $dnssec = in_array('; fully validated', $iplookupv4, true) ?? false;
$getaonly = array_values(preg_grep('/\s+IN\s+A\s+.*/', $iplookupv4)); $getaonly = array_values(preg_grep('/\s+IN\s+A\s+.*/', $iplookupv4));
if ($getaonly) { if ($getaonly) {
...@@ -129,7 +129,7 @@ while ($row = pg_fetch_assoc($result)) { ...@@ -129,7 +129,7 @@ while ($row = pg_fetch_assoc($result)) {
} }
$iplookupv6 = []; $iplookupv6 = [];
$ipv6 = null; $ipv6 = null;
exec(escapeshellcmd('delv @' . $dnsserver . ' ' . $domain . ' AAAA '), $iplookupv6); exec(escapeshellcmd('delv @' . $dnsserver . ' ' . $domain . ' AAAA 2>&1'), $iplookupv6);
$getaaaaonly = array_values(preg_grep('/\s+IN\s+AAAA\s+.*/', $iplookupv6)); $getaaaaonly = array_values(preg_grep('/\s+IN\s+AAAA\s+.*/', $iplookupv6));
if ($getaaaaonly) { if ($getaaaaonly) {
preg_match('/AAAA\s(.*)/', $getaaaaonly[0], $aaaaversion); preg_match('/AAAA\s(.*)/', $getaaaaonly[0], $aaaaversion);
......
...@@ -32,5 +32,5 @@ if ($_domain) { ...@@ -32,5 +32,5 @@ if ($_domain) {
$result = pg_query_params($dbh, $sql, [$row[0]['domain'], '1']); $result = pg_query_params($dbh, $sql, [$row[0]['domain'], '1']);
$result || die('Error in SQL query: ' . pg_last_error()); $result || die('Error in SQL query: ' . pg_last_error());
header('Location: https://' . $row[0]['domain'] . '/users/sign_up'); header('Location: https://' . $row[0]['domain']);
} }
...@@ -9,7 +9,7 @@ $podminedit = isset($_GET['podminedit']); ...@@ -9,7 +9,7 @@ $podminedit = isset($_GET['podminedit']);
$simpleview = !($detailedview || $mapview || $cleanup || $podmin || $podminedit || $statsview); $simpleview = !($detailedview || $mapview || $cleanup || $podmin || $podminedit || $statsview);
?> ?>
<!doctype html> <!doctype html>
<html> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Open Source Social Network Pod Uptime Status</title> <title>Open Source Social Network Pod Uptime Status</title>
...@@ -60,12 +60,7 @@ $simpleview = !($detailedview || $mapview || $cleanup || $podmin || $podminedi ...@@ -60,12 +60,7 @@ $simpleview = !($detailedview || $mapview || $cleanup || $podmin || $podminedi
<li><a href="https://github.com/diasporg/Poduptime/wiki">Wiki</a></li> <li><a href="https://github.com/diasporg/Poduptime/wiki">Wiki</a></li>
<li><a href="https://github.com/diasporg/Poduptime/wiki/API">API</a></li> <li><a href="https://github.com/diasporg/Poduptime/wiki/API">API</a></li>
</ul> </ul>
<p><small>Data refreshed: <br><?php echo date('M d y H:i', filemtime($lastfile)); ?> EST</small></p><br> <p><small>Data refreshed: <br><?php echo date('M d y H:i', filemtime($lastfile)); ?> EST</small></p>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3662181805557062" data-ad-slot="2195215834" data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div> </div>
<div class="main offset-md-1"> <div class="main offset-md-1">
<a href="go.php" class="btn btn-sm btn-success">Confused? Auto pick a pod for you.</a> <a href="go.php" class="btn btn-sm btn-success">Confused? Auto pick a pod for you.</a>
......
...@@ -36,9 +36,7 @@ $numrows = pg_num_rows($result); ...@@ -36,9 +36,7 @@ $numrows = pg_num_rows($result);
$verdiff = str_replace('.', '', $row['masterversion']) - str_replace('.', '', $row['shortversion']); $verdiff = str_replace('.', '', $row['masterversion']) - str_replace('.', '', $row['shortversion']);
$pod_name = htmlentities($row['name'], ENT_QUOTES); $pod_name = htmlentities($row['name'], ENT_QUOTES);
$tip = sprintf( $tip = sprintf(
'This %1$s pod %2$s has been watched for %3$s months and with an uptime of %4$s%% this month. On a scale of 100 this pod is a %5$s right now', 'Uptime %2$s%% over %1$s months, score is %3$s out of 100.',
$row['softwarename'],
$pod_name,
$row['monthsmonitored'], $row['monthsmonitored'],
$row['uptime_alltime'], $row['uptime_alltime'],
$row['score'] $row['score']
......
...@@ -33,7 +33,7 @@ $numrows = pg_num_rows($result); ...@@ -33,7 +33,7 @@ $numrows = pg_num_rows($result);
<th><a data-toggle="tooltip" data-placement="bottom" title="Number of users active last 1 month on this pod.">Active 1m</a></th> <th><a data-toggle="tooltip" data-placement="bottom" title="Number of users active last 1 month on this pod.">Active 1m</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="Number of total posts on this pod.">Posts</a></th> <th><a data-toggle="tooltip" data-placement="bottom" title="Number of total posts on this pod.">Posts</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="Number of total comments on this pod.">Comments</a></th> <th><a data-toggle="tooltip" data-placement="bottom" title="Number of total comments on this pod.">Comments</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="How many months has this pod been online? Click number for more history.">Months</a></th> <th><a data-toggle="tooltip" data-placement="bottom" title="How many months has this pod been online.">Months</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="User rating for this pod.">Rating</a></th> <th><a data-toggle="tooltip" data-placement="bottom" title="User rating for this pod.">Rating</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="System Score on a 100 point scale.">Score</a></th> <th><a data-toggle="tooltip" data-placement="bottom" title="System Score on a 100 point scale.">Score</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="Does this domain use DNSSEC.">DNSSEC</a></th> <th><a data-toggle="tooltip" data-placement="bottom" title="Does this domain use DNSSEC.">DNSSEC</a></th>
...@@ -46,8 +46,7 @@ $numrows = pg_num_rows($result); ...@@ -46,8 +46,7 @@ $numrows = pg_num_rows($result);
<?php <?php
while ($row = pg_fetch_array($result)) { while ($row = pg_fetch_array($result)) {
$pod_name = htmlentities($row['name'], ENT_QUOTES); $pod_name = htmlentities($row['name'], ENT_QUOTES);
$tip = "\n This {$row['softwarename']} pod {$pod_name} has been watched for {$row['monthsmonitored']} months with an overall uptime of {$row['uptime_alltime']}% and a response time average today of {$row['latency']}ms was last checked on {$row['date_updated']}. "; $tip = "\n Over {$row['monthsmonitored']} months uptime is {$row['uptime_alltime']}% and response time is {$row['latency']}ms, last check on {$row['date_updated']}. ";
$tip .= "On a scale of 100 this pod is a {$row['score']} right now";
echo '<tr><td><a title="' . $tip . '" data-toggle="tooltip" data-placement="bottom" target="_self" href="/go.php?domain=' . $row['domain'] . '">' . $row['domain'] . '</a><span class="text-success" " data-toggle="tooltip" title="This site is SSL/TLS encrypted with a cert that expires: ' . $row['sslexpire'] . '"> &#128274;</span></td>'; echo '<tr><td><a title="' . $tip . '" data-toggle="tooltip" data-placement="bottom" target="_self" href="/go.php?domain=' . $row['domain'] . '">' . $row['domain'] . '</a><span class="text-success" " data-toggle="tooltip" title="This site is SSL/TLS encrypted with a cert that expires: ' . $row['sslexpire'] . '"> &#128274;</span></td>';
...@@ -70,7 +69,7 @@ $numrows = pg_num_rows($result); ...@@ -70,7 +69,7 @@ $numrows = pg_num_rows($result);
} }
echo '<td class="' . $classver . '"><div title="' . $pre . ' version: ' . $row['shortversion'] . ' master version is: ' . $row['masterversion'] . '" data-toggle="tooltip" data-placement="bottom">' . $version . '</div></td>'; echo '<td class="' . $classver . '"><div title="' . $pre . ' version: ' . $row['shortversion'] . ' master version is: ' . $row['masterversion'] . '" data-toggle="tooltip" data-placement="bottom">' . $version . '</div></td>';
echo '<td>' . $row['softwarename'] . '</td>'; echo '<td>' . $row['softwarename'] . '</td>';
echo '<td>' . ($row['uptime_alltime'] > 0 ? $row['uptime_alltime'].'%' : '') . '</td>'; echo '<td>' . ($row['uptime_alltime'] > 0 ? $row['uptime_alltime'].'%' : '-') . '</td>';
echo '<td>' . ($row['ipv6'] === 't' ? '&#10003;' : '') . '</td>'; echo '<td>' . ($row['ipv6'] === 't' ? '&#10003;' : '') . '</td>';
echo '<td>' . ($row['latency'] > 0 ? $row['latency'] : '') . '</td>'; echo '<td>' . ($row['latency'] > 0 ? $row['latency'] : '') . '</td>';
echo '<td>' . ($row['signup'] === 't' ? '&#10003;' : '') . '</td>'; echo '<td>' . ($row['signup'] === 't' ? '&#10003;' : '') . '</td>';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment