mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-12-04 05:00:05 +08:00
refactor(proxy): collect provider snapshots in display order
This commit is contained in:
@@ -7,7 +7,7 @@ pub struct ProxyViewInput {
|
||||
pub runtime_group_order: Vec<String>,
|
||||
pub group_scopes: BTreeMap<String, GroupScope>,
|
||||
pub proxies: HashMap<String, ProxySnapshot>,
|
||||
pub providers: Option<HashMap<String, ProviderSnapshot>>,
|
||||
pub providers: Option<BTreeMap<String, ProviderSnapshot>>,
|
||||
}
|
||||
|
||||
pub struct ProxySnapshot {
|
||||
@@ -352,14 +352,13 @@ fn build_core_records(
|
||||
}
|
||||
|
||||
fn build_provider_records(
|
||||
providers: Option<HashMap<String, ProviderSnapshot>>,
|
||||
providers: Option<BTreeMap<String, ProviderSnapshot>>,
|
||||
records: &mut BTreeMap<String, ProxyNodeView>,
|
||||
) -> (Vec<ProxyProviderView>, ProviderCandidates) {
|
||||
let providers = providers.map_or_default(|providers| providers.into_iter().collect::<BTreeMap<_, _>>());
|
||||
let mut views = Vec::new();
|
||||
let mut candidates = BTreeMap::new();
|
||||
|
||||
for (provider_name, provider) in providers {
|
||||
for (provider_name, provider) in providers.into_iter().flatten() {
|
||||
let ProviderSnapshot {
|
||||
vehicle_type,
|
||||
proxies,
|
||||
|
||||
Reference in New Issue
Block a user