mirror of
https://github.com/woodchen-ink/clash-and-dashboard.git
synced 2025-07-18 14:01:56 +08:00
Improve: display rule set payload
This commit is contained in:
parent
ab602f794e
commit
3acae645af
@ -8,6 +8,7 @@ import { StreamReader } from '@lib/streamer'
|
||||
import { useObject, useVisible } from '@lib/hook'
|
||||
import { noop } from '@lib/helper'
|
||||
import { fromNow } from '@lib/date'
|
||||
import { RuleType } from '@models'
|
||||
import { useConnections } from './store'
|
||||
import './style.scss'
|
||||
|
||||
@ -111,7 +112,7 @@ export default function Connections () {
|
||||
id: c.id,
|
||||
host: `${c.metadata.host || c.metadata.destinationIP}:${c.metadata.destinationPort}`,
|
||||
chains: c.chains.slice().reverse().join(' --> '),
|
||||
rule: c.rule,
|
||||
rule: c.rule === RuleType.RuleSet ? `${c.rule}(${c.rulePayload})` : c.rule,
|
||||
time: fromNow(new Date(c.start), lang),
|
||||
upload: formatTraffic(c.upload),
|
||||
download: formatTraffic(c.download),
|
||||
|
@ -94,6 +94,7 @@ export interface Connections {
|
||||
start: string
|
||||
chains: string[]
|
||||
rule: string
|
||||
rulePayload: string
|
||||
}
|
||||
|
||||
export async function getExternalControllerConfig () {
|
||||
|
@ -9,11 +9,14 @@ export interface Rule {
|
||||
}
|
||||
|
||||
export enum RuleType {
|
||||
'DOMAIN' = 'DOMAIN',
|
||||
'DOMAIN-SUFFIX' = 'DOMAIN-SUFFIX',
|
||||
'DOMAIN-KEYWORD' = 'DOMAIN-KEYWORD',
|
||||
'GEOIP' = 'GEOIP',
|
||||
'FINAL' = 'FINAL',
|
||||
'IP-CIDR' = 'IP-CIDR',
|
||||
'USER-AGENT' = 'USER-AGENT'
|
||||
Domain = 'Domain',
|
||||
DomainSuffix = 'DomainSuffix',
|
||||
DomainKeyword = 'DomainKeyword',
|
||||
GeoIP = 'GeoIP',
|
||||
IPCIDR = 'IPCIDR',
|
||||
SrcIPCIDR = 'SrcIPCIDR',
|
||||
SrcPort = 'SrcPort',
|
||||
DstPort = 'DstPort',
|
||||
MATCH = 'MATCH',
|
||||
RuleSet = 'RuleSet'
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user