Address LaySite 1.4.0 review findings
This commit is contained in:
@@ -111,6 +111,8 @@ php bin/backup.php import /srv/backups/laysite-2026-11.tar --replace
|
||||
|
||||
可在「账户 → 关于系统」点击「检查更新」,比较本机版本与 `git.laysense.com/laysense/laysite` 的最新 `vX.Y.Z` 发布标签。已合并但尚未打标签的版本不会出现在检查结果里。检查结果缓存 5 分钟。
|
||||
|
||||
维护者发布新版本时,在发布提交上创建并推送与 `VERSION` 对应的标签,例如 `v1.4.0`。
|
||||
|
||||
使用 Git 标签选择部署版本。更新命令先备份,再检出所选版本、安装锁定依赖并运行 SQLite 初始化或迁移。更新时暂停 Webman,更新结束后重新启动。保持源代码工作区干净,并将备份放到部署路径之外。
|
||||
|
||||
```sh
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Content;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
final class UpdateCheckInProgress extends RuntimeException
|
||||
{
|
||||
}
|
||||
@@ -33,9 +33,12 @@ final class Updates
|
||||
throw new RuntimeException('无法打开版本检查缓存。');
|
||||
}
|
||||
try {
|
||||
if (!flock($lock, LOCK_EX | LOCK_NB)) {
|
||||
if (!flock($lock, LOCK_EX | LOCK_NB, $wouldBlock)) {
|
||||
if (!$wouldBlock) {
|
||||
throw new RuntimeException('无法锁定版本检查缓存。');
|
||||
}
|
||||
if (!array_key_exists('latest', $record)) {
|
||||
throw new RuntimeException('版本检查正在进行,请稍后重试。');
|
||||
throw new UpdateCheckInProgress('版本检查正在进行,请稍后重试。');
|
||||
}
|
||||
} else {
|
||||
$record = self::cached($path);
|
||||
|
||||
@@ -17,6 +17,7 @@ use App\Content\Passwords;
|
||||
use App\Content\Repository;
|
||||
use App\Content\SiteDesign;
|
||||
use App\Content\SystemInfo;
|
||||
use App\Content\UpdateCheckInProgress;
|
||||
use App\Content\Updates;
|
||||
use App\Content\View;
|
||||
use App\Http\Request;
|
||||
@@ -168,6 +169,8 @@ class AdminController
|
||||
}
|
||||
try {
|
||||
return $this->json(Updates::check());
|
||||
} catch (UpdateCheckInProgress $error) {
|
||||
return $this->json(['message' => $error->getMessage()], 409);
|
||||
} catch (RuntimeException $error) {
|
||||
return $this->json(['message' => $error->getMessage()], 502);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ $systemLabel = SystemPage::TYPES[$page['page_type']] ?? null;
|
||||
]) ?>
|
||||
</aside>
|
||||
<div class="studio-workspace">
|
||||
<section class="admin-panel studio-preview" data-preview-studio aria-labelledby="studio-preview-title">
|
||||
<section class="admin-panel studio-preview" data-preview-studio aria-labelledby="studio-preview-title" tabindex="-1">
|
||||
<div class="admin-heading compact">
|
||||
<h2 id="studio-preview-title">页面画布</h2>
|
||||
<div class="preview-selector" aria-label="预览尺寸">
|
||||
|
||||
@@ -142,9 +142,8 @@ address { font-style: normal; }
|
||||
}
|
||||
.app-frame img, .hero-service-art img { border-radius: calc(var(--radius) / 2); }
|
||||
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; font-size: .9rem; color: var(--muted); margin-bottom: 1.35rem; }
|
||||
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--muted); }
|
||||
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
|
||||
.crumb-divider { color: #74859d; }
|
||||
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
|
||||
.breadcrumbs:not([class*="studio-style-color-"]) .crumb-divider { color: #74859d; }
|
||||
.hero-directory {
|
||||
display: flex;
|
||||
border: 1px solid var(--line);
|
||||
@@ -162,10 +161,12 @@ address { font-style: normal; }
|
||||
.hero-visual { animation-delay: 80ms; }
|
||||
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
|
||||
|
||||
.section-nav { background: var(--white); border-bottom: 1px solid var(--line); }
|
||||
.section-nav { background: var(--white); border-bottom: 1px solid var(--line); color: var(--muted); }
|
||||
.section-nav-inner { display: flex; flex-wrap: wrap; gap: .2rem clamp(1rem, 4vw, 2.8rem); padding-block: .3rem; }
|
||||
.section-nav a { color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; font-size: .95rem; text-decoration: none; }
|
||||
.section-nav a:hover { color: var(--accent); text-decoration: underline; }
|
||||
.section-nav a { min-height: 44px; display: inline-flex; align-items: center; font-size: .95rem; text-decoration: none; }
|
||||
:is(.breadcrumbs, .section-nav) a { color: inherit; }
|
||||
:is(.breadcrumbs, .section-nav) a:hover { text-decoration: underline; }
|
||||
:is(.breadcrumbs, .section-nav):not([class*="studio-style-color-"]) a:hover { color: var(--accent); }
|
||||
|
||||
.section { padding-block: var(--space-section); }
|
||||
.section + .section { border-top: 1px solid var(--line); }
|
||||
|
||||
@@ -2231,6 +2231,9 @@ jQuery(function ($) {
|
||||
|
||||
$history.on('click', function () { stepHistory(this.dataset.canvasHistory === 'undo' ? -1 : 1); });
|
||||
$layout.on('keydown.canvasHistory', historyShortcut);
|
||||
$studio.find('dialog').on('close.canvasHistory', () => {
|
||||
if (document.activeElement === document.body) $studio.get(0).focus({preventScroll: true});
|
||||
});
|
||||
$settings.on('input change', ':input', function (event) {
|
||||
const group = event.type === 'input' && this.matches('input:not([type=hidden]), textarea') ? this : null;
|
||||
captureHistory(group);
|
||||
|
||||
Reference in New Issue
Block a user