mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
Merge branch 'feat/preferred-port-design' of github.com:Start9Labs/start-os into sdk-comments
This commit is contained in:
@@ -204,11 +204,7 @@ impl BindInfo {
|
||||
enabled: true,
|
||||
options,
|
||||
net: lan,
|
||||
addresses: DerivedAddressInfo {
|
||||
enabled: addresses.enabled,
|
||||
disabled: addresses.disabled,
|
||||
available: BTreeSet::new(),
|
||||
},
|
||||
addresses,
|
||||
})
|
||||
}
|
||||
pub fn disable(&mut self) {
|
||||
|
||||
@@ -92,15 +92,10 @@ impl Model<Host> {
|
||||
for (_, bind) in this.bindings.as_entries_mut()? {
|
||||
let net = bind.as_net().de()?;
|
||||
let opt = bind.as_options().de()?;
|
||||
|
||||
// Preserve existing plugin-provided addresses across recomputation
|
||||
let plugin_addrs: BTreeSet<HostnameInfo> = bind
|
||||
.as_addresses()
|
||||
.as_available()
|
||||
.de()?
|
||||
.into_iter()
|
||||
.filter(|h| matches!(h.metadata, HostnameMetadata::Plugin { .. }))
|
||||
.collect();
|
||||
let mut available = BTreeSet::new();
|
||||
let mut available = bind.as_addresses().as_available().de()?;
|
||||
available.retain(|h| matches!(h.metadata, HostnameMetadata::Plugin { .. }));
|
||||
for (gid, g) in gateways {
|
||||
let Some(ip_info) = &g.ip_info else {
|
||||
continue;
|
||||
@@ -290,7 +285,6 @@ impl Model<Host> {
|
||||
});
|
||||
}
|
||||
}
|
||||
available.extend(plugin_addrs);
|
||||
bind.as_addresses_mut().as_available_mut().ser(&available)?;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,11 @@ import { inject, Injectable } from '@angular/core'
|
||||
import { PatchDB } from 'patch-db-client'
|
||||
import {
|
||||
BehaviorSubject,
|
||||
distinctUntilChanged,
|
||||
map,
|
||||
combineLatest,
|
||||
distinctUntilChanged,
|
||||
firstValueFrom,
|
||||
map,
|
||||
shareReplay,
|
||||
} from 'rxjs'
|
||||
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
||||
import { getServerInfo } from 'src/app/utils/get-server-info'
|
||||
@@ -22,17 +23,19 @@ export class OSService {
|
||||
osUpdate?: T.OsVersionInfoMap
|
||||
readonly updateAvailable$ = new BehaviorSubject<boolean>(false)
|
||||
|
||||
readonly updating$ = this.patch.watch$('serverInfo', 'statusInfo').pipe(
|
||||
private readonly statusInfo$ = this.patch
|
||||
.watch$('serverInfo', 'statusInfo')
|
||||
.pipe(shareReplay({ bufferSize: 1, refCount: true }))
|
||||
|
||||
readonly updating$ = this.statusInfo$.pipe(
|
||||
map(status => status.updateProgress ?? status.updated),
|
||||
distinctUntilChanged(),
|
||||
)
|
||||
|
||||
readonly backingUp$ = this.patch
|
||||
.watch$('serverInfo', 'statusInfo', 'backupProgress')
|
||||
.pipe(
|
||||
map(obj => !!obj),
|
||||
distinctUntilChanged(),
|
||||
)
|
||||
readonly backingUp$ = this.statusInfo$.pipe(
|
||||
map(status => !!status.backupProgress),
|
||||
distinctUntilChanged(),
|
||||
)
|
||||
|
||||
readonly updatingOrBackingUp$ = combineLatest([
|
||||
this.updating$,
|
||||
|
||||
Reference in New Issue
Block a user