Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/content/config/nodes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ token 只在后台。

续费设置里填价格、货币、付款周期和到期时间。价格留空或填 0 显示为免费。

- 货币填三个字母的代码,如 USD、CNY、HKD、TWD,输入框下方会显示对应的中文名供核对;认不出的代码提示
「未知代码」,照样能保存
- 付款周期填几个月或几年,如 18 个月、5 年,最长 100 年;只付一次的选「一次性」

在线节点过了到期日会自动续期:hub 把到期日按付款周期往后顺延,直到晚于今天,并推送一条「已自动续期」
通知。

Expand Down
27 changes: 27 additions & 0 deletions src/content/dev/theme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,33 @@ const days = node.expires_in !== undefined
: daysUntil(node.expires_at)
```

## 价格与付款周期

`currency` 是三个大写字母的货币代码,可以直接交给 `Intl.NumberFormat`。hub 只检查格式,不核对代码是否
真的存在;`Intl` 遇到不认识的代码会把代码本身当作符号显示。

`billing_cycle` 是付款周期:

| 值 | 含义 |
|---|---|
| `monthly` `quarterly` `semiannual` `yearly` `biennial` `triennial` | 1、3、6、12、24、36 个月 |
| `<n>m` | 其余长度,`n` 是月数,1–1200,比如 `60m` 是五年 |
| `once` | 一次性,不续期 |

有名字的长度只会以名字出现,不会出现 `12m`。hub 1.3.0 及更早只有带名字的七个值。

```ts
// 月数;once 是 0,不认识的是 NaN
function months(cycle: string): number {
const named: Record<string, number> = {
monthly: 1, quarterly: 3, semiannual: 6,
yearly: 12, biennial: 24, triennial: 36,
}
if (cycle === "once") return 0
return named[cycle] ?? Number(/^(\d+)m$/.exec(cycle)?.[1])
}
```

## 节点分组

`/api/nodes` 和 `/api/ws` 推送的快照里,每个节点带一个 `group`:站长在面板上设的分组名,公开可读,
Expand Down
4 changes: 2 additions & 2 deletions src/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const nav: Section[] = [
title: "配置",
items: [
{ path: "/config/auth", label: "登录与安全", desc: "应急密码与 GitHub 单点登录的配置,以及登录不通时的排查。", keywords: "github oauth sso 登录 密码 应急 重置 白名单 callback 会话" },
{ path: "/config/nodes", label: "节点", desc: "节点的各项设置、地址与国家的来源、到期与自动续期,以及分组。", keywords: "节点 编辑 公开 隐藏 备注 分组 group 改名 解散 排序 地址 ip 国家 地区 到期 续期 续费 付款周期 价格" },
{ path: "/config/nodes", label: "节点", desc: "节点的各项设置、地址与国家的来源、到期与自动续期,以及分组。", keywords: "节点 编辑 公开 隐藏 备注 分组 group 改名 解散 排序 地址 ip 国家 地区 到期 续期 续费 付款周期 价格 货币 currency" },
{ path: "/config/ping", label: "延迟监控", desc: "让节点定时 TCP 连接一个目标,在公开页画出延迟和丢包。", keywords: "延迟 ping tcping 丢包 探测 监控 目标 latency" },
{ path: "/config/traffic", label: "流量统计", desc: "三个流量数字的算法、统计哪些网卡、月度周期与配额口径。", keywords: "流量 traffic 重置日 月流量 计费 sum max 上行 下行 配额 网卡 iface 校正" },
{ path: "/config/notify", label: "通知", desc: "Telegram 与 Webhook 推送掉线、流量、到期和登录,以及常见服务的请求体写法。", keywords: "通知 告警 telegram tg bot webhook discord slack 钉钉 企业微信 飞书 bark ntfy gotify 离线 掉线 到期" },
Expand All @@ -40,7 +40,7 @@ export const nav: Section[] = [
{
title: "开发指南",
items: [
{ path: "/dev/theme", label: "主题开发", desc: "主题包格式、可用的接口、到期天数、分组、主题设置、要处理的状态与本地开发。", keywords: "主题 theme theme.json dist 接口 nodes metrics 分组 group config 设置 到期 expires_in 开发 上传 切换" },
{ path: "/dev/theme", label: "主题开发", desc: "主题包格式、可用的接口、到期天数、价格与付款周期、分组、主题设置、要处理的状态与本地开发。", keywords: "主题 theme theme.json dist 接口 nodes metrics 分组 group config 设置 到期 expires_in 价格 货币 currency 付款周期 billing_cycle 开发 上传 切换" },
{ path: "/dev/architecture", label: "架构与协议", desc: "仓库分工、线上协议、请求路径与八张数据表。", keywords: "架构 architecture 协议 json-rpc websocket 数据表 schema 路由" },
],
},
Expand Down
Loading