-
- 扣费与重启提示提交后会立即冻结系统分配的 IP 并扣除页面显示的金额,运行中的实例会短暂重启。只有系统明确确认变更未生效时才会自动退回余额;结果暂不确定时不会重复执行或提前退款。
- 打开“付费更换 IP”后加载更换费用。
-
+
+ 扣费与重启提示提交后会立即冻结系统分配的公网 IPv4 并扣除页面显示的金额,运行中的实例会短暂重启;公网 IPv6 保持不变。只有系统明确确认变更未生效时才会自动退回余额;结果暂不确定时不会重复执行或提前退款。
+ 打开“付费更换公网 IPv4”后加载更换费用。
+
- 本次费用
- —
diff --git a/web/resources/views/venix/cloud/pages/invoices.tpl b/web/resources/views/venix/cloud/pages/invoices.tpl
index 75515d2b..fc3dd9ac 100644
--- a/web/resources/views/venix/cloud/pages/invoices.tpl
+++ b/web/resources/views/venix/cloud/pages/invoices.tpl
@@ -16,7 +16,7 @@
-
+
diff --git a/web/tests/CloudBillingPresentationCatalogTest.php b/web/tests/CloudBillingPresentationCatalogTest.php
index 9203519f..5f3bcd8d 100644
--- a/web/tests/CloudBillingPresentationCatalogTest.php
+++ b/web/tests/CloudBillingPresentationCatalogTest.php
@@ -17,6 +17,8 @@ date_default_timezone_set('Asia/Shanghai');
try {
$assert(CloudBillingPresentationCatalog::purposeLabel('backup_addon')
=== '自动备份开通'
+ && CloudBillingPresentationCatalog::purposeLabel('ip_change')
+ === '更换公网 IPv4'
&& CloudBillingPresentationCatalog::providerLabel('paytaro')
=== 'Paytaro · 支付宝'
&& CloudBillingPresentationCatalog::money('12.5', 'USD') === '$12.50'
diff --git a/web/tests/CloudInvoicePresentationModuleTest.php b/web/tests/CloudInvoicePresentationModuleTest.php
index cc333696..27c70600 100644
--- a/web/tests/CloudInvoicePresentationModuleTest.php
+++ b/web/tests/CloudInvoicePresentationModuleTest.php
@@ -109,7 +109,7 @@ $assert($switchable['show_payment'] === true
$ipChange = [
'id' => '81',
'purpose' => 'ip_change',
- 'title' => '更换公网 IP',
+ 'title' => '更换公网 IPv4',
'currency' => 'USD',
'created_at' => 2_000_000_000,
'amount' => '5.00',
@@ -127,7 +127,8 @@ $ipChange = [
$ipView = CloudInvoicePresentation::detail(['invoice' => $ipChange]);
$ipRow = CloudInvoicePresentation::summaries([$ipChange])[0];
$assert($ipView['show_fulfillment'] === true
- && $ipView['fulfillment_title'] === '公网 IP 更换进度'
+ && $ipView['title'] === '更换公网 IPv4'
+ && $ipView['fulfillment_title'] === '公网 IPv4 更换进度'
&& $ipView['fulfillment_label'] === '待人工核对'
&& $ipView['fulfillment_class'] === 'warning'
&& $ipView['instance_id'] === '41'
@@ -135,7 +136,7 @@ $assert($ipView['show_fulfillment'] === true
&& $ipRow['fulfillment_label'] === '待人工核对'
&& $ipRow['context_display'] === '目标实例 vm-audit'
&& ($ipView['completion_notice']['message'] ?? null)
- === '公网 IP 更换结果待人工核对,请勿重复提交。',
+ === '公网 IPv4 更换结果待人工核对,请勿重复提交。',
'IP-change presentation lost its target or review-only fulfillment state.');
$unknown = CloudInvoicePresentation::summaries([[
diff --git a/web/tests/CloudInvoicePresentationTest.php b/web/tests/CloudInvoicePresentationTest.php
index e9ee1d3b..b4cebd17 100644
--- a/web/tests/CloudInvoicePresentationTest.php
+++ b/web/tests/CloudInvoicePresentationTest.php
@@ -98,7 +98,7 @@ $ipChangePayload = [
'invoice' => [
'id' => '81',
'purpose' => 'ip_change',
- 'title' => '更换公网 IP',
+ 'title' => '更换公网 IPv4',
'created_at' => 2_000_000_000,
'amount' => '5.00',
'status' => 'paid',
@@ -120,7 +120,8 @@ $ipChangeRow = CloudInvoicePresentation::summaries([
$ipChangePayload['invoice'],
])[0];
$assert(($ipChangeView['show_fulfillment'] ?? false) === true
- && ($ipChangeView['fulfillment_title'] ?? null) === '公网 IP 更换进度'
+ && ($ipChangeView['title'] ?? null) === '更换公网 IPv4'
+ && ($ipChangeView['fulfillment_title'] ?? null) === '公网 IPv4 更换进度'
&& ($ipChangeView['fulfillment_label'] ?? null) === '待人工核对'
&& ($ipChangeView['fulfillment_class'] ?? null) === 'warning'
&& ($ipChangeView['instance_id'] ?? null) === '41'
diff --git a/web/tests/CloudNetworkChangeOptionsServiceTest.php b/web/tests/CloudNetworkChangeOptionsServiceTest.php
index 4ca872be..f28a0625 100644
--- a/web/tests/CloudNetworkChangeOptionsServiceTest.php
+++ b/web/tests/CloudNetworkChangeOptionsServiceTest.php
@@ -320,9 +320,10 @@ namespace {
$instance = CloudInstance::findOrFail(30);
$tenant = CloudNetworkChangeOptionsService::tenantQuote($instance);
- $assert(($tenant['can_change'] ?? null) === true
+ $assert(($tenant['address_family'] ?? null) === 4
+ && ($tenant['can_change'] ?? null) === true
&& ($tenant['configuration_state'] ?? null) === 'ready',
- 'Current-attachment automatic IPv4 availability was not projected.');
+ 'Tenant quote lost its IPv4-only contract or current availability.');
foreach ([
'host_id', 'host_name', 'region', 'current_public_network',
'current_attachment_id', 'attachments', 'available_ip_options',
diff --git a/web/tests/CloudPaidIpChangeContractTest.php b/web/tests/CloudPaidIpChangeContractTest.php
index 8191c325..a87e473f 100644
--- a/web/tests/CloudPaidIpChangeContractTest.php
+++ b/web/tests/CloudPaidIpChangeContractTest.php
@@ -60,6 +60,8 @@ $assert($optionsMethod !== ''
'(int) $instance->user_id !== (int) $actor[\'user_id\']')
&& str_contains($optionsMethod,
'CloudNetworkChangeOptionsService::tenantQuote($instance)')
+ && str_contains($optionsMethod,
+ "'address_family' => (int) (\$options['address_family'] ?? 0)")
&& str_contains($optionsMethod, 'CloudIpChangeBillingService::price()')
&& !str_contains($optionsMethod, "'available_ip_options'")
&& !str_contains($optionsMethod, "'available_count'")
@@ -92,6 +94,7 @@ $assert($networkMethod !== ''
'Paid IP submission lost its quote check, idempotency, or strict task receipt.');
$assert(str_contains($options, "->where('state', 'available')")
+ && str_contains($options, "'address_family' => 4")
&& str_contains($options, "->whereNull('reservation_id')")
&& str_contains($options, "->whereNull('instance_id')")
&& str_contains($options, "->whereNull('operation_id')")
@@ -186,7 +189,8 @@ $ipChangeUi = $ipChangeUiStart !== false && $ipChangeUiEnd !== false
$assert(str_contains($detailView, 'data-instance-setting-tab="ip_change"')
&& str_contains($detailView, 'id="vm-ip-change-form"')
&& str_contains($detailView, 'id="vm-ip-change-price"')
- && str_contains($detailView, '系统会从当前宿主机同一网络线路的可用地址池中自动分配新地址')
+ && str_contains($detailView, '系统会从当前宿主机同一网络线路的可用 IPv4 地址池中自动分配新地址')
+ && str_contains($detailView, '公网 IPv6 保持不变')
&& str_contains($detailView, '只有系统明确确认变更未生效时才会自动退回余额')
&& !str_contains($detailView, 'id="vm-ip-change-target"')
&& !str_contains($detailView, 'id="vm-ip-change-current"')
@@ -196,7 +200,9 @@ $assert(str_contains($detailView, 'data-instance-setting-tab="ip_change"')
&& str_contains($ipChangeUi, 'expected_amount: expectedAmount')
&& str_contains($ipChangeUi, 'sessionStorage.setItem')
&& str_contains($ipChangeUi, 'automatic|${expectedAmount}')
- && str_contains($ipChangeUi, '系统将自动分配一个可用公网 IP')
+ && str_contains($ipChangeUi, 'payload.address_family !== 4')
+ && str_contains($ipChangeUi, '系统将自动分配一个可用公网 IPv4')
+ && str_contains($ipChangeUi, '公网 IPv6 保持不变')
&& str_contains($ipChangeUi, '页面已保留同一请求标识')
&& !str_contains($ipChangeUi, 'available_ip_options')
&& !str_contains($ipChangeUi, 'available_count')
@@ -207,12 +213,12 @@ $assert(str_contains($detailView, 'data-instance-setting-tab="ip_change"')
&& str_contains($ipChangeUi, "task.effect_resolution === 'applied'"),
'Tenant settings UI exposed targets or lost pricing, durable retry, or outcome guidance.');
-$assert(str_contains($billingCatalog, "'ip_change' => '更换公网 IP'")
+$assert(str_contains($billingCatalog, "'ip_change' => '更换公网 IPv4'")
&& substr_count($invoiceService,
'CloudBillingPresentationCatalog::knownPurposeLabel($purpose)') >= 2
&& str_contains($adminBilling,
"'provision', 'renewal', 'upgrade', 'ip_change'")
- && str_contains($documentation, '## 用户付费更换 IP')
+ && str_contains($documentation, '## 用户付费更换公网 IPv4')
&& str_contains($documentation, '用户页面只显示单次更换费用')
&& str_contains($documentation, '也不接受用户指定目标地址')
&& str_contains($documentation, '钱包 → 实例 → 网络账本'),