mirror of
https://github.com/woodchen-ink/clash-and-dashboard.git
synced 2025-07-18 14:01:56 +08:00
Feat: support load-balance
This commit is contained in:
parent
bf6299a79d
commit
78053e77cf
@ -23,7 +23,7 @@
|
|||||||
display: block;
|
display: block;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
width: 80px;
|
width: 100px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-color: $color-primary-dark;
|
background-color: $color-primary-dark;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
@ -29,7 +29,6 @@ export interface ShadowsocksProxy {
|
|||||||
obfs?: string
|
obfs?: string
|
||||||
|
|
||||||
'obfs-host'?: string
|
'obfs-host'?: string
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const VmessProxyConfigList = [
|
export const VmessProxyConfigList = [
|
||||||
@ -51,7 +50,6 @@ export interface VmessProxy {
|
|||||||
cipher?: string
|
cipher?: string
|
||||||
|
|
||||||
tls?: boolean
|
tls?: boolean
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Socks5ProxyConfigList = ['name', 'type', 'server', 'port']
|
export const Socks5ProxyConfigList = ['name', 'type', 'server', 'port']
|
||||||
@ -63,10 +61,9 @@ export interface Socks5Proxy {
|
|||||||
server?: string
|
server?: string
|
||||||
|
|
||||||
port?: number
|
port?: number
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProxyGroup = SelectProxyGroup & UrlTestProxyGroup & FallbackProxyGroup
|
export type ProxyGroup = SelectProxyGroup & UrlTestProxyGroup & FallbackProxyGroup & LoadBalanceGroup
|
||||||
|
|
||||||
export interface SelectProxyGroup {
|
export interface SelectProxyGroup {
|
||||||
name?: string
|
name?: string
|
||||||
@ -74,7 +71,14 @@ export interface SelectProxyGroup {
|
|||||||
type?: 'select'
|
type?: 'select'
|
||||||
|
|
||||||
proxies?: string[] // proxy names
|
proxies?: string[] // proxy names
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LoadBalanceGroup {
|
||||||
|
name?: string
|
||||||
|
|
||||||
|
type?: 'load-balance'
|
||||||
|
|
||||||
|
proxies?: string[] // proxy names
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FallbackProxyGroup {
|
export interface FallbackProxyGroup {
|
||||||
@ -87,7 +91,6 @@ export interface FallbackProxyGroup {
|
|||||||
url?: string
|
url?: string
|
||||||
|
|
||||||
interval?: number // second
|
interval?: number // second
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UrlTestProxyGroup {
|
export interface UrlTestProxyGroup {
|
||||||
@ -100,5 +103,4 @@ export interface UrlTestProxyGroup {
|
|||||||
url?: string
|
url?: string
|
||||||
|
|
||||||
interval?: number // second
|
interval?: number // second
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ export class ConfigStore {
|
|||||||
allowLan: general['allow-lan']
|
allowLan: general['allow-lan']
|
||||||
}
|
}
|
||||||
|
|
||||||
const policyGroup = new Set(['Selector', 'URLTest', 'Fallback'])
|
const policyGroup = new Set(['Selector', 'URLTest', 'Fallback', 'LoadBalance'])
|
||||||
const unUsedProxy = new Set(['DIRECT', 'REJECT', 'GLOBAL'])
|
const unUsedProxy = new Set(['DIRECT', 'REJECT', 'GLOBAL'])
|
||||||
const proxies = Object.keys(rawProxies.data.proxies)
|
const proxies = Object.keys(rawProxies.data.proxies)
|
||||||
.filter(key => !unUsedProxy.has(key))
|
.filter(key => !unUsedProxy.has(key))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user