9a5de83fee
CI / docker (push) Successful in 1m36s
Go + Vue 管理台:Agent 隧道、域名反代、IP 安全、访客验证与监控大盘。 Gitea Actions CI 多架构镜像;纯 Go SQLite、无 CGO Docker 构建。 Co-authored-by: Cursor <cursoragent@cursor.com>
20 lines
617 B
JavaScript
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`)
|
|
}
|