diff options
-rw-r--r-- | web/nms.gathering.org/ping.js | 4 | ||||
-rwxr-xr-x | web/nms.gathering.org/switches-json.pl | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/web/nms.gathering.org/ping.js b/web/nms.gathering.org/ping.js index 1299567..d19671e 100644 --- a/web/nms.gathering.org/ping.js +++ b/web/nms.gathering.org/ping.js @@ -40,6 +40,7 @@ function draw_switches(json) { s['sysname'], parseInt(s['x']), parseInt(s['y']), + parseInt(s['zorder']), parseInt(s['width']), parseInt(s['height'])); } @@ -69,7 +70,7 @@ function really_update_ping(json) { } } -function create_switch(switchnum, sysname, x, y, width, height) { +function create_switch(switchnum, sysname, x, y, zorder, width, height) { var s = document.createElement("div"); var map = document.getElementById('map'); var top_offset = map.getBoundingClientRect().top; @@ -83,6 +84,7 @@ function create_switch(switchnum, sysname, x, y, width, height) { s.style.backgroundColor = '#0000ff'; s.style.border = '1px solid black'; s.style.padding = "0"; + s.style.zIndex = zorder + 100; switches[switchnum] = s; var span = document.createElement("div"); diff --git a/web/nms.gathering.org/switches-json.pl b/web/nms.gathering.org/switches-json.pl index 5ade700..67017b4 100755 --- a/web/nms.gathering.org/switches-json.pl +++ b/web/nms.gathering.org/switches-json.pl @@ -9,7 +9,7 @@ my $cgi = CGI->new; my $dbh = nms::db_connect(); -my $q = $dbh->prepare('select switch,sysname,placement from switches natural join placements'); +my $q = $dbh->prepare('select switch,sysname,placement,zorder from switches natural join placements'); $q->execute(); my %json = (); @@ -23,7 +23,8 @@ while (my $ref = $q->fetchrow_hashref()) { x => $x2, y => $y2, width => $x1 - $x2, - height => $y1 - $y2 + height => $y1 - $y2, + zorder => $ref->{'zorder'} }; } print $cgi->header(-type=>'text/json; charset=utf-8'); |