Files
Wormhole/web/src/utils/ipForward.js
T
rose_cat707 9a5de83fee
CI / docker (push) Successful in 1m36s
feat: Wormhole 内网穿透与反向代理网关
Go + Vue 管理台:Agent 隧道、域名反代、IP 安全、访客验证与监控大盘。
Gitea Actions CI 多架构镜像;纯 Go SQLite、无 CGO Docker 构建。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 17:44:54 +08:00

20 lines
617 B
JavaScript

/** @param {string} mode */
export function normalizeIPForwardMode(mode) {
if (mode === 'append' || mode === 'replace') return mode
if (mode === 'proxy') return 'append'
if (mode === 'real') return 'replace'
return 'replace'
}
/** @param {string} mode @param {(key: string) => string} t */
export function ipForwardModeLabel(mode, t) {
const key = normalizeIPForwardMode(mode)
return t(`ipForward.${key}.label`)
}
/** @param {string} mode @param {(key: string) => string} t */
export function ipForwardModeHint(mode, t) {
const key = normalizeIPForwardMode(mode)
return t(`ipForward.${key}.hint`)
}