mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-06 02:17:14 +00:00
fix(frontend): give AmneziaWG the same UDP tag and its own tag color
The Inbounds list only special-cased isWireguard/isHysteria for the "UDP" network badge, so an AmneziaWG row showed just the bare protocol tag with no transport badge next to it. Added the missing isAmneziawg flag (mirrors isWireguard exactly) and wired it into the same branch. Client-row protocol-color maps in ClientsPage/HostList had no amneziawg entry, silently falling back to grey -- ClientInfoModal already had amneziawg: 'yellow' from earlier work, these two just never got it.
This commit is contained in:
@@ -163,6 +163,10 @@ export class DBInbound {
|
||||
return this.protocol === Protocols.WIREGUARD;
|
||||
}
|
||||
|
||||
get isAmneziawg() {
|
||||
return this.protocol === Protocols.AMNEZIAWG;
|
||||
}
|
||||
|
||||
get isHysteria() {
|
||||
return this.protocol === Protocols.HYSTERIA;
|
||||
}
|
||||
|
||||
@@ -142,6 +142,7 @@ const INBOUND_PROTOCOL_COLORS: Record<string, string> = {
|
||||
hysteria: 'cyan',
|
||||
hysteria2: 'green',
|
||||
wireguard: 'gold',
|
||||
amneziawg: 'yellow',
|
||||
http: 'purple',
|
||||
mixed: 'lime',
|
||||
tunnel: 'orange',
|
||||
|
||||
@@ -39,6 +39,7 @@ const INBOUND_PROTOCOL_COLORS: Record<string, string> = {
|
||||
hysteria: 'cyan',
|
||||
hysteria2: 'green',
|
||||
wireguard: 'gold',
|
||||
amneziawg: 'yellow',
|
||||
http: 'purple',
|
||||
mixed: 'lime',
|
||||
tunnel: 'orange',
|
||||
|
||||
@@ -15,6 +15,7 @@ export type ProtocolFlags = {
|
||||
isMixed?: boolean;
|
||||
isHTTP?: boolean;
|
||||
isWireguard?: boolean;
|
||||
isAmneziawg?: boolean;
|
||||
isTunnel?: boolean;
|
||||
};
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ export function useInboundColumns({
|
||||
sorter: (a, b) => compareText(a.protocol, b.protocol),
|
||||
render: (_, record) => {
|
||||
const tags: ReactElement[] = [<Tag key="p" color="purple">{record.protocol}</Tag>];
|
||||
if (record.isWireguard || record.isHysteria) {
|
||||
if (record.isWireguard || record.isAmneziawg || record.isHysteria) {
|
||||
tags.push(<Tag key="n" color="green">UDP</Tag>);
|
||||
} else if (record.isSS) {
|
||||
const stream = readStreamHints(record.streamSettings);
|
||||
|
||||
Reference in New Issue
Block a user