fix(admin): show maintenance detail drawer on mobile

go
codex 2 weeks ago
parent 77eb38b20e
commit 8e9cbba26b

@ -197,13 +197,24 @@ if (root) {
}
async function openDetail(key) {
const dialog = byId('maintenance-detail');
if (!dialog.open) dialog.showModal();
if (!dialog.open) {
const opened = window.VenixDrawerMotion?.openDrawerWithMotion(dialog);
if (!opened) dialog.showModal();
}
byId('maintenance-detail-state').textContent = '正在读取通知详情…';
byId('maintenance-detail-body').replaceChildren();
byId('maintenance-detail-cancel').hidden = true;
try { renderDetail(await runtime.read(`/api/v1/admin/maintenance-notices/${encodeURIComponent(key)}`)); }
catch (error) { byId('maintenance-detail-state').textContent = error.message || '详情读取失败。'; }
}
async function closeDetail() {
const dialog = byId('maintenance-detail');
if (window.VenixDrawerMotion?.closeDrawerWithMotion) {
await window.VenixDrawerMotion.closeDrawerWithMotion(dialog);
return;
}
if (dialog.open) dialog.close();
}
function uncertain(error) {
if (!error?.mutationMayHaveApplied) return false;
state.mutationLocked = true;
@ -260,8 +271,8 @@ if (root) {
} catch (error) { if (!uncertain(error)) notify(error.message || '取消失败。', true); }
finally { button.disabled = state.mutationLocked; }
});
byId('maintenance-detail-close').addEventListener('click', () => byId('maintenance-detail').close());
byId('maintenance-detail').addEventListener('cancel', event => { event.preventDefault(); byId('maintenance-detail').close(); });
byId('maintenance-detail-close').addEventListener('click', () => { void closeDetail(); });
byId('maintenance-detail').addEventListener('cancel', event => { event.preventDefault(); void closeDetail(); });
byId('maintenance-notice-refresh').addEventListener('click', () => { void loadPage(state.page.page || 1); });
byId('maintenance-status-filter').addEventListener('change', () => { void loadPage(1); });
byId('maintenance-previous').addEventListener('click', () => { void loadPage(Math.max(1, Number(state.page.page || 1) - 1)); });

@ -1,2 +1,2 @@
{* Shared Venix CSS/JS cache key. Increment whenever a shared browser asset changes. *}
{assign var=venix_asset_version value='2026110603' scope='global'}
{assign var=venix_asset_version value='2026110604' scope='global'}

@ -16,6 +16,14 @@ assert.match(source, /if \(!error\?\.mutationMayHaveApplied\) return false;[\s\S
'An uncertain write must lock the composer instead of replaying it.');
assert.match(source, /VenixAdminDangerDialog\.confirm/,
'Cancellation must use the shared administrator danger dialog.');
assert.match(source,
/async function openDetail\(key\)[\s\S]*VenixDrawerMotion\?\.openDrawerWithMotion\(dialog\)/,
'Maintenance detail must use the shared drawer opener so transformed dialogs become visible.');
assert.match(source,
/async function closeDetail\(\)[\s\S]*VenixDrawerMotion\.closeDrawerWithMotion\(dialog\)/,
'Maintenance detail must use the shared drawer closer so mobile transitions finish safely.');
assert.doesNotMatch(source, /if \(!dialog\.open\) dialog\.showModal\(\)/,
'Opening the maintenance dialog directly leaves the drawer translated off screen.');
assert.doesNotMatch(source, /\bfetch\s*\(|innerHTML|window\.confirm/,
'The page must not bypass the request runtime or safe DOM rendering.');

@ -15,7 +15,7 @@ $assert = static function (bool $condition, string $message): void {
};
$assert(is_string($assets)
&& str_contains($assets, "venix_asset_version value='2026110603'")
&& str_contains($assets, "venix_asset_version value='2026110604'")
&& is_string($cloudShell)
&& str_contains($cloudShell, '/cloud/app.js?v={$venix_asset_version}'),
'The cloud application entry must use the shared Venix asset version.');

@ -94,7 +94,7 @@ $assert(str_contains($instanceDetail, '补偿可用时间')
'The instance service and billing surface lost its scoped compensation shortcut.');
$assert(str_contains($assets,
"venix_asset_version value='2026110603'"),
"venix_asset_version value='2026110604'"),
'The compensation administrator assets must publish the requested cache version.');
echo "Service compensation administrator page contracts passed.\n";

Loading…
Cancel
Save