aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@einstein.tg15.gathering.org>2015-03-31 18:34:58 +0200
committerroot <root@einstein.tg15.gathering.org>2015-03-31 18:34:58 +0200
commit95fceee877ed34a6104f630c2daf8a908cab6ee4 (patch)
tree8b4ae6e4ccb58d8aa9017df1ac6ddad17da654cd
parentad8b587583fdb55ff3c43f72edab5ec6c1ea5d43 (diff)
NMS TG15-tweaks
-rwxr-xr-xweb/nms.gathering.org/apkart.pl2
-rwxr-xr-xweb/nms.gathering.org/dhcpkart.pl2
-rw-r--r--web/nms.gathering.org/edit.html2
-rw-r--r--web/nms.gathering.org/index.html4
-rwxr-xr-xweb/nms.gathering.org/nettkart-text.pl20
-rwxr-xr-xweb/nms.gathering.org/nettkart.pl4
-rw-r--r--web/nms.gathering.org/ping.html2
-rw-r--r--web/nms.gathering.org/ping.js2
-rw-r--r--web/nms.gathering.org/ping2.html2
-rwxr-xr-xweb/nms.gathering.org/portkart.pl2
-rwxr-xr-xweb/nms.gathering.org/showswitch.pl1
-rwxr-xr-xweb/nms.gathering.org/sshow.pl5
-rwxr-xr-xweb/nms.gathering.org/stromkart.pl2
-rwxr-xr-xweb/nms.gathering.org/uplinkkart.pl2
-rwxr-xr-xweb/nms.gathering.org/uplinktrafikkart.pl2
15 files changed, 35 insertions, 19 deletions
diff --git a/web/nms.gathering.org/apkart.pl b/web/nms.gathering.org/apkart.pl
index 1d905ba..388cc92 100755
--- a/web/nms.gathering.org/apkart.pl
+++ b/web/nms.gathering.org/apkart.pl
@@ -18,7 +18,7 @@ my $dbh = nms::db_connect();
GD::Image->trueColor(1);
-my $img = GD::Image->new($cwd.'/tg14-salkart.png');
+my $img = GD::Image->new($cwd.'/tg15-salkart.png');
my $blk = $img->colorResolve(0, 0, 0);
my $red = $img->colorResolve(255, 0, 0);
diff --git a/web/nms.gathering.org/dhcpkart.pl b/web/nms.gathering.org/dhcpkart.pl
index 50abb60..ace4a4e 100755
--- a/web/nms.gathering.org/dhcpkart.pl
+++ b/web/nms.gathering.org/dhcpkart.pl
@@ -15,7 +15,7 @@ my $maxtimeout = $greentimeout*9;
my $dbh = nms::db_connect();
GD::Image->trueColor(1);
-my $map = "$cwd/tg14-salkart.png";
+my $map = "$cwd/tg15-salkart.png";
die "$map does not exist" unless -e $map;
$img = GD::Image->new($map);
diff --git a/web/nms.gathering.org/edit.html b/web/nms.gathering.org/edit.html
index 44d6d89..b99557a 100644
--- a/web/nms.gathering.org/edit.html
+++ b/web/nms.gathering.org/edit.html
@@ -7,7 +7,7 @@
<p id="playground">
<svg id="lines" width="1280" height="736" style="position: absolute; top: 0; left: 0; z-index: 1">
</svg>
- <img src="tg14-salkart.png" alt="" id="map" />
+ <img src="tg15-salkart.png" alt="" id="map" />
</p>
<script>
// These are used by ping.js, below.
diff --git a/web/nms.gathering.org/index.html b/web/nms.gathering.org/index.html
index 7390f88..10e24cb 100644
--- a/web/nms.gathering.org/index.html
+++ b/web/nms.gathering.org/index.html
@@ -78,11 +78,11 @@
<br />
- <!--<li><a href="stempmap.pl">Temperaturkart</a>
+ <li><a href="stempmap.pl">Temperaturkart</a>
<br /><i>Temperaturkart for switchene</i>
</li>
- <br /> -->
+ <br />
<li><a href="mbd-status.pl">MBD-status</a>
<br /><i>Hva spiller folk mest?</i>
diff --git a/web/nms.gathering.org/nettkart-text.pl b/web/nms.gathering.org/nettkart-text.pl
index d3f4be7..673ade5 100755
--- a/web/nms.gathering.org/nettkart-text.pl
+++ b/web/nms.gathering.org/nettkart-text.pl
@@ -6,14 +6,25 @@ use nms;
my $cgi = CGI->new;
my $dbh = nms::db_connect();
+
+my $night = defined($cgi->param('night'));
+
+if ($night) {
+print $cgi->header(-type=>'text/html; charset=utf-8', -refresh=>'10; nettkart-text.pl?night=1');
+} else {
print $cgi->header(-type=>'text/html; charset=utf-8', -refresh=>'10; ' . CGI::url());
+}
+
+my $tag = "";
+
+$tag = "bgcolor=black" if($night);
print <<"EOF";
<html>
<head>
<title>nettkart</title>
</head>
- <body>
+ <body $tag>
<map name="switches">
EOF
@@ -38,10 +49,15 @@ while (my $ref = $q->fetchrow_hashref()) {
}
$dbh->disconnect;
+my $image = "nettkart.pl";
+
+$image = "nettkart.pl?night=1" if ($night);
+
+
print <<"EOF";
</map>
- <p><img src="nettkart.pl" usemap="#switches" /></p>
+ <p><img src="$image" usemap="#switches" /></p>
</body>
</html>
EOF
diff --git a/web/nms.gathering.org/nettkart.pl b/web/nms.gathering.org/nettkart.pl
index f6dd2c2..dd27cb9 100755
--- a/web/nms.gathering.org/nettkart.pl
+++ b/web/nms.gathering.org/nettkart.pl
@@ -19,7 +19,7 @@ my $dbh = nms::db_connect();
GD::Image->trueColor(1);
my $text_img;
-our $img = GD::Image->new($cwd.'/tg14-salkart.png');
+our $img = GD::Image->new($cwd.'/tg15-salkart.png');
if ($night) {
my ($width, $height) = ($img->width, $img->height);
@@ -117,7 +117,7 @@ if ($night) {
$magick->Gamma(gamma=>1.90);
my $m2 = Image::Magick->new;
- $m2->Read($cwd.'/tg14-salkart.png');
+ $m2->Read($cwd.'/tg15-salkart.png');
$m2->Negate();
$m2->Composite(image=>$magick, compose=>'Atop');
diff --git a/web/nms.gathering.org/ping.html b/web/nms.gathering.org/ping.html
index 520daa8..f08a45f 100644
--- a/web/nms.gathering.org/ping.html
+++ b/web/nms.gathering.org/ping.html
@@ -7,7 +7,7 @@
<p id="playground">
<svg id="lines" width="1280" height="736" style="position: absolute; top: 0; left: 0; z-index: 1">
</svg>
- <img src="tg14-salkart.png" alt="" id="map" />
+ <img src="tg15-salkart.png" alt="" id="map" />
</p>
<script>
// These are used by ping.js, below.
diff --git a/web/nms.gathering.org/ping.js b/web/nms.gathering.org/ping.js
index 709bf80..6b6f12d 100644
--- a/web/nms.gathering.org/ping.js
+++ b/web/nms.gathering.org/ping.js
@@ -127,7 +127,7 @@ function rgb_from_latency(latency_ms) {
}
// 10ms is max
- var l = latency_ms / 30.0;
+ var l = latency_ms / 50.0;
if (l >= 2.0) {
return 'rgb(255, 0, 0)';
} else if (l >= 1.0) {
diff --git a/web/nms.gathering.org/ping2.html b/web/nms.gathering.org/ping2.html
index d273306..05ed129 100644
--- a/web/nms.gathering.org/ping2.html
+++ b/web/nms.gathering.org/ping2.html
@@ -7,7 +7,7 @@
<p id="playground">
<svg id="lines" width="1280" height="736" style="position: absolute; top: 0; left: 0; z-index: 1">
</svg>
- <img src="tg14-salkart.png" alt="" id="map" />
+ <img src="tg15-salkart.png" alt="" id="map" />
</p>
<script>
// These are used by ping.js, below.
diff --git a/web/nms.gathering.org/portkart.pl b/web/nms.gathering.org/portkart.pl
index 455278e..74c19b5 100755
--- a/web/nms.gathering.org/portkart.pl
+++ b/web/nms.gathering.org/portkart.pl
@@ -11,7 +11,7 @@ my $cwd = dirname($0);
my $dbh = nms::db_connect();
GD::Image->trueColor(1);
-$img = GD::Image->new($cwd.'/tg14-salkart.png');
+$img = GD::Image->new($cwd.'/tg15-salkart.png');
my $blk = $img->colorResolve(0, 0, 0);
diff --git a/web/nms.gathering.org/showswitch.pl b/web/nms.gathering.org/showswitch.pl
index 0391a57..b184bc5 100755
--- a/web/nms.gathering.org/showswitch.pl
+++ b/web/nms.gathering.org/showswitch.pl
@@ -59,7 +59,6 @@ while (my $ref = $q->fetchrow_hashref()) {
my $in = $ref->{'bytes_in'};
my $out = $ref->{'bytes_out'};
next if ($time == $prev_time);
-
if ($ref->{'port'} != $last_port) {
if ($last_port != -1) {
my $filename = "$switch-$last_port-$width-$height.png";
diff --git a/web/nms.gathering.org/sshow.pl b/web/nms.gathering.org/sshow.pl
index f406b69..1b310af 100755
--- a/web/nms.gathering.org/sshow.pl
+++ b/web/nms.gathering.org/sshow.pl
@@ -7,6 +7,7 @@ use strict;
use Switch;
use CGI;
use DBI;
+use HTML::Entities;
# Grab from .htaccess-authentication
my $user = $ENV{'REMOTE_USER'};
@@ -182,7 +183,7 @@ if ($action eq 'showgid') {
}
my @lines = split(/[\n\r]+/, $data);
foreach my $line (@lines) {
- print "\t$line\n";
+ print "\t", encode_entities($line), "\n";
}
} while (($row = $sgetgid->fetchrow_hashref()));
print "</pre>\n";
@@ -214,7 +215,7 @@ if ($action eq 'done') {
print " gID: ".$row->{gid}."\n";
my @result = split(/[\n\r]+/, $row->{result});
foreach (@result) {
- print "\t".$_."\n";
+ print "\t", encode_entities($_), "\n";
}
print "\n";
}
diff --git a/web/nms.gathering.org/stromkart.pl b/web/nms.gathering.org/stromkart.pl
index 9660dec..e4b32e0 100755
--- a/web/nms.gathering.org/stromkart.pl
+++ b/web/nms.gathering.org/stromkart.pl
@@ -17,7 +17,7 @@ my $maxtimeout = $greentimeout*9;
my $dbh = nms::db_connect();
GD::Image->trueColor(1);
-my $img = GD::Image->new($cwd.'/tg14-salkart.png');
+my $img = GD::Image->new($cwd.'/tg15-salkart.png');
my $blk = $img->colorResolve(0, 0, 0);
diff --git a/web/nms.gathering.org/uplinkkart.pl b/web/nms.gathering.org/uplinkkart.pl
index 06160f9..a72edcc 100755
--- a/web/nms.gathering.org/uplinkkart.pl
+++ b/web/nms.gathering.org/uplinkkart.pl
@@ -17,7 +17,7 @@ my $maxtimeout = $greentimeout*9;
my $dbh = nms::db_connect();
GD::Image->trueColor(1);
-my $img = GD::Image->new($cwd.'/tg14-salkart.png');
+my $img = GD::Image->new($cwd.'/tg15-salkart.png');
my $blk = $img->colorResolve(0, 0, 0);
diff --git a/web/nms.gathering.org/uplinktrafikkart.pl b/web/nms.gathering.org/uplinktrafikkart.pl
index 0f242e0..71fa049 100755
--- a/web/nms.gathering.org/uplinktrafikkart.pl
+++ b/web/nms.gathering.org/uplinktrafikkart.pl
@@ -17,7 +17,7 @@ my $maxtimeout = $greentimeout*9;
my $dbh = nms::db_connect();
GD::Image->trueColor(1);
-my $img = GD::Image->new($cwd.'/tg14-salkart.png');
+my $img = GD::Image->new($cwd.'/tg15-salkart.png');
my $blk = $img->colorResolve(0, 0, 0);