Files
laysite/app/view/admin-about.php
T

65 lines
3.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
use App\Content\Licenses;
use App\Content\View;
$e = View::escape(...);
?>
<header class="admin-heading"><h1><?= $e($title) ?></h1></header>
<div class="admin-about">
<section class="admin-panel admin-system-info" aria-labelledby="system-info-title">
<h2 id="system-info-title">版本与运行环境</h2>
<dl>
<div><dt>LaySite</dt><dd><?= $e($laysiteVersion) ?></dd></div>
</dl>
<details class="admin-options admin-about-details" data-about-metrics>
<summary>运行环境详情</summary>
<dl>
<?php foreach ($systemInfo as $name => $value): ?>
<div><dt><?= $e($name) ?></dt><dd><?= $e($value) ?></dd></div>
<?php endforeach ?>
<div><dt>CPU 占用</dt><dd data-about-cpu>暂不可用</dd></div>
<div><dt>内存占用</dt><dd data-about-memory><?= $e($memory ?? '暂不可用') ?></dd></div>
<div><dt>媒体库占用</dt><dd><?= $e($mediaUsage['size']) ?><small>已登记文件,含归档资源</small></dd></div>
<div><dt>媒体磁盘可用</dt><dd><?= $e($mediaUsage['free'] ?? '暂不可用') ?></dd></div>
</dl>
<p class="field-note">CPU 和内存显示 Linux 系统可见的用量,在详情展开且页面可见时自动更新。</p>
</details>
</section>
<section class="admin-panel admin-licenses" aria-labelledby="system-licenses-title">
<h2 id="system-licenses-title">开源许可证</h2>
<div class="admin-license-project">
<div><strong>LaySite</strong><p><?= $e(Licenses::PROJECT_NAME) ?>(<?= $e(Licenses::PROJECT) ?>)</p></div>
<a href="<?= $e(Licenses::PROJECT_PATH) ?>" target="_blank" rel="noopener noreferrer">查看许可证全文</a>
</div>
<details class="admin-options admin-about-details">
<summary>第三方项目与许可</summary>
<ul class="admin-license-list">
<?php foreach ($thirdPartyLicenses as $key => $project): ?>
<li>
<div>
<?php if ($project['url'] !== ''): ?><a href="<?= $e($project['url']) ?>" target="_blank" rel="noopener noreferrer"><?= $e($project['name']) ?></a>
<?php else: ?><?= $e($project['name']) ?><?php endif ?>
<?php if (!empty($project['version'])): ?><small><?= $e($project['version']) ?></small><?php endif ?>
</div>
<div>
<span><?= $e($project['license']) ?></span>
<?php if ($project['file'] !== null): ?>
<a href="/admin/about/license/<?= $e($key) ?>" target="_blank" rel="noopener noreferrer" aria-label="<?= $e('查看 ' . $project['name'] . ' 的许可证全文') ?>">许可全文</a>
<?php elseif ($project['url'] !== ''): ?>
<a href="<?= $e($project['url']) ?>" target="_blank" rel="noopener noreferrer" aria-label="<?= $e('前往 ' . $project['name'] . ' 项目主页查看许可证') ?>">见项目主页</a>
<?php endif ?>
</div>
</li>
<?php endforeach ?>
</ul>
</details>
</section>
<nav class="admin-about-links" aria-label="项目链接">
<?php foreach (['LaySite' => 'https://laysense.cn/laysite', 'Laysense' => 'https://laysense.cn'] as $name => $url): ?>
<a href="<?= $e($url) ?>" target="_blank" rel="noopener noreferrer">
<?= View::fragment('studio-icon', ['icon' => 'external']) ?><strong><?= $e($name) ?></strong><span><?= $e($url) ?></span>
</a>
<?php endforeach ?>
</nav>
</div>