去除代理头支持, 增加节点面板通信加密 增加导出sql

This commit is contained in:
qaq
2025-07-11 16:24:12 +08:00
parent b690e68951
commit e313a1953c
21 changed files with 960 additions and 143 deletions
+6 -24
View File
@@ -33,7 +33,6 @@ interface Forward {
inPort: number;
remoteAddr: string;
strategy: string;
proxyProtocol: number; // 添加 proxy_protocol 字段
status: number;
inFlow: number;
outFlow: number;
@@ -58,7 +57,6 @@ interface ForwardForm {
inPort: number | null;
remoteAddr: string;
strategy: string;
proxyProtocol: boolean; // 在表单中使用 boolean 类型更方便
}
interface AddressItem {
@@ -108,8 +106,7 @@ export default function ForwardPage() {
tunnelId: null,
inPort: null,
remoteAddr: '',
strategy: 'fifo',
proxyProtocol: false // 新增 proxyProtocol 字段
strategy: 'fifo'
});
// 表单验证错误
@@ -205,8 +202,7 @@ export default function ForwardPage() {
tunnelId: null,
inPort: null,
remoteAddr: '',
strategy: 'fifo',
proxyProtocol: false
strategy: 'fifo'
});
setSelectedTunnel(null);
setErrors({});
@@ -223,8 +219,7 @@ export default function ForwardPage() {
tunnelId: forward.tunnelId,
inPort: forward.inPort,
remoteAddr: forward.remoteAddr.split(',').join('\n'),
strategy: forward.strategy || 'fifo',
proxyProtocol: forward.proxyProtocol === 1 // 编辑时需要将数字转换为 boolean
strategy: forward.strategy || 'fifo'
});
const tunnel = tunnels.find(t => t.id === forward.tunnelId);
setSelectedTunnel(tunnel || null);
@@ -302,8 +297,7 @@ export default function ForwardPage() {
tunnelId: form.tunnelId,
inPort: form.inPort,
remoteAddr: processedRemoteAddr,
strategy: addressCount > 1 ? form.strategy : 'fifo',
proxyProtocol: form.proxyProtocol ? 1 : 0 // 提交时需要将 boolean 转换为数字
strategy: addressCount > 1 ? form.strategy : 'fifo'
};
res = await updateForward(updateData);
} else {
@@ -313,8 +307,7 @@ export default function ForwardPage() {
tunnelId: form.tunnelId,
inPort: form.inPort,
remoteAddr: processedRemoteAddr,
strategy: addressCount > 1 ? form.strategy : 'fifo',
proxyProtocol: form.proxyProtocol ? 1 : 0 // 创建时需要将 boolean 转换为数字
strategy: addressCount > 1 ? form.strategy : 'fifo'
};
res = await createForward(createData);
}
@@ -909,18 +902,7 @@ export default function ForwardPage() {
</Select>
)}
<div className="flex flex-col gap-2">
<div className="flex items-center justify-between">
<div className="flex flex-col">
<span className="text-sm font-medium text-foreground">启用PROXY Protocol</span>
<span className="text-xs text-default-500">不知道干嘛的就别动</span>
</div>
<Switch
isSelected={form.proxyProtocol}
onValueChange={(checked) => setForm(prev => ({ ...prev, proxyProtocol: checked }))}
/>
</div>
</div>
</div>
</ModalBody>
<ModalFooter>