Skip to content

Commit

Permalink
add tile cover images and status improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
dschwen committed Jan 25, 2022
1 parent 9fdcf4c commit e367ed9
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 2 deletions.
3 changes: 3 additions & 0 deletions overview/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Overview images

The plot in this directory document the steady growth in coverage by on-demand rendered tiles.
41 changes: 41 additions & 0 deletions status.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
(function() {
// add thumbs
var thumbs = [];
var map = null;
var current = null;
for (let i = 8; i <= 12; ++i)
{
var img =
$('<img/>')
.attr({'src': 'overview/overview_' + i + '.png', 'width': '200px'})
.click(function(e) {
if (this == current)
{
var x = e.offsetX;
var y = e.offsetY;
var w = e.target.offsetWidth;
var h = e.target.offsetHeight;
lon = x/w*360.0;
lat = (0.5-y/h)*180.0;
if (lon > 180) {
lon = lon - 360.0;
}
if (map == null) {
map = $('<iframe/>').attr({'width': '800', 'height': '600'}).appendTo('#map')
}
var lang = 'en';
map.attr('src', 'iframe_dev.html?wma='+lat+'_'+lon+'_800_600_' + lang + '_3_' + lang + '&globe=Earth&lang=' + lang);
}
else
{
$.each(thumbs, (i, e) => { e.attr('width', '200px'); });
$(this).removeAttr('width');
current = this;
}
});

thumbs.push(img);

$('<span/>').css('padding', '1em').append(img).appendTo('#overview');
}
})();
25 changes: 23 additions & 2 deletions status.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
<?php

//
// label.php version for WMF Cloud, (c) 2021 Daniel Schwen
// status.php version for WMF Cloud, (c) 2021-2022 Daniel Schwen
//

require 'master.inc';

// no errors
error_reporting(0);

// get disk usage
$dfree = disk_free_space('/volume');
$dtotal = disk_total_space('/volume');
$puse = floor(100*($dtotal-$dfree)/$dtotal);
$guse = floor((($dtotal-$dfree)/1024/1024/1024)*100)/100;
$gtotal = floor(($dtotal/1024/1024/1024)*100)/100;
?>

<html>
<head><title></title></head>
<head><title></title>
<script src="min/jquery.min"></script>
</head>
<body>

<h2>Map tile overviews</h2>
<p><?= $puse ?>% tile cache used. (<?= $guse . '/' . $gtotal ?>GB</p>
<div id="overview"></div>
<p><a href="overview/overview_8.gif">8</a>,
<a href="overview/overview_9.gif">9</a>,
<a href="overview/overview_10.gif">10</a>,
<a href="overview/overview_11.gif">11</a>,
<a href="overview/overview_12.gif">12</a> gifs.</p>
<div id="map"></div>

<h2>Extraction logs</h2>
<p><a href="/logs">Cick here</a></p>

Expand Down Expand Up @@ -66,3 +85,5 @@
?>

</table>
<script src="status.js"></script>
</body>

0 comments on commit e367ed9

Please sign in to comment.