1
0
www.mikescher.com/www/pages/admin.php

169 lines
7.1 KiB
PHP
Raw Normal View History

2018-01-21 19:07:43 +01:00
<!DOCTYPE html>
<html lang="en">
<?php
require_once (__DIR__ . '/../internals/base.php');
2018-01-26 23:52:55 +01:00
require_once (__DIR__ . '/../internals/highscores.php');
require_once (__DIR__ . '/../internals/alephnoteStatistics.php');
2018-01-27 14:21:34 +01:00
require_once (__DIR__ . '/../internals/blog.php');
require_once (__DIR__ . '/../internals/euler.php');
require_once (__DIR__ . '/../internals/highscores.php');
require_once (__DIR__ . '/../internals/mikeschergitgraph.php');
require_once (__DIR__ . '/../internals/programs.php');
2018-01-27 18:13:38 +01:00
require_once (__DIR__ . '/../internals/books.php');
2018-01-26 23:52:55 +01:00
Database::connect();
2018-01-27 14:21:34 +01:00
$consistency_blog = Blog::checkConsistency();
$consistency_prog = Programs::checkConsistency();
$consistency_euler = Euler::checkConsistency();
2018-01-27 18:13:38 +01:00
$consistency_books = Books::checkConsistency();
2018-01-27 14:21:34 +01:00
$consistency_egh = MikescherGitGraph::checkConsistency();
$consistency_progimg = Programs::checkThumbnails();
2018-01-27 18:13:38 +01:00
$consistency_bookimg = Books::checkThumbnails();
2018-01-27 14:21:34 +01:00
?>
<?php
function dumpConsistency($c) {
if ($c['result']==='ok') echo "<span class='consistency_result_ok'>OK</span>";
else if ($c['result']==='warn') echo "<span class='consistency_result_warn'>".$c['message']."</span>";
else echo "<span class='consistency_result_err'>".$c['message']."</span>";
}
2018-01-21 19:07:43 +01:00
?>
<head>
<meta charset="utf-8">
2018-01-27 14:21:34 +01:00
<title>Mikescher.com - Admin</title>
2018-01-21 19:07:43 +01:00
<link rel="icon" type="image/png" href="/data/images/favicon.png"/>
<link rel="canonical" href="https://www.mikescher.com/about"/>
<?php printCSS(); ?>
<?php includeScriptOnce("http://code.jquery.com/jquery-latest.min.js", true, '') ?>
<?php includeScriptOnce("/data/javascript/admin.js", true, 'defer') ?>
</head>
<body>
<div id="mastercontainer">
<?php $HEADER_ACTIVE = 'admin'; include (__DIR__ . '/../fragments/header.php'); ?>
<div id="content" class="content-responsive">
<div class="admincontent">
<div class="contentheader"><h1>Admin</h1><hr/></div>
2018-01-26 23:52:55 +01:00
<!------------------------------------------>
2018-01-27 14:21:34 +01:00
<div class="boxedcontent">
<div class="bc_header">Version</div>
2018-01-21 19:07:43 +01:00
2018-01-26 23:52:55 +01:00
<div class="bc_data keyvaluelist kvl_100">
<div><span>Branch:</span> <span><?php echo exec('git rev-parse --abbrev-ref HEAD'); ?></span></div>
<div><span>Commit:</span> <span><?php echo exec('git rev-parse HEAD'); ?></span></div>
<div><span>Date:</span> <span><?php echo exec('git log -1 --format=%cd'); ?></span></div>
<div><span>Message:</span><span><?php echo nl2br(trim(exec('git log -1'))); ?></span></div>
2018-01-21 19:07:43 +01:00
</div>
2018-01-27 14:21:34 +01:00
</div>
2018-01-21 19:07:43 +01:00
2018-01-27 14:21:34 +01:00
<!------------------------------------------>
<div class="boxedcontent">
<div class="bc_header">Self test</div>
<div class="bc_data">
<div class="keyvaluelist kvl_200">
2018-01-27 18:13:38 +01:00
<div><span>Program thumbnails:</span> <?php dumpConsistency($consistency_progimg); ?></div>
<div><span>ExtendedGitGraph:</span> <?php dumpConsistency($consistency_egh); ?></div>
<div><span>Book thumbnails:</span> <?php dumpConsistency($consistency_bookimg); ?></div>
2018-01-27 14:21:34 +01:00
<div><span>Blog data:</span> <?php dumpConsistency($consistency_blog); ?></div>
<div><span>Euler data:</span> <?php dumpConsistency($consistency_euler); ?></div>
<div><span>Programs data:</span> <?php dumpConsistency($consistency_prog); ?></div>
2018-01-27 18:13:38 +01:00
<div><span>Books data:</span> <?php dumpConsistency($consistency_books); ?></div>
2018-01-27 14:21:34 +01:00
</div>
<br/>
<a class="button" href="/admin/cmd/createProgramThumbnails">Update Program Thumbnails</a>
<a class="button" href="/admin/cmd/createBookThumbnails">Update Book Thumbnails</a>
</div>
</div>
2018-01-21 19:07:43 +01:00
2018-01-26 23:52:55 +01:00
<!------------------------------------------>
2018-01-21 19:07:43 +01:00
<div class="boxedcontent">
<div class="bc_header">ExtendedGitGraph</div>
<div class="bc_data">
<textarea class="egh_ajaxOutput" id="egh_ajaxOutput" readonly="readonly"></textarea>
<a class="button" href="javascript:startAjaxRefresh('<?php echo $CONFIG['ajax_secret'] ?>')">Update</a>
<a class="button" href="javascript:startAjaxRedraw('<?php echo $CONFIG['ajax_secret'] ?>')">Redraw</a>
</div>
2018-01-26 23:52:55 +01:00
</div>
2018-01-27 00:35:13 +01:00
<!------------------------------------------>
2018-01-26 23:52:55 +01:00
<div class="boxedcontent">
<div class="bc_header">AlephNote</div>
<div class="bc_data">
<div class="keyvaluelist kvl_200">
2018-01-27 00:28:32 +01:00
<div><span>Total users:</span> <span><?php echo AlephNoteStatistics::getTotalUserCount(); ?></span></div>
<div><span>Users on latest version:</span> <span><?php echo AlephNoteStatistics::getUserCountFromLastVersion(); ?></span></div>
<div><span>Active users:</span> <span><?php echo AlephNoteStatistics::getActiveUserCount(32); ?></span></div>
2018-01-26 23:52:55 +01:00
</div>
2018-01-27 00:28:32 +01:00
<br/>
2018-01-26 23:52:55 +01:00
<div id="an_ajax_target"></div>
2018-01-27 00:28:32 +01:00
<a class="button" href="javascript:startAjaxReplace('#an_ajax_target', '/su_ajax/alephNoteTable?secret=<?php echo $CONFIG['ajax_secret'] ?>')">Show</a>
2018-01-26 23:52:55 +01:00
</div>
</div>
2018-01-27 00:35:13 +01:00
<!------------------------------------------>
2018-01-26 23:52:55 +01:00
<div class="boxedcontent">
<div class="bc_header">Highscores</div>
<div class="bc_data keyvaluelist kvl_300">
<?php foreach (Highscores::getAllGames() as $game): ?>
<div><span><?php echo '[' . $game['NAME'] . '] Entries:' ?></span> <span><a href="/Highscores/list?gameid=<?php echo $game['ID']; ?>"><?php echo Highscores::getEntryCountFromGame($game['ID']); ?></a></span></div>
<div><span><?php echo '[' . $game['NAME'] . '] Highscore:' ?></span> <span><?php
$hs = Highscores::getOrderedEntriesFromGame($game['ID'], 1)[0];
echo $hs['POINTS'] . ' (' . $hs['PLAYER'] . ') @ ' . $hs['TIMESTAMP'];
?></span></div>
<div><span><?php echo '[' . $game['NAME'] . '] Last Update:' ?></span> <span><?php echo Highscores::getNewestEntriesFromGame($game['ID'], 1)[0]['TIMESTAMP']; ?></span></div>
<hr />
<?php endforeach; ?>
</div>
2018-01-27 00:35:13 +01:00
</div>
<!------------------------------------------>
<div class="boxedcontent">
<div class="bc_header">Configuration</div>
<div class="bc_data keyvaluelist kvl_200">
<?php foreach ($CONFIG as $key => $value): ?>
<div><span><?php echo $key; ?></span> <span><?php echo var_export($value, true); ?></span></div>
<?php endforeach; ?>
</div>
2018-01-21 19:07:43 +01:00
</div>
</div>
</div>
<?php include (__DIR__ . '/../fragments/footer.php'); ?>
</div>
</body>
</html>