diff --git a/web/public/cloud/styles.css b/web/public/cloud/styles.css index 485e78ba..b0be97bb 100644 --- a/web/public/cloud/styles.css +++ b/web/public/cloud/styles.css @@ -317,12 +317,10 @@ body.vu-body .ssh-key-picker-manage:hover { .cloud-vpc-name-link { color:#344f62; font-weight:650; text-decoration:none; line-height:1.6; } .cloud-vpc-name-link:hover { color:#079ca8; text-decoration:underline; text-underline-offset:4px; } .cloud-vpc-network-name small { display:block; color:#8295a2; margin-top:5px; font-size:12px; } -.cloud-vpc-network-table th:nth-child(1) { width:29%; } -.cloud-vpc-network-table th:nth-child(2) { width:25%; } -.cloud-vpc-network-table th:nth-child(3) { width:12%; } -.cloud-vpc-network-table th:nth-child(4) { width:15%; } -.cloud-vpc-network-table th:nth-child(5) { width:19%; } -.cloud-vpc-network-actions { text-align:right; } +.cloud-vpc-network-table th:nth-child(1) { width:34%; } +.cloud-vpc-network-table th:nth-child(2) { width:30%; } +.cloud-vpc-network-table th:nth-child(3) { width:14%; } +.cloud-vpc-network-table th:nth-child(4) { width:22%; } .cloud-vpc-text-button { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:32px; padding:3px 0; background:none; border:0; color:#078f9a; font-family:inherit; font-size:13px; font-weight:600; line-height:1.5; text-decoration:none; cursor:pointer; } .cloud-vpc-text-button:hover:not(:disabled) { color:#067580; text-decoration:underline; text-underline-offset:4px; } #cloud-vpcs-workspace .danger { color:#bf4d5a; } @@ -425,7 +423,6 @@ html.cloud-vpc-confirm-open { overflow:hidden; } .cloud-vpc-network-status { grid-column:2; grid-row:1; justify-self:end; } .cloud-vpc-network-table .cloud-vpc-table-address { grid-column:1; grid-row:2; } .cloud-vpc-network-count { grid-column:2; grid-row:2; text-align:right; } - .cloud-vpc-network-actions { grid-column:1/-1; padding-top:2px!important; } .cloud-vpc-members-panel { overflow:visible; } .cloud-vpc-member-table tbody { display:grid; gap:10px; padding:12px; background:#f5f8fa; } .cloud-vpc-member-table tbody tr { grid-template-columns:28px minmax(0,1fr) auto; gap:10px 12px; padding:16px 14px; border:1px solid #dfe8ed; border-radius:12px; background:#fff; } diff --git a/web/public/cloud/vpcs.js b/web/public/cloud/vpcs.js index 9ce513d4..8499b9e0 100644 --- a/web/public/cloud/vpcs.js +++ b/web/public/cloud/vpcs.js @@ -364,8 +364,7 @@ function renderHome() { } const table = element('table', 'cloud-vpc-table cloud-vpc-network-table'); table.setAttribute('aria-label', 'VPC 网络列表'); - table.append(tableHeader(['网络名称 / 地区', '私网网段', '实例', '状态', ''])); - table.querySelector('th:last-child').append(element('span', 'sr-only', '管理')); + table.append(tableHeader(['网络名称 / 地区', '私网网段', '实例', '状态'])); const body = element('tbody'); for (const vpc of state.items) { const row = element('tr'); @@ -378,13 +377,9 @@ function renderHome() { const [label, type] = activeBatchForVpc(vpc) ? ['变更中', 'other'] : vpcState(vpc.state); const status = tableCell('cloud-vpc-network-status', '状态'); status.append(element('span', `state-pill ${type}`, label)); - const actions = tableCell('cloud-vpc-network-actions', '管理'); - const manage = element('a', 'cloud-vpc-text-button', '管理实例 →'); - manage.href = membersHref(vpc); - actions.append(manage); row.append(identity, address, tableCell('cloud-vpc-network-count', '实例', `${vpc.port_count || 0} 台`), - status, actions); + status); body.append(row); } table.append(body); diff --git a/web/resources/views/venix/cloud/pages/vpcs.tpl b/web/resources/views/venix/cloud/pages/vpcs.tpl index 25e7727f..fc83c1f5 100644 --- a/web/resources/views/venix/cloud/pages/vpcs.tpl +++ b/web/resources/views/venix/cloud/pages/vpcs.tpl @@ -11,13 +11,12 @@
{if !empty($cloud_vpc_view.networks)} - + {foreach $cloud_vpc_view.networks as $network} - {/foreach}
网络名称 / 地区私网网段实例状态管理
网络名称 / 地区私网网段实例状态
{$network.name|escape:'html'}{$network.region_name|escape:'html'} {$network.cidr|escape:'html'} {$network.port_count|default:0|escape:'html'} 台 {$network.state_label|escape:'html'}管理实例 →
{else}
还没有 VPC

选择一个地区,建立你的第一张私有网络。

创建 VPC
{/if} diff --git a/web/resources/views/venix/layout_assets.tpl b/web/resources/views/venix/layout_assets.tpl index a1d193c2..804675bc 100644 --- a/web/resources/views/venix/layout_assets.tpl +++ b/web/resources/views/venix/layout_assets.tpl @@ -1,2 +1,2 @@ {* Shared Venix CSS/JS cache key. Increment whenever a shared browser asset changes. *} -{assign var=venix_asset_version value='2026103009' scope='global'} +{assign var=venix_asset_version value='2026103010' scope='global'} diff --git a/web/tests/CloudVpcPageBehaviorTest.mjs b/web/tests/CloudVpcPageBehaviorTest.mjs index ca2d1df2..4d89f1a8 100644 --- a/web/tests/CloudVpcPageBehaviorTest.mjs +++ b/web/tests/CloudVpcPageBehaviorTest.mjs @@ -163,6 +163,8 @@ for (const [query, page, joining] of [ assert.equal(t.nodes.get('cloud-vpcs-home').hidden, false); assert.equal(t.nodes.get('cloud-vpcs-create').hidden, true); assert.equal(t.nodes.get('cloud-vpcs-list').querySelector('tbody').children.length, 2); + assert.equal(t.nodes.get('cloud-vpcs-list').querySelectorAll('th').length, 4); + assert.equal(t.nodes.get('cloud-vpcs-list').textContent.includes('管理实例'), false); assert.equal(t.nodes.get('cloud-vpcs-list').querySelectorAll('details').length, 0); await t.go('#/create'); assert.equal(t.nodes.get('cloud-vpcs-create').hidden, false); diff --git a/web/tests/CloudVpcUserContractTest.php b/web/tests/CloudVpcUserContractTest.php index 42ae962c..f5636055 100644 --- a/web/tests/CloudVpcUserContractTest.php +++ b/web/tests/CloudVpcUserContractTest.php @@ -101,6 +101,9 @@ $assert(str_contains($javascript, 'function renderHome(') && str_contains($javascript, "'加入实例'") && str_contains($javascript, "'cloud-vpc-table cloud-vpc-network-table'") && str_contains($javascript, "'cloud-vpc-table cloud-vpc-member-table'") + && !str_contains($template, 'class="cloud-vpc-network-actions"') + && !str_contains($javascript, "'cloud-vpc-network-actions'") + && !str_contains($styles, '.cloud-vpc-network-actions') && str_contains($javascript, 'async function submitMembershipBatch(') && str_contains($javascript, 'async function cancelMembershipBatch(') && str_contains($javascript, 'batch?.can_cancel !== true')