1
0

Optionally show all fields of AN statsping in admin area

This commit is contained in:
Mike Schwörer 2021-01-29 15:19:05 +01:00
parent 091e37c134
commit 990e803192
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
5 changed files with 63 additions and 15 deletions

View File

@ -5,30 +5,68 @@ require_once (__DIR__ . '/../internals/website.php');
/** @var URLRoute $ROUTE */ global $ROUTE; /** @var URLRoute $ROUTE */ global $ROUTE;
/** @var Website $SITE */ global $SITE; /** @var Website $SITE */ global $SITE;
$mode = isset($_GET['mode']) ? $_GET['mode'] : '';
?> ?>
<div class="stripedtable_container"> <div class="stripedtable_container">
<table class="stripedtable"> <table class="stripedtable">
<thead> <thead>
<tr> <tr>
<th>ClientID</th> <?php if ($mode == 'short'): ?>
<th>Version</th> <th>Version</th>
<th>Provider</th> <th>Provider</th>
<th>NoteCount</th> <th>NoteCount</th>
<th>LastChanged</th> <th>LastChanged</th>
<th>CreatedAt</th> <th>CreatedAt</th>
<th>Comment</th> <th>Comment</th>
<?php elseif ($mode == 'full'): ?>
<th>ClientID</th>
<th>Version</th>
<th>Provider</th>
<th>NoteCount</th>
<th>LastChanged</th>
<th>CreatedAt</th>
<th>Comment</th>
<th>RawFolderRepo</th>
<th>RawFolderRepoMode</th>
<th>GitMirror</th>
<th>GitMirrorPush</th>
<th>Theme</th>
<th>LaunchOnBoot</th>
<th>EmulateHierarchicalStructure</th>
<th>HasEditedAdvancedSettings</th>
<th>AdvancedSettingsDiff</th>
<?php endif; ?>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($SITE->modules->AlephNoteStatistics()->getAllActiveEntriesOrdered() as $entry): ?> <?php foreach ($SITE->modules->AlephNoteStatistics()->getAllActiveEntriesOrdered() as $entry): ?>
<tr> <tr>
<td><?php echo $entry['ClientID']; ?></td> <?php if ($mode == 'short'): ?>
<td><?php echo $entry['Version']; ?></td> <td><?php echo $entry['Version']; ?></td>
<td><?php echo $entry['ProviderStr']; ?></td> <td><?php echo $entry['ProviderStr']; ?></td>
<td><?php echo $entry['NoteCount']; ?></td> <td><?php echo $entry['NoteCount']; ?></td>
<td><?php echo $entry['LastChanged']; ?></td> <td><?php echo $entry['LastChanged']; ?></td>
<td><?php echo $entry['CreatedAt']; ?></td> <td><?php echo $entry['CreatedAt']; ?></td>
<td><?php echo $entry['Comment']; ?></td> <td><?php echo $entry['Comment']; ?></td>
<?php elseif ($mode == 'full'): ?>
<td><?php echo $entry['ClientID']; ?></td>
<td><?php echo $entry['Version']; ?></td>
<td><?php echo $entry['ProviderStr']; ?></td>
<td><?php echo $entry['NoteCount']; ?></td>
<td><?php echo $entry['LastChanged']; ?></td>
<td><?php echo $entry['CreatedAt']; ?></td>
<td><?php echo $entry['Comment']; ?></td>
<td><?php echo $entry['RawFolderRepo']; ?></td>
<td><?php echo $entry['RawFolderRepoMode']; ?></td>
<td><?php echo $entry['GitMirror']; ?></td>
<td><?php echo $entry['GitMirrorPush']; ?></td>
<td><?php echo $entry['Theme']; ?></td>
<td><?php echo $entry['LaunchOnBoot']; ?></td>
<td><?php echo $entry['EmulateHierarchicalStructure']; ?></td>
<td><?php echo $entry['HasEditedAdvancedSettings']; ?></td>
<td><?php echo $entry['AdvancedSettingsDiff']; ?></td>
<?php endif; ?>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>

View File

@ -991,6 +991,10 @@ html, body {
color: #FF0000; color: #FF0000;
} }
.admin_ajax_gitfield {
white-space: pre;
}
#loginform div { #loginform div {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -189,6 +189,7 @@ html,body{margin:0;padding:0;height:100%}
.boxedcontent.successbox{background-color:#168b00;color:#222;border:1px solid #444;font-weight:bold;text-align:center} .boxedcontent.successbox{background-color:#168b00;color:#222;border:1px solid #444;font-weight:bold;text-align:center}
.boxedcontent.successbox .bc_data{padding-top:2px;padding-bottom:2px} .boxedcontent.successbox .bc_data{padding-top:2px;padding-bottom:2px}
.admin_ajax_gitfield_error{color:red} .admin_ajax_gitfield_error{color:red}
.admin_ajax_gitfield{white-space:pre}
#loginform div{display:flex;flex-direction:column} #loginform div{display:flex;flex-direction:column}
#loginform div button{margin:10px 0;padding:0} #loginform div button{margin:10px 0;padding:0}
.loginerror{display:flex;background:#f44;color:#222;border:1px solid #a44;border-radius:2px;font-weight:bold;padding:0 5px;margin:5px 0 20px 0} .loginerror{display:flex;background:#f44;color:#222;border:1px solid #a44;border-radius:2px;font-weight:bold;padding:0 5px;margin:5px 0 20px 0}

View File

@ -139,4 +139,8 @@
.admin_ajax_gitfield_error { .admin_ajax_gitfield_error {
color: $COL_ADMIN_ERROR; color: $COL_ADMIN_ERROR;
}
.admin_ajax_gitfield {
white-space: pre;
} }

View File

@ -119,7 +119,8 @@ $connected = true; try { $SITE->modules->Database(); } catch (Exception $e) { $c
</div> </div>
<br/> <br/>
<div id="an_ajax_target"></div> <div id="an_ajax_target"></div>
<a class="button" href="javascript:startAjaxReplace('#an_ajax_target', '/api/alephnote::show?secret=<?php echo $SITE->config['ajax_secret'] ?>')">Show</a> <a class="button" href="javascript:startAjaxReplace('#an_ajax_target', '/api/alephnote::show?secret=<?php echo $SITE->config['ajax_secret'] ?>&mode=short')">Show (short)</a>
<a class="button" href="javascript:startAjaxReplace('#an_ajax_target', '/api/alephnote::show?secret=<?php echo $SITE->config['ajax_secret'] ?>&mode=full')" >Show (full)</a>
</div> </div>
<?php else: ?> <?php else: ?>
<div class="bc_data keyvaluelist admindberr">Database not connected.</div> <div class="bc_data keyvaluelist admindberr">Database not connected.</div>