mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-07 02:06:38 +08:00
feat: 支持编辑隧道入口/出口/转发链配置
- 后端: TunnelUpdateDto 添加 inNodeId, chainNodes, outNodeId 字段 - 后端: TunnelServiceImpl 重写 updateTunnel() 支持节点配置更新 - 后端: 添加自动回滚机制,更新失败时恢复原配置 - 前端: tunnel.tsx 解除编辑模式下的字段禁用限制 - 前端: 保留隧道类型不可修改(端口转发/隧道转发)
This commit is contained in:
@@ -693,7 +693,7 @@ export default function TunnelPage() {
|
||||
{isEdit ? '编辑隧道' : '新增隧道'}
|
||||
</h2>
|
||||
<p className="text-small text-default-500">
|
||||
{isEdit ? '编辑时只能修改隧道名称、流量计算和流量倍率' : '创建新的隧道配置'}
|
||||
{isEdit ? '修改节点配置会中断现有连接,隧道类型不可修改' : '创建新的隧道配置'}
|
||||
</p>
|
||||
</ModalHeader>
|
||||
<ModalBody>
|
||||
@@ -803,11 +803,10 @@ export default function TunnelPage() {
|
||||
});
|
||||
setForm(prev => ({ ...prev, inNodeId: newInNodeId }));
|
||||
}}
|
||||
isInvalid={!!errors.inNodeId}
|
||||
errorMessage={errors.inNodeId}
|
||||
variant="bordered"
|
||||
isDisabled={isEdit}
|
||||
>
|
||||
isInvalid={!!errors.inNodeId}
|
||||
errorMessage={errors.inNodeId}
|
||||
variant="bordered"
|
||||
>
|
||||
{nodes.map((node) => (
|
||||
<SelectItem
|
||||
key={node.id}
|
||||
@@ -860,7 +859,6 @@ export default function TunnelPage() {
|
||||
]
|
||||
}));
|
||||
}}
|
||||
isDisabled={isEdit}
|
||||
startContent={
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />
|
||||
@@ -889,7 +887,6 @@ export default function TunnelPage() {
|
||||
variant="light"
|
||||
isIconOnly
|
||||
onPress={() => removeChainNode(groupIndex)}
|
||||
isDisabled={isEdit}
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
|
||||
@@ -932,7 +929,6 @@ export default function TunnelPage() {
|
||||
}}
|
||||
variant="bordered"
|
||||
size="sm"
|
||||
isDisabled={isEdit}
|
||||
classNames={{
|
||||
label: "text-xs",
|
||||
value: "text-sm"
|
||||
@@ -991,7 +987,6 @@ export default function TunnelPage() {
|
||||
}}
|
||||
variant="bordered"
|
||||
size="sm"
|
||||
isDisabled={isEdit}
|
||||
classNames={{
|
||||
label: "text-xs",
|
||||
value: "text-sm"
|
||||
@@ -1018,7 +1013,6 @@ export default function TunnelPage() {
|
||||
}}
|
||||
variant="bordered"
|
||||
size="sm"
|
||||
isDisabled={isEdit}
|
||||
classNames={{
|
||||
label: "text-xs",
|
||||
value: "text-sm"
|
||||
@@ -1083,7 +1077,6 @@ export default function TunnelPage() {
|
||||
isInvalid={!!errors.outNodeId}
|
||||
errorMessage={errors.outNodeId}
|
||||
variant="bordered"
|
||||
isDisabled={isEdit}
|
||||
classNames={{
|
||||
label: "text-xs",
|
||||
value: "text-sm"
|
||||
@@ -1154,7 +1147,6 @@ export default function TunnelPage() {
|
||||
isInvalid={!!errors.protocol}
|
||||
errorMessage={errors.protocol}
|
||||
variant="bordered"
|
||||
isDisabled={isEdit}
|
||||
classNames={{
|
||||
label: "text-xs",
|
||||
value: "text-sm"
|
||||
@@ -1197,7 +1189,6 @@ export default function TunnelPage() {
|
||||
}
|
||||
}}
|
||||
variant="bordered"
|
||||
isDisabled={isEdit}
|
||||
classNames={{
|
||||
label: "text-xs",
|
||||
value: "text-sm"
|
||||
|
||||
Reference in New Issue
Block a user