You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
326 lines
23 KiB
PHP
326 lines
23 KiB
PHP
<?php
|
|
|
|
// Static source graph only: no application boot, database or browser network.
|
|
$root = dirname(__DIR__);
|
|
$public = $root . '/public/cloud';
|
|
$assert = static function ($condition, $message) {
|
|
if (!$condition) throw new RuntimeException($message);
|
|
};
|
|
$entry = $public . '/vendor/novnc/core/rfb.js';
|
|
$queue = [$entry];
|
|
$seen = [];
|
|
while ($queue !== []) {
|
|
$file = array_pop($queue);
|
|
$resolved = realpath($file);
|
|
$assert($resolved !== false && str_starts_with($resolved, realpath($public) . DIRECTORY_SEPARATOR), 'Missing or external noVNC module: ' . $file);
|
|
if (isset($seen[$resolved])) continue;
|
|
$seen[$resolved] = true;
|
|
$source = file_get_contents($resolved);
|
|
preg_match_all('/(?:import|export)\s+(?:[^;]*?\s+from\s+)?[\'"]([^\'"]+)[\'"]\s*;/', $source, $imports);
|
|
foreach ($imports[1] as $path) {
|
|
if (str_starts_with($path, './') || str_starts_with($path, '../')) $queue[] = dirname($resolved) . '/' . $path;
|
|
}
|
|
}
|
|
$assert(count($seen) > 20, 'noVNC dependency graph was not validated');
|
|
$assert(is_file($public . '/vendor/novnc/LICENSE.txt'), 'Vendored noVNC license missing');
|
|
foreach (['almalinux', 'ubuntu', 'debian', 'centos'] as $system) {
|
|
$assert(is_file($public . '/' . $system . '-icon.svg'), 'Local OS icon missing: ' . $system);
|
|
}
|
|
foreach (['user/layout_header.tpl', 'user/layout_plain_header.tpl', 'auth/layout_header.tpl'] as $template) {
|
|
$source = file_get_contents($root . '/resources/views/venix/' . $template);
|
|
$assert(str_contains($source, '/cloud/styles.css') && str_contains($source, '/cloud/account.css'), 'Unified user styles missing: ' . $template);
|
|
$assert(!str_contains($source, 'user-home.css') && !str_contains($source, '/css/auth.css'), 'Retired user stylesheet still active: ' . $template);
|
|
}
|
|
$views = $root . '/resources/views/venix';
|
|
$cloudShell = file_get_contents($views . '/cloud/page.tpl');
|
|
$cloudPages = '';
|
|
foreach (glob($views . '/cloud/pages/*.tpl') as $template) {
|
|
$cloudPages .= "\n" . file_get_contents($template);
|
|
}
|
|
$cloudTemplate = $cloudShell . $cloudPages;
|
|
$userLayout = file_get_contents($views . '/user/layout_header.tpl');
|
|
$sharedSidebar = file_get_contents($views . '/user/panel_sidebar.tpl');
|
|
$sharedTopbar = file_get_contents($views . '/user/panel_topbar.tpl');
|
|
$clientEntry = file_get_contents($public . '/app.js');
|
|
$clientScript = $clientEntry . "\n" . file_get_contents($public . '/runtime.js');
|
|
foreach (['instances', 'detail', 'deploy', 'iso-images', 'ssh-keys', 'invoices', 'invoice-detail', 'reinstall', 'rescue'] as $module) {
|
|
$path = $public . '/' . $module . '.js';
|
|
$assert(is_file($path), 'Cloud page module missing: ' . $module);
|
|
$clientScript .= "\n" . file_get_contents($path);
|
|
}
|
|
$clientStyles = file_get_contents($public . '/client.css');
|
|
$baseStyles = file_get_contents($public . '/styles.css');
|
|
$routes = file_get_contents($root . '/config/routes.php');
|
|
$cloudPageController = file_get_contents($root . '/app/Controllers/CloudPageController.php');
|
|
$shopFormScript = file_get_contents($views . '/admin/shop/form_js.tpl');
|
|
$templateAdmin = file_get_contents($views . '/admin/cloud/templates.tpl');
|
|
$adminScript = file_get_contents($public . '/admin.js');
|
|
$cloudAdminController = file_get_contents($root . '/app/Controllers/CloudAdminController.php');
|
|
$assert(str_contains($cloudShell, "file='user/panel_sidebar.tpl'")
|
|
&& str_contains($userLayout, "file='user/panel_sidebar.tpl'"), 'Cloud and account pages must share one sidebar partial');
|
|
$assert(str_contains($cloudShell, "file='user/panel_topbar.tpl'")
|
|
&& str_contains($userLayout, "file='user/panel_topbar.tpl'"), 'Cloud and account pages must share one topbar partial');
|
|
$assert(!str_contains($cloudShell, '<aside class="sidebar"')
|
|
&& !str_contains($userLayout, 'vu-sidebar'), 'A duplicate user sidebar shell remains active');
|
|
$assert(str_contains($userLayout, '/cloud/client.css'), 'Account pages must load the shared VM-panel navigation styles');
|
|
$assert(str_contains($sharedSidebar, 'mdi-server') && str_contains($sharedSidebar, 'mdi-lifebuoy'), 'Shared sidebar must retain Venix iconography');
|
|
$assert(str_contains($sharedSidebar, '/user/logout') && !str_contains($clientScript, "location.assign('/auth/logout')"), 'Logged-in logout must use the authenticated user route');
|
|
$assert(str_contains($routes, "'/cloud/instances'")
|
|
&& str_contains($routes, "'/cloud/instances/{id:[0-9]+}'")
|
|
&& str_contains($routes, "'/cloud/deploy'")
|
|
&& str_contains($routes, "'/cloud/iso-images'")
|
|
&& str_contains($routes, "'/cloud/ssh-keys'")
|
|
&& str_contains($routes, "'/cloud/invoices'")
|
|
&& str_contains($routes, "'/cloud/invoices/{id:[0-9]+}'"),
|
|
'Cloud user pages must have stable first-class routes');
|
|
$assert(str_contains($cloudPageController, "'/user/cloud/instances'")
|
|
&& str_contains($cloudShell, 'data-cloud-page=')
|
|
&& str_contains($clientEntry, "instances: '/cloud/instances.js'")
|
|
&& str_contains($clientEntry, "import(moduleUrl.href)"),
|
|
'Cloud route controller and page-module bootstrap contract is incomplete');
|
|
$assert(!str_contains($clientScript, 'location.hash')
|
|
&& !str_contains($clientScript, 'hashchange')
|
|
&& !str_contains($clientScript, 'routeHash')
|
|
&& !str_contains($sharedSidebar, '/user/cloud#'),
|
|
'Retired hash routing must not remain in the user cloud UI');
|
|
$assert(str_contains($clientEntry, "new URL(import.meta.url).searchParams.get('v')")
|
|
&& str_contains($clientScript, "new URL('/cloud/runtime.js', location.origin)"),
|
|
'Page modules must propagate the asset version to avoid year-long stale module caching');
|
|
$assert(substr_count($clientScript, "window.addEventListener('pageshow'") >= 3
|
|
&& substr_count($clientScript, 'if (!event.persisted) return;') >= 3
|
|
&& substr_count($clientScript, 'startPolling();') >= 6,
|
|
'Instance, detail and invoice polling must resume after a browser back-forward cache restore');
|
|
$assert(str_contains($baseStyles, '#create-view.workspace-form-page,#reinstall-view.workspace-form-page{width:100%;margin-left:0;margin-right:0}'), 'Create and reinstall pages must align to the full VM-list content width');
|
|
$assert(str_contains($baseStyles, '.ssh-key-details small{display:block;margin:0;')
|
|
&& str_contains($baseStyles, '.ssh-key-actions .row-button{flex:1}')
|
|
&& str_contains($clientScript, "makeElement('small', '', key.fingerprint || '')"),
|
|
'Saved SSH keys must not inherit global muted spacing and mobile actions must target the rendered button class');
|
|
$assert(str_contains($cloudTemplate, '>实例管理</h1>') && str_contains($cloudTemplate, '>部署实例</a>'), 'Instance page terminology missing');
|
|
$assert(str_contains($sharedSidebar, '>我的实例</span>') && str_contains($sharedSidebar, '>部署实例</span>'), 'Shared sidebar instance terminology missing');
|
|
$assert(str_contains($sharedSidebar, 'href="/user/cloud/iso-images"')
|
|
&& str_contains($sharedSidebar, '{if !empty($user_iso_enabled)}')
|
|
&& str_contains($sharedSidebar, '>ISO 上传</span>')
|
|
&& str_contains($cloudShell, "cloud_page == 'isos'")
|
|
&& str_contains($clientEntry, "isos: '/cloud/iso-images.js'"),
|
|
'User-owned ISO page must be reachable from shared navigation and module bootstrap.');
|
|
$regionPosition = strpos($cloudTemplate, 'id="vm-region-picker"');
|
|
$planPosition = strpos($cloudTemplate, 'id="vm-plan-picker"');
|
|
$sourcePosition = strpos($cloudTemplate, 'id="vm-template-catalog"');
|
|
$assert($regionPosition !== false && $planPosition > $regionPosition && $sourcePosition > $planPosition
|
|
&& str_contains($clientScript, 'function renderRegionPicker()')
|
|
&& str_contains($clientScript, 'function renderPlanPicker()')
|
|
&& str_contains($clientScript, "source: 'cloud'")
|
|
&& !str_contains($clientScript, "body.iso_id")
|
|
&& !str_contains($cloudTemplate, 'class="create-source-picker"')
|
|
&& !str_contains($cloudTemplate, 'id="vm-iso"')
|
|
&& str_contains($clientScript, 'if (!strongPassword(password))')
|
|
&& str_contains($clientScript, 'formBody.inert = true')
|
|
&& str_contains($clientScript, 'formBody.inert = false')
|
|
&& !str_contains($clientScript, 'body.iso_path ='),
|
|
'Deployment must select region, plan and a cloud image without exposing an installation-mode switch.');
|
|
$planRendererStart = strpos($clientScript, 'function renderPlanPicker()');
|
|
$planRendererEnd = strpos($clientScript, 'async function selectRegion(', $planRendererStart);
|
|
$planRenderer = $planRendererStart === false || $planRendererEnd === false
|
|
? ''
|
|
: substr($clientScript, $planRendererStart, $planRendererEnd - $planRendererStart);
|
|
$assert(str_contains($planRenderer, "'plan-table-head'")
|
|
&& str_contains($planRenderer, 'formatMemoryGiB(plan.memory_mib)')
|
|
&& str_contains($planRenderer, 'formatTrafficTiBFromGiB(plan.traffic_gib)')
|
|
&& str_contains($planRenderer, 'formatUsd(plan.price)')
|
|
&& !str_contains($planRenderer, 'bandwidth_mbps')
|
|
&& str_contains($baseStyles, '.plan-option[aria-pressed="true"]::after{content:"✓"')
|
|
&& str_contains($baseStyles, '.plan-option>:nth-child(6)::before{content:"价格"}')
|
|
&& !str_contains($cloudTemplate, 'id="vm-plan-summary"')
|
|
&& !str_contains($cloudTemplate, 'class="vm-auto-public-pool"')
|
|
&& !str_contains($cloudTemplate, 'id="create-cloud-tip"')
|
|
&& !str_contains($cloudTemplate, 'id="create-iso-tip"'),
|
|
'Deployment plans must use selectable specification rows without obsolete helper panels.');
|
|
$runtimeDeployScript = file_get_contents($public . '/runtime.js');
|
|
$resetStart = strpos($runtimeDeployScript, 'function resetInstallChoices()');
|
|
$resetEnd = $resetStart === false ? false
|
|
: strpos($runtimeDeployScript, 'function renderRegionPicker()', $resetStart);
|
|
$resetInstall = $resetStart === false || $resetEnd === false ? ''
|
|
: substr($runtimeDeployScript, $resetStart, $resetEnd - $resetStart);
|
|
$resourcesStart = strpos($runtimeDeployScript, 'async function loadPlanResources()');
|
|
$resourcesEnd = $resourcesStart === false ? false
|
|
: strpos($runtimeDeployScript, 'function provisionInvoiceStorageKey()', $resourcesStart);
|
|
$resourceLoader = $resourcesStart === false || $resourcesEnd === false ? ''
|
|
: substr($runtimeDeployScript, $resourcesStart, $resourcesEnd - $resourcesStart);
|
|
$statusStart = strpos($runtimeDeployScript, 'function renderTemplateCatalogStatus(');
|
|
$statusEnd = $statusStart === false ? false
|
|
: strpos($runtimeDeployScript, 'function renderTemplateCatalog(', $statusStart);
|
|
$templateStatus = $statusStart === false || $statusEnd === false ? ''
|
|
: substr($runtimeDeployScript, $statusStart, $statusEnd - $statusStart);
|
|
$loadingPosition = strpos($resourceLoader,
|
|
"renderTemplateCatalogStatus('vm-template', '正在加载系统镜像…', true)");
|
|
$requestPosition = strpos($resourceLoader,
|
|
'const resources = await api(`/api/v1/resources?plan_id=');
|
|
$templatesPosition = strpos($resourceLoader,
|
|
'state.templates = items(resources.templates || resources.cloud_templates)');
|
|
$catalogPosition = strpos($resourceLoader, "renderTemplateCatalog('vm-template')");
|
|
$assert($resetInstall !== ''
|
|
&& !str_contains($resetInstall, "renderTemplateCatalog('vm-template')")
|
|
&& str_contains($resetInstall, 'templateInput.disabled = true')
|
|
&& str_contains($resetInstall, 'templateCatalog.replaceChildren()')
|
|
&& $loadingPosition !== false && $requestPosition !== false
|
|
&& $templatesPosition !== false && $catalogPosition !== false
|
|
&& $loadingPosition < $requestPosition
|
|
&& $requestPosition < $templatesPosition
|
|
&& $templatesPosition < $catalogPosition
|
|
&& str_contains($templateStatus, 'container.setAttribute("aria-busy", String(busy))')
|
|
&& str_contains($templateStatus, '"template-catalog-status"')
|
|
&& !str_contains($templateStatus, 'template-catalog-empty')
|
|
&& str_contains($resourceLoader, '系统镜像加载失败,请重新选择实例规格。')
|
|
&& str_contains($resourceLoader,
|
|
"epoch === state.formEpoch && error.name !== 'AbortError'")
|
|
&& str_contains($runtimeDeployScript, '暂无可用云镜像,请联系管理员导入模板。'),
|
|
'Plan changes must distinguish the cloud-image loading, failure and true-empty states.');
|
|
$assert(str_contains($baseStyles, '.deployment-step')
|
|
&& str_contains($baseStyles, '.region-option')
|
|
&& str_contains($baseStyles, '.plan-option')
|
|
&& str_contains($baseStyles, '.user-iso-row'),
|
|
'Region-first deployment and personal ISO pages must retain VM-panel styling.');
|
|
$assert(!str_contains($cloudTemplate, '购买并开通') && !str_contains($sharedSidebar, '我的虚拟机'), 'Retired VM sales labels remain');
|
|
$assert(str_contains($shopFormScript, 'Array.isArray(data.hosts)'), 'Plan editor must read the hosts collection returned by the admin API');
|
|
$assert(preg_match('/<input id="template-sha256"([^>]*)>/', $templateAdmin, $shaInput) === 1
|
|
&& !str_contains($shaInput[1], 'required'), 'Cloud image SHA-256 must be optional');
|
|
$assert(str_contains($adminScript, 'if (sha256) body.sha256 = sha256;'), 'Blank cloud image SHA-256 must be omitted from the request');
|
|
$assert(str_contains($adminScript, 'function unixTime(value)')
|
|
&& str_contains($adminScript, 'orderStatus(record.status)'),
|
|
'Order diagnostics must format timestamps and localize task status');
|
|
$assert(str_contains($clientScript, "makeElement('div', 'cloud-order-actions')")
|
|
&& str_contains($clientStyles, '.cloud-orders { min-height: 0;'),
|
|
'Billing records must use grouped actions without inheriting the inventory minimum height');
|
|
$assert(str_contains($cloudTemplate, 'data-detail-tab="operations"')
|
|
&& str_contains($cloudTemplate, 'data-detail-tab="performance"')
|
|
&& str_contains($cloudTemplate, 'data-detail-tab="traffic"'),
|
|
'VM details must expose operations, performance and traffic tabs');
|
|
$assert(str_contains($clientScript, '/traffic/daily?days=30')
|
|
&& str_contains($cloudTemplate, '最近 30 天每日流量'),
|
|
'VM traffic view must load and display daily traffic history');
|
|
$assert(preg_match('/\.inventory-panel\.vm-service-panel\s*\{[^}]*min-height:\s*0;/',
|
|
$clientStyles) === 1
|
|
&& str_contains($cloudTemplate,
|
|
'class="inventory-panel vm-service-panel"'),
|
|
'The service and traffic card must size to its content without the inventory minimum-height gap');
|
|
foreach (['expired_grace', 'blocked_expired', 'deleting', 'delete_failed',
|
|
'purge_pending', 'purge_stopping', 'purge_stop_failed', 'purge_deleting',
|
|
'purge_failed'] as $lifecycleStatus) {
|
|
$assert(str_contains($clientScript, $lifecycleStatus . ':'),
|
|
'Missing user-facing lifecycle status: ' . $lifecycleStatus);
|
|
}
|
|
$assert(str_contains($sharedSidebar, 'href="/user/cloud/invoices"')
|
|
&& str_contains($cloudTemplate, 'id="invoices-workspace"')
|
|
&& str_contains($cloudTemplate, 'id="invoice-detail-workspace"')
|
|
&& str_contains($sharedSidebar, '>账单信息</span>')
|
|
&& str_contains($clientScript, '/pay-balance')
|
|
&& str_contains($clientScript, '/payments'),
|
|
'Unified invoices must support balance and online payment paths');
|
|
$assert(str_contains($clientEntry, "'invoice-detail': '/cloud/invoice-detail.js'")
|
|
&& str_contains($cloudShell, 'data-invoice-id=')
|
|
&& str_contains($cloudShell, "panel_cloud_active='invoices'")
|
|
&& str_contains($clientScript, 'function loadInvoiceDetail(')
|
|
&& str_contains($clientScript, 'api(`/api/v1/invoices/${encodeURIComponent(id)}`)'),
|
|
'Invoice details must use an independent module while retaining the billing navigation state.');
|
|
$assert(str_contains($clientScript, "recharge: '余额充值', provision: '实例开通', renewal: '实例续费'")
|
|
&& str_contains($clientScript, '`账单 #${invoice.id} · ${formatOrderDate(invoice.created_at)}`')
|
|
&& str_contains($clientScript, "makeElement('div', 'cloud-invoice-list-amount')")
|
|
&& str_contains($clientScript, "link.href = invoicePagePath(invoice.id)")
|
|
&& !str_contains($clientScript, 'invoice.invoice_no'),
|
|
'Invoice rows must use short database IDs, type labels, a right-aligned amount and a detail link.');
|
|
$runtimeScript = file_get_contents($public . '/runtime.js');
|
|
$invoicesModule = file_get_contents($public . '/invoices.js');
|
|
$invoiceLoaderStart = strpos($runtimeScript, 'async function loadInvoices(');
|
|
$invoiceLoaderEnd = $invoiceLoaderStart === false ? false
|
|
: strpos($runtimeScript, 'async function openReinstall(', $invoiceLoaderStart);
|
|
$invoiceLoader = $invoiceLoaderStart === false || $invoiceLoaderEnd === false
|
|
? '' : substr($runtimeScript, $invoiceLoaderStart, $invoiceLoaderEnd - $invoiceLoaderStart);
|
|
$assert(str_contains($cloudTemplate, 'id="invoices-pagination"')
|
|
&& str_contains($cloudTemplate, 'id="invoices-previous"')
|
|
&& str_contains($cloudTemplate, 'id="invoices-next"')
|
|
&& str_contains($cloudTemplate, 'id="invoices-page-label"')
|
|
&& str_contains($clientStyles, '.invoice-pagination'),
|
|
'The invoice list is missing its accessible previous/next pagination controls.');
|
|
$assert(str_contains($invoiceLoader, '/api/v1/invoices?page=${encodeURIComponent(requestedPage)}')
|
|
&& str_contains($invoiceLoader, 'if (state.invoiceLoading) return state.invoiceLoadPromise;')
|
|
&& str_contains($invoiceLoader, 'state.invoicePagination = {')
|
|
&& !str_contains($invoiceLoader, 'payment_methods'),
|
|
'Invoice pagination must fetch one server page at a time without detail-only payment data.');
|
|
$assert(str_contains($invoicesModule, "byId('invoices-previous')")
|
|
&& str_contains($invoicesModule, "byId('invoices-next')")
|
|
&& str_contains($invoicesModule, 'loadInvoices(state.page + 1)')
|
|
&& str_contains($invoicesModule, 'state.loading')
|
|
&& str_contains($invoicesModule, "byId('invoices-bootstrap')")
|
|
&& !str_contains($invoicesModule, "new URL('/cloud/runtime.js'")
|
|
&& !str_contains($invoicesModule, "api('/api/v1/session')"),
|
|
'Invoice pages must hydrate the server-rendered first page and fetch only guarded later pages.');
|
|
$assert(str_contains($cloudTemplate, 'id="invoice-payment-methods"')
|
|
&& str_contains($cloudTemplate, 'id="invoice-payment-submit"')
|
|
&& str_contains($clientScript, "{ id: 'balance', name: '账户余额'")
|
|
&& str_contains($clientScript, "card.setAttribute('aria-pressed'")
|
|
&& str_contains($clientStyles, '.invoice-payment-method-card[aria-pressed="true"]')
|
|
&& str_contains($clientScript, 'renderInvoiceSpecification(invoice)')
|
|
&& str_contains($clientScript, 'renderInvoiceFulfillment(invoice)'),
|
|
'Invoice detail must isolate plan data and expose one card-based payment selector.');
|
|
$assert(str_contains($clientScript, "uncertain: ['正在核对结果', 'warning']")
|
|
&& !str_contains($clientScript, "'needs_attention', 'uncertain'].includes(status)")
|
|
&& str_contains($clientScript, 'invoiceJobProgress: new Map()')
|
|
&& str_contains($clientScript, 'job?.phase'),
|
|
'Uncertain provisioning must remain non-terminal and continue reconciliation.');
|
|
$assert(!str_contains($sharedSidebar, 'data-view="orders"')
|
|
&& !str_contains($cloudTemplate, 'id="orders-workspace"')
|
|
&& !str_contains($clientScript, 'function loadOrders()')
|
|
&& !str_contains($clientScript, "target === 'orders' || target === 'invoices'"),
|
|
'The retired user provisioning-order page and hash redirect must be absent');
|
|
$assert(str_contains($cloudTemplate, '>生成开通账单</button>')
|
|
&& str_contains($clientScript, "api('/api/v1/invoices', { method: 'POST', body })")
|
|
&& str_contains($clientScript, '/api/v1/invoices/by-request/')
|
|
&& str_contains($clientScript, "invoice?.purpose")
|
|
&& str_contains($clientScript, 'appendProvisionInvoiceActions(invoice, detail, actions)')
|
|
&& str_contains($clientScript, "makeElement('a', 'row-button', '查看实例')"),
|
|
'Instance deployment must create a recoverable invoice and expose fulfillment inside billing');
|
|
$assert(str_contains($cloudTemplate, "cloud_page == 'invoice-detail'")
|
|
&& !str_contains($cloudTemplate, "cloud_page == 'invoices' || \$cloud_page == 'invoice-detail'")
|
|
&& str_contains($cloudTemplate, '/theme/venix/js/qrcode.min.js')
|
|
&& str_contains($clientScript, "'weixin:', 'alipays:', 'alipayqr:'")
|
|
&& str_contains($clientScript, 'appendPaymentQr(box'),
|
|
'Invoice online payments must support local QR rendering and trusted payment-app links');
|
|
$assert(str_contains($clientScript, 'INVOICE_PAYMENT_STORAGE_PREFIX')
|
|
&& str_contains($clientScript, 'pendingInvoicePaymentKey(invoice.id, method.id)'),
|
|
'Invoice provider orders must reuse a session-scoped idempotency key after lost responses');
|
|
$assert(str_contains($clientScript, 'invoicePollTimers: new Map()')
|
|
&& str_contains($clientScript, 'state.invoicePollTimers.set(key, setTimeout(poll, 3000))')
|
|
&& str_contains($clientScript, 'stopInvoicePoll(key);')
|
|
&& substr_count($clientScript,
|
|
"container.querySelectorAll('button').forEach(button => { button.disabled = false; });") >= 2,
|
|
'Concurrent invoice polling and failed payment attempts must remain recoverable');
|
|
$assert(str_contains($clientScript, 'function invoiceDeletionTimestamp(invoice)')
|
|
&& str_contains($clientScript, 'invoice?.deletion_at')
|
|
&& str_contains($clientScript, 'function invoiceCanPay(invoice)')
|
|
&& substr_count($clientScript, 'if (!invoiceCanPay(invoice))') >= 2
|
|
&& str_contains($clientScript, "panel.hidden = true; container.replaceChildren(); result.replaceChildren();")
|
|
&& str_contains($clientScript, '已超过支付截止时间'),
|
|
'Invoice UI must show the deletion deadline and hide every payment path after the cutoff');
|
|
$assert(str_contains($clientScript, 'status >= 400 && status < 500')
|
|
&& str_contains($clientScript, 'const ambiguousHttpFailure = [408, 425, 429].includes(status)')
|
|
&& str_contains($clientScript, 'pendingInvoicePaymentKey(invoice.id, method.id)'),
|
|
'Ambiguous 5xx or transport failures must retain the provider idempotency key');
|
|
$assert(!str_contains($clientScript, '/renewals')
|
|
&& !str_contains($cloudTemplate, '续费周期'),
|
|
'Retired direct-renewal controls must not remain in the user UI');
|
|
$assert(str_contains($cloudAdminController, "'known_owners' => (object) CloudInstanceDiscovery::knownOwners"),
|
|
'Empty VM ownership maps must be encoded as a JSON object for engine discovery');
|
|
foreach (['hosts/index.tpl', 'cloud/orders.tpl', 'cloud/instances.tpl', 'cloud/rescue.tpl', 'cloud/templates.tpl'] as $template) {
|
|
$source = file_get_contents($views . '/admin/' . $template);
|
|
$assert(str_contains($source, '/cloud/admin.js?v={$venix_asset_version}'),
|
|
'Cloud admin script cache busting missing: ' . $template);
|
|
}
|
|
foreach (glob($views . '/user/*.tpl') as $template) {
|
|
$source = file_get_contents($template);
|
|
$assert(!str_contains($source, 'href="/user/shop"'), 'Obsolete package link remains: ' . basename($template));
|
|
$assert(!str_contains($source, 'href="/user"'), 'Ambiguous user-home link remains: ' . basename($template));
|
|
}
|
|
$assert(str_contains($sharedTopbar, 'panel-topbar') && str_contains($sharedTopbar, 'breadcrumb-current'), 'Shared topbar contract missing');
|
|
$assert(!str_contains(file_get_contents($root . '/.gitignore'), "\nvendor/"), 'Nested noVNC vendor directory would be omitted from Git');
|
|
echo 'Unified user styles, local icons and noVNC source modules passed: ' . count($seen) . " modules.\n";
|