docs: annotate all shared frontend modules in Chinese
This commit is contained in:
1 parent
2be21c1c62
commit
408f8e5c98
55 files changed
+349
No files matched your search
@@ -1,4 +1,6 @@
|
||||
/** 云实例管理表单的协议校验:防御报价、订单、NAT、VPC 和磁盘规格。 */
|
||||
var e = (e) => e === `mf_cloud` || e === `remf_cloud`;
|
||||
// 空对象表示没有防御选项;非空配置必须给出合法的 defence 列表及当前防御值。
|
||||
function t(e) {
|
||||
let t = () => {
|
||||
throw Error(`防御配置无效,请重试`);
|
||||
@@ -40,6 +42,7 @@ function t(e) {
|
||||
current: a,
|
||||
};
|
||||
}
|
||||
// 允许价格为 0,但不能把缺失值或空串转换成免费报价。
|
||||
function n(e) {
|
||||
if (
|
||||
e == null ||
|
||||
@@ -50,6 +53,7 @@ function n(e) {
|
||||
throw Error(`未获得有效报价,请重试`);
|
||||
return String(e);
|
||||
}
|
||||
// 未取得明确订单号时阻止进入支付;提示先核对订单,避免用户重复下单。
|
||||
function r(e) {
|
||||
if (
|
||||
(typeof e != `string` && typeof e != `number`) ||
|
||||
@@ -58,6 +62,7 @@ function r(e) {
|
||||
throw Error(`订单编号未返回,请先在订单管理中检查,避免重复下单`);
|
||||
return e;
|
||||
}
|
||||
/** web 转发只提交域名/内部端口;其他转发使用协议码,null 外部端口表示由后端分配。 */
|
||||
function i(e, t) {
|
||||
if (!Number.isInteger(t.int_port) || t.int_port < 1 || t.int_port > 65535)
|
||||
throw Error(`内部端口应为 1–65535 的整数`);
|
||||
@@ -95,6 +100,7 @@ function i(e, t) {
|
||||
}),
|
||||
};
|
||||
}
|
||||
/** VPC 名称必填;网段可留空由后端处理,填写时须满足 IPv4 CIDR 及允许掩码。 */
|
||||
function a(e, t, n = []) {
|
||||
if (!e.trim()) throw Error(`请输入 VPC 名称`);
|
||||
if (!t.trim())
|
||||
@@ -117,6 +123,7 @@ function a(e, t, n = []) {
|
||||
ips: t.trim(),
|
||||
};
|
||||
}
|
||||
// 将磁盘档位转换为可选范围,并向内对齐步长;无合法容量区间的档位不展示。
|
||||
function o(e, t = {}) {
|
||||
return e.flatMap((e, n) => {
|
||||
let r = e.type === `step` || e.type === `total`,
|
||||
@@ -151,6 +158,7 @@ function o(e, t = {}) {
|
||||
];
|
||||
});
|
||||
}
|
||||
// 同时检查整数、上下界和步长;浮点容差仅用于除法误差,不放宽容量边界。
|
||||
function s(e, t) {
|
||||
return (
|
||||
Number.isInteger(e) &&
|
||||
|
||||
Reference in new issue
Block a user