精修用户 VPC 页面样式

go
codex 2 weeks ago
parent d663e16d96
commit ebfccca608

@ -370,19 +370,19 @@ body.vu-body .ssh-key-picker-manage:hover {
#cloud-vpcs-workspace h1:focus { outline:none; }
#cloud-vpcs-workspace h2 { margin:0; font-size:16px; color:#354f61; }
#cloud-vpcs-workspace .button { font-size:13px; min-height:40px; }
#cloud-vpcs-workspace .state-pill { width:fit-content; white-space:nowrap; font-size:12px; padding:6px 10px; }
#cloud-vpcs-workspace .state-pill { width:fit-content; white-space:nowrap; }
#cloud-vpcs-workspace .vm-settings-status { margin:0 0 18px; font-size:13px; line-height:1.6; }
.cloud-vpc-list-meta { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:13px; }
.cloud-vpc-list-meta span { color:#7d91a0; font-size:13px; }
.cloud-vpc-list-panel,.cloud-vpc-create-panel,.cloud-vpc-members-panel { min-height:0; min-width:0; overflow:hidden; box-shadow:none; }
.cloud-vpc-table { width:100%; min-width:0; border-collapse:collapse; table-layout:fixed; text-align:left; font-size:14px; }
.cloud-vpc-table th { height:auto; background:#f8fafb; color:#8093a0; font-size:12px; font-weight:650; padding:17px 20px; border-bottom:1px solid #e5ecf0; }
.cloud-vpc-table td { height:auto; vertical-align:middle; padding:24px 20px; border:0; border-bottom:1px solid #e7edf1; font-size:14px; color:#526c7e; overflow-wrap:anywhere; }
.cloud-vpc-notice { margin-bottom:20px; }
.cloud-vpc-list-panel,.cloud-vpc-create-panel,.cloud-vpc-members-panel { min-height:0; min-width:0; overflow:hidden; }
.cloud-vpc-list { min-width:0; }
.cloud-vpc-table { width:100%; min-width:0; border-collapse:collapse; table-layout:fixed; text-align:left; font-size:13px; }
.cloud-vpc-table th { height:auto; background:#f8fafb; color:#8797a5; font-size:11px; font-weight:750; padding:14px 20px; border-bottom:1px solid #e5ecf0; }
.cloud-vpc-table td { height:auto; vertical-align:middle; padding:19px 20px; border:0; border-bottom:1px solid #e7edf1; font-size:13px; color:#526c7e; overflow-wrap:anywhere; }
.cloud-vpc-table tr:last-child>td { border-bottom:0; }
.cloud-vpc-table tbody tr:hover { background:#fcfefe; }
.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-name small { display:block; color:#8295a2; margin-top:4px; font-size:11px; }
.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%; }
@ -392,17 +392,17 @@ body.vu-body .ssh-key-picker-manage:hover {
#cloud-vpcs-workspace .danger { color:#bf4d5a; }
#cloud-vpcs-workspace .button.danger { border-color:#e6c7cc; }
.cloud-vpc-footnote { color:#7b909f; font-size:12px; line-height:1.7; margin:16px 0 0; }
.cloud-vpc-empty { display:grid; justify-items:center; gap:12px; padding:54px 20px; text-align:center; color:#8094a3; }
.cloud-vpc-empty strong { font-size:16px; color:#4c6678; }
.cloud-vpc-empty p { font-size:13px; line-height:1.7; margin:0; }
.cloud-vpc-create-panel { max-width:900px; }
.cloud-vpc-create-form { display:grid; gap:28px; padding:28px 32px 0; }
.cloud-vpc-empty { display:grid; justify-items:center; gap:10px; margin:18px; padding:42px 20px; border:1px dashed #d8e4e8; border-radius:10px; background:#fbfdfd; text-align:center; color:#8094a3; }
.cloud-vpc-empty strong { font-size:14px; color:#4c6678; }
.cloud-vpc-empty p { font-size:11px; line-height:1.7; margin:0; }
.cloud-vpc-create-panel { width:100%; }
.cloud-vpc-create-form { display:grid; gap:24px; width:100%; max-width:980px; margin:0 auto; padding:25px 28px 0; }
.cloud-vpc-create-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.cloud-vpc-create-form .field { display:flex; flex-direction:column; min-width:0; }
.cloud-vpc-create-form .field label { font-size:13px; margin:0 0 10px; }
.cloud-vpc-create-form .field input,.cloud-vpc-create-form .field select { margin:0; height:46px; font-size:16px; }
.cloud-vpc-create-form .field small { color:#7d91a0; font-size:12px; line-height:1.7; margin-top:9px; }
.cloud-vpc-allocation { display:flex; gap:24px; padding:20px 0; border-top:1px solid #e9eef1; border-bottom:1px solid #e9eef1; font-size:13px; }
.cloud-vpc-create-form .field label { font-size:12px; margin:0 0 9px; }
.cloud-vpc-create-form .field input,.cloud-vpc-create-form .field select { margin:0; height:44px; font-size:13px; }
.cloud-vpc-create-form .field small { color:#7d91a0; font-size:11px; line-height:1.7; margin-top:8px; }
.cloud-vpc-allocation { display:flex; gap:24px; padding:16px 18px; border:1px solid #e3ebef; border-radius:10px; background:#f8fbfc; font-size:12px; }
.cloud-vpc-allocation>span { color:#7b909f; min-width:88px; }
.cloud-vpc-allocation>div { display:grid; gap:6px; }
.cloud-vpc-allocation strong { font-size:13px; font-weight:600; }
@ -412,10 +412,12 @@ body.vu-body .ssh-key-picker-manage:hover {
.cloud-vpc-create-form>.cloud-vpc-create-footer { margin-top:-12px; }
.cloud-vpc-title-row { display:flex; align-items:center; flex-wrap:wrap; gap:14px; }
.cloud-vpc-title-row .state-pill { margin-bottom:8px; }
.cloud-vpc-network-summary { display:flex; flex-wrap:wrap; gap:24px 56px; margin:0 0 28px; }
.cloud-vpc-network-summary>div { display:grid; gap:7px; min-width:0; }
.cloud-vpc-network-summary dt { font-size:12px; color:#8295a3; }
.cloud-vpc-network-summary dd { font-size:14px; font-weight:600; margin:0; overflow-wrap:anywhere; }
.cloud-vpc-network-overview { margin:0 0 20px; overflow:hidden; border:1px solid #e3eaef; border-radius:13px; background:#fff; box-shadow:0 10px 30px rgba(19,42,65,.027); }
.cloud-vpc-network-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); margin:0; }
.cloud-vpc-network-summary>div { display:grid; gap:7px; min-width:0; padding:17px 21px; }
.cloud-vpc-network-summary>div+div { border-left:1px solid #edf1f4; }
.cloud-vpc-network-summary dt { font-size:10px; font-weight:750; color:#8a9aa7; }
.cloud-vpc-network-summary dd { font-size:13px; font-weight:700; margin:0; overflow-wrap:anywhere; }
.cloud-vpc-network-summary>div:not(:first-child) dd,.cloud-vpc-table-address code,.cloud-vpc-confirm-instances code { font:500 14px/1.6 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#486579; background:none; padding:0; }
.cloud-vpc-tabs { display:flex; gap:28px; padding:0 24px; border-bottom:1px solid #e5ecf0; }
.cloud-vpc-tabs a { display:inline-flex; align-items:center; gap:7px; min-height:58px; padding:17px 0 15px; border-bottom:2px solid transparent; color:#7b909f; text-decoration:none; font-size:14px; font-weight:600; }
@ -475,15 +477,17 @@ html.cloud-vpc-confirm-open { overflow:hidden; }
}
@media(max-width:760px) {
#cloud-vpcs-workspace { padding-bottom:max(8px,env(safe-area-inset-bottom)); }
#cloud-vpcs-workspace .cloud-vpcs-heading { gap:18px; flex-wrap:wrap; margin-bottom:22px; }
#cloud-vpcs-workspace .cloud-vpcs-heading>.button { width:auto; }
#cloud-vpcs-workspace .cloud-vpcs-heading { align-items:stretch; flex-direction:column; gap:18px; margin-bottom:22px; }
#cloud-vpcs-workspace .cloud-vpcs-heading>.button { width:100%; justify-content:center; }
#cloud-vpcs-workspace h1 { font-size:25px; }
.cloud-vpc-table,.cloud-vpc-table tbody { display:block; }
.cloud-vpc-table thead { display:none; }
.cloud-vpc-table tr { display:grid; padding:20px; gap:15px 18px; border-bottom:1px solid #e6edf1; }
.cloud-vpc-table tr { display:grid; padding:17px 16px; gap:13px 16px; border-bottom:1px solid #e6edf1; }
.cloud-vpc-table tr:last-child { border-bottom:0; }
.cloud-vpc-table td { padding:0; border:0; min-width:0; }
.cloud-vpc-table-address::before,.cloud-vpc-network-count::before { content:attr(data-label); display:block; margin-bottom:4px; font-family:inherit; font-size:12px; line-height:1.6; color:#8a9ca9; }
.cloud-vpc-table-address::before,.cloud-vpc-network-count::before { content:attr(data-label); display:block; margin-bottom:4px; font-family:inherit; font-size:10px; line-height:1.6; color:#8a9ca9; }
.cloud-vpc-network-table tbody { display:grid; gap:10px; padding:12px; background:#f5f8fa; }
.cloud-vpc-network-table tr,.cloud-vpc-network-table tr:last-child { border:1px solid #dfe8ed; border-radius:12px; background:#fff; }
.cloud-vpc-network-table tr { grid-template-columns:minmax(0,1fr) auto; }
.cloud-vpc-network-name { grid-column:1; grid-row:1; }
.cloud-vpc-network-status { grid-column:2; grid-row:1; justify-self:end; }
@ -512,9 +516,9 @@ html.cloud-vpc-confirm-open { overflow:hidden; }
.cloud-vpc-instance-status .cloud-vpc-text-button { min-height:40px; margin-top:0; }
.cloud-vpc-create-form { gap:24px; padding:24px 20px 0; }
.cloud-vpc-create-fields { grid-template-columns:1fr; gap:22px; }
.cloud-vpc-network-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; padding:14px 0; border-block:1px solid #e6edf1; }
.cloud-vpc-network-summary>div { gap:4px; padding:0 12px; }
.cloud-vpc-network-summary>div+div { border-left:1px solid #e6edf1; }
.cloud-vpc-create-form .field input,.cloud-vpc-create-form .field select { font-size:16px; }
.cloud-vpc-network-summary { grid-template-columns:repeat(3,minmax(0,1fr)); }
.cloud-vpc-network-summary>div { gap:4px; padding:14px 12px; }
.cloud-vpc-network-summary dt { font-size:10px; }
.cloud-vpc-network-summary dd,.cloud-vpc-network-summary>div:not(:first-child) dd { font-size:12px; }
.cloud-vpc-tabs { gap:22px; padding-inline:16px; background:#fff; }
@ -538,5 +542,8 @@ html.cloud-vpc-confirm-open { overflow:hidden; }
.cloud-vpc-table tr { padding-inline:14px; }
.cloud-vpc-confirm { padding:20px; }
.cloud-vpc-confirm-instances li { flex-wrap:wrap; gap:4px; }
.cloud-vpc-network-summary>div { padding-inline:8px; }
.cloud-vpc-network-summary { grid-template-columns:1fr; }
.cloud-vpc-network-summary>div { grid-template-columns:100px minmax(0,1fr); align-items:center; padding:12px 14px; }
.cloud-vpc-network-summary>div+div { border-top:1px solid #edf1f4; border-left:0; }
.cloud-vpc-network-summary dd,.cloud-vpc-network-summary>div:not(:first-child) dd { text-align:right; }
}

@ -4,11 +4,13 @@
<section id="cloud-vpcs-home" aria-labelledby="cloud-vpcs-title"{if $cloud_vpc_view.page|default:'home' != 'home'} hidden{/if}>
<div class="page-heading cloud-vpcs-heading">
<div><h1 id="cloud-vpcs-title" tabindex="-1">VPC 私网</h1><p>管理同地区实例之间的私有网络。</p></div>
<div><span class="eyebrow">PRIVATE NETWORKING</span><h1 id="cloud-vpcs-title" tabindex="-1">VPC 私网</h1><p>集中管理同地区实例之间的私有网络。</p></div>
<a class="button button-primary" href="/user/cloud/vpcs?view=create">+ 创建 VPC</a>
</div>
<div class="cloud-vpc-list-meta"><h2>我的网络</h2><span id="cloud-vpcs-quota">{$cloud_vpc_view.used|default:0|escape:'html'} / {$cloud_vpc_view.maximum|default:16|escape:'html'} 个</span></div>
<div id="cloud-vpcs-list" class="inventory-panel cloud-vpc-list-panel">
<div class="vm-settings-notice cloud-vpc-notice"><strong>私网与公网相互独立</strong><span>同一 VPC 内的实例默认互通;加入或移出私网不会修改实例的公网配置。</span></div>
<section class="inventory-panel cloud-vpc-list-panel" aria-labelledby="cloud-vpcs-list-title">
<div class="panel-heading"><div><h2 id="cloud-vpcs-list-title">我的网络</h2><p>每张 VPC 仅连接同一地区的实例,私网地址由系统统一分配。</p></div><span id="cloud-vpcs-quota" class="state-pill other">{$cloud_vpc_view.used|default:0|escape:'html'} / {$cloud_vpc_view.maximum|default:16|escape:'html'} 个</span></div>
<div id="cloud-vpcs-list" class="cloud-vpc-list" aria-live="polite">
{if !empty($cloud_vpc_view.networks)}
<table class="cloud-vpc-table cloud-vpc-network-table" aria-label="VPC 网络列表">
<thead><tr><th scope="col">网络名称 / 地区</th><th scope="col">私网网段</th><th scope="col">实例</th><th scope="col">状态</th></tr></thead>
@ -20,15 +22,15 @@
</tr>{/foreach}</tbody>
</table>
{else}<div class="cloud-vpc-empty"><strong>还没有 VPC</strong><p>选择一个地区,建立你的第一张私有网络。</p><a class="button button-outline" href="/user/cloud/vpcs?view=create">创建 VPC</a></div>{/if}
</div>
<p class="cloud-vpc-footnote">同一 VPC 内默认互通,实例公网配置保持独立。</p>
</div>
</section>
</section>
<section id="cloud-vpcs-create" aria-labelledby="cloud-vpc-create-title"{if $cloud_vpc_view.page|default:'home' != 'create'} hidden{/if}>
<div class="page-heading cloud-vpcs-heading"><div><h1 id="cloud-vpc-create-title" tabindex="-1">创建 VPC</h1><p>先建立网络,再选择需要加入的实例。</p></div></div>
<div class="page-heading cloud-vpcs-heading"><div><span class="eyebrow">CREATE PRIVATE NETWORK</span><h1 id="cloud-vpc-create-title" tabindex="-1">创建 VPC</h1><p>先建立私有网络,再选择需要加入的同地区实例。</p></div></div>
<div class="inventory-panel cloud-vpc-create-panel">
<div class="panel-heading"><div><h2>网络配置</h2><p>只需填写名称和所属地区,网段与默认网关由系统自动分配。</p></div><span class="state-pill other">自动分配地址</span></div>
<form id="cloud-vpc-create-form" class="cloud-vpc-create-form">
<h2>基本信息</h2>
<div class="cloud-vpc-create-fields">
<div class="field"><label for="cloud-vpc-name">VPC 名称</label><input id="cloud-vpc-name" maxlength="80" required autocomplete="off" placeholder="例如 production" aria-describedby="cloud-vpc-name-help"><small id="cloud-vpc-name-help">用于识别这张私有网络。</small></div>
<div class="field"><label for="cloud-vpc-region">所属地区</label><select id="cloud-vpc-region" required aria-describedby="cloud-vpc-region-help"><option value="">{if empty($cloud_vpc_view.regions)}暂无可用地区{else}请选择地区{/if}</option>{foreach $cloud_vpc_view.regions|default:[] as $region}<option value="{$region.id|escape:'html'}">{$region.name|escape:'html'}</option>{/foreach}</select><small id="cloud-vpc-region-help">只有同地区的实例可以加入。</small></div>
@ -42,8 +44,8 @@
</section>
<section id="cloud-vpcs-members" aria-labelledby="cloud-vpc-members-title"{if $cloud_vpc_view.page|default:'home' != 'members'} hidden{/if}>
<div class="page-heading cloud-vpcs-heading"><div><div class="cloud-vpc-title-row"><h1 id="cloud-vpc-members-title" tabindex="-1">{$cloud_vpc_view.current.name|default:''|escape:'html'}</h1><span id="cloud-vpc-members-state" class="state-pill {$cloud_vpc_view.current.state_class|default:''|escape:'html'}">{$cloud_vpc_view.current.state_label|default:''|escape:'html'}</span></div><p>实例成员管理</p></div></div>
<dl id="cloud-vpc-network-summary" class="cloud-vpc-network-summary" aria-label="网络信息">{if !empty($cloud_vpc_view.current)}<div><dt>地区</dt><dd>{$cloud_vpc_view.current.region_name|escape:'html'}</dd></div><div><dt>私网网段</dt><dd>{$cloud_vpc_view.current.cidr|escape:'html'}</dd></div><div><dt>默认网关</dt><dd>{$cloud_vpc_view.current.gateway|escape:'html'}</dd></div>{/if}</dl>
<div class="page-heading cloud-vpcs-heading"><div><span class="eyebrow">PRIVATE NETWORK</span><div class="cloud-vpc-title-row"><h1 id="cloud-vpc-members-title" tabindex="-1">{$cloud_vpc_view.current.name|default:''|escape:'html'}</h1><span id="cloud-vpc-members-state" class="state-pill {$cloud_vpc_view.current.state_class|default:''|escape:'html'}">{$cloud_vpc_view.current.state_label|default:''|escape:'html'}</span></div><p>管理实例成员、私网地址和连接状态。</p></div></div>
<div class="cloud-vpc-network-overview"><dl id="cloud-vpc-network-summary" class="cloud-vpc-network-summary" aria-label="网络信息">{if !empty($cloud_vpc_view.current)}<div><dt>地区</dt><dd>{$cloud_vpc_view.current.region_name|escape:'html'}</dd></div><div><dt>私网网段</dt><dd>{$cloud_vpc_view.current.cidr|escape:'html'}</dd></div><div><dt>默认网关</dt><dd>{$cloud_vpc_view.current.gateway|escape:'html'}</dd></div>{/if}</dl></div>
<div id="cloud-vpc-batch-status" aria-live="polite">{if !empty($cloud_vpc_view.current.batch)}<div class="cloud-vpc-batch-status"><div><strong>正在应用私网变更</strong><small>共 {$cloud_vpc_view.current.batch.total|default:0|escape:'html'} 台 · {$cloud_vpc_view.current.batch.succeeded|default:0|escape:'html'} 台成功。离开页面不会中断任务。</small></div></div>{/if}</div>
<div class="inventory-panel cloud-vpc-members-panel">
<nav class="cloud-vpc-tabs" aria-label="实例管理方式"><a id="cloud-vpc-members-link" href="{$cloud_vpc_view.current.members_href|default:'/user/cloud/vpcs'|escape:'html'}"{if empty($cloud_vpc_view.joining)} aria-current="page"{/if}>已加入实例<span class="cloud-vpc-tab-count">{$cloud_vpc_view.member_count|default:0|escape:'html'}</span></a><a id="cloud-vpc-join-link" href="{$cloud_vpc_view.current.join_href|default:'/user/cloud/vpcs'|escape:'html'}"{if !empty($cloud_vpc_view.joining)} aria-current="page"{/if}>加入实例<span class="cloud-vpc-tab-count">{$cloud_vpc_view.joinable_count|default:0|escape:'html'}</span></a></nav>

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

@ -83,6 +83,9 @@ $assert(str_contains($template, 'id="cloud-vpcs-home"')
&& str_contains($template, 'class="inventory-panel cloud-vpc-list-panel"')
&& str_contains($template, 'class="inventory-panel cloud-vpc-create-panel"')
&& str_contains($template, 'class="inventory-panel cloud-vpc-members-panel"')
&& str_contains($template, 'class="eyebrow">PRIVATE NETWORKING</span>')
&& str_contains($template, 'class="panel-heading"><div><h2 id="cloud-vpcs-list-title">我的网络</h2>')
&& str_contains($template, 'class="cloud-vpc-network-overview"')
&& str_contains($template, 'class="cloud-vpc-create-form"')
&& str_contains($template, 'class="cloud-vpc-create-footer"')
&& str_contains($template, 'id="cloud-vpc-batch-status"')

Loading…
Cancel
Save