fix(routing): write lowercase L4 network to xray config, display uppercase in UI

This commit is contained in:
MHSanaei
2026-06-27 11:15:13 +02:00
parent 7a2179535a
commit 535b89a352
3 changed files with 3 additions and 3 deletions
@@ -55,7 +55,7 @@ const initialForm = (): FormState => ({
balancerTag: '',
});
const NETWORKS = ['', 'TCP', 'UDP', 'TCP,UDP'];
const NETWORKS = ['', 'tcp', 'udp', 'tcp,udp'];
const PROTOCOLS = ['http', 'tls', 'bittorrent', 'quic'];
function csv(value: string): string[] {
+1 -1
View File
@@ -83,7 +83,7 @@ export function ruleCriteriaChips(rule: RuleRow) {
if (rule.port) chips.push({ label: 'Port', value: rule.port });
if (rule.sourceIP) chips.push({ label: 'Src IP', value: rule.sourceIP });
if (rule.sourcePort) chips.push({ label: 'Src Port', value: rule.sourcePort });
if (rule.network) chips.push({ label: 'L4', value: rule.network });
if (rule.network) chips.push({ label: 'L4', value: rule.network.toUpperCase() });
if (rule.protocol) chips.push({ label: 'Protocol', value: rule.protocol });
if (rule.user) chips.push({ label: 'User', value: rule.user });
if (rule.vlessRoute) chips.push({ label: 'VLESS', value: rule.vlessRoute });
@@ -133,7 +133,7 @@ export function useRoutingColumns({
key: 'network',
render: (_v, record) => (
<div className="criterion-flow">
{record.network && <CriterionRow label="L4" value={record.network} title={`L4: ${record.network}`} />}
{record.network && <CriterionRow label="L4" value={record.network.toUpperCase()} title={`L4: ${record.network.toUpperCase()}`} />}
{record.protocol && <CriterionRow label="Protocol" value={record.protocol} title={`Protocol: ${record.protocol}`} />}
{record.attrs && <CriterionRow label="Attrs" value={record.attrs} title={`Attrs: ${record.attrs}`} />}
{!record.network && !record.protocol && !record.attrs && <span className="criterion-empty"></span>}