Merge pull request 'feat(network-exits): 表单与详情字段改名(认证/出口IP/出口地区)' (#42) from feat/network-exit-label-rename into main
This commit is contained in:
@@ -51,7 +51,7 @@ function ExitCreateModal({ open, onClose, onSubmit, busy, error }) {
|
||||
<Button variant="primary" type="submit" form="exit-create-form" busy={busy} busyText="创建中…" disabled={!valid}>创建网络出口</Button>
|
||||
</>}>
|
||||
<form id="exit-create-form" onSubmit={submit} noValidate>
|
||||
{error ? <Alert variant="destructive" className="mb-4">{conflictMessage(error, '出口或凭据引用与现有资源冲突;表单内容已保留。')}</Alert> : null}
|
||||
{error ? <Alert variant="destructive" className="mb-4">{conflictMessage(error, '出口或认证引用与现有资源冲突;表单内容已保留。')}</Alert> : null}
|
||||
<div className="grid gap-4 sm:grid-cols-3">
|
||||
<Field id="exit-protocol" label="协议" required helper="代理协议">
|
||||
<Select id="exit-protocol" value={form.protocol} onChange={event => update('protocol', event.target.value)} options={protocolOptions} />
|
||||
@@ -62,13 +62,13 @@ function ExitCreateModal({ open, onClose, onSubmit, busy, error }) {
|
||||
<Field id="exit-port" label="端口" required helper="1..65535">
|
||||
<Input id="exit-port" type="number" min={1} max={65535} required value={form.port} onChange={event => update('port', event.target.value)} />
|
||||
</Field>
|
||||
<Field id="exit-credential" label="凭据引用 ID(可选)" helper="只填写已保存的引用,不填写认证秘密">
|
||||
<Field id="exit-credential" label="认证(可选)" helper="只填已保存的凭据引用 ID,不填认证秘密">
|
||||
<Input id="exit-credential" maxLength={128} value={form.credential_reference_id} onChange={event => update('credential_reference_id', event.target.value)} />
|
||||
</Field>
|
||||
<Field id="exit-ip" label="预期公网 IP(可选)" helper="用于健康检测比对">
|
||||
<Field id="exit-ip" label="出口IP(可选)" helper="健康检测时比对的预期公网 IP">
|
||||
<Input id="exit-ip" value={form.expected_public_ip} onChange={event => update('expected_public_ip', event.target.value)} />
|
||||
</Field>
|
||||
<Field id="exit-region" label="预期地区(可选)" helper="如 CN-Shanghai">
|
||||
<Field id="exit-region" label="出口地区(可选)" helper="如 CN-Shanghai">
|
||||
<Input id="exit-region" maxLength={64} value={form.expected_region} onChange={event => update('expected_region', event.target.value)} />
|
||||
</Field>
|
||||
</div>
|
||||
@@ -84,11 +84,11 @@ function ExitCard({ exit, boundAccounts, bindingsError, busy, onAction }) {
|
||||
<div className="flex min-w-0 items-start justify-between gap-3">
|
||||
<div className="min-w-0">
|
||||
<Link to={`/network-exits/${encodeURIComponent(exit.id)}`} className="anywhere font-semibold text-ink hover:text-primary">{exit.protocol}://{exit.host}:{exit.port}</Link>
|
||||
<p className="anywhere text-xs text-muted">{exit.id} · 凭据 {exit.credential_reference?.id || '无'}</p>
|
||||
<p className="anywhere text-xs text-muted">{exit.id} · 认证 {exit.credential_reference?.id || '无'}</p>
|
||||
</div>
|
||||
<ExitHealthPill exit={exit} />
|
||||
</div>
|
||||
<div className="text-sm"><span className="text-muted">观测公网 IP:</span><span className="anywhere">{exit.observed_public_ip || '尚无观测'}</span></div>
|
||||
<div className="text-sm"><span className="text-muted">出口IP:</span><span className="anywhere">{exit.observed_public_ip || '尚无观测'}</span></div>
|
||||
<p className="text-xs text-muted">最近检测:{exit.last_checked_at ? new Date(exit.last_checked_at).toLocaleString('zh-CN') : '未检测'}</p>
|
||||
<div className="text-sm">
|
||||
<span className="text-muted">绑定账号:</span>
|
||||
@@ -204,8 +204,8 @@ export function NetworkExitDetail() {
|
||||
<DetailList rows={[
|
||||
['ID', <span className="anywhere">{exit.id}</span>],
|
||||
['健康 / 版本', <span className="anywhere">{healthText[exit.health_status] ?? exit.health_status} · {exit.version}</span>],
|
||||
['凭据引用', <span className="anywhere">{exit.credential_reference?.id || '无'}</span>],
|
||||
['观测公网 IP', <span className="anywhere">{exit.observed_public_ip || '尚无观测'}</span>],
|
||||
['认证', <span className="anywhere">{exit.credential_reference?.id || '无'}</span>],
|
||||
['出口IP', <span className="anywhere">{exit.observed_public_ip || '尚无观测'}</span>],
|
||||
['最近检测', exit.last_checked_at ? new Date(exit.last_checked_at).toLocaleString('zh-CN') : '未检测'],
|
||||
]} />
|
||||
<div className="flex flex-wrap gap-3">
|
||||
|
||||
Reference in New Issue
Block a user