Bugfix/040 UI (#2881)

* fix sideload and install flow

* move updates chevron inside upddate button

* update dictionaries to include langauge names

* fix: address todos (#2880)

* fix: address todos

* fix enlgish translation

---------

Co-authored-by: Matt Hill <mattnine@protonmail.com>

* use existing translation, no need to duplicate

* fix: update dialog and other fixes (#2882)

---------

Co-authored-by: Alex Inkin <alexander@inkin.ru>
Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
Matt Hill
2025-04-21 10:57:12 -06:00
committed by GitHub
parent b1621f6b34
commit 27272680a2
59 changed files with 515 additions and 510 deletions

View File

@@ -1850,6 +1850,11 @@ export namespace Mock {
listitems: ['192.168.1.1', '192.1681.23'],
name: 'Matt',
},
other: {
external: {
'public-domain': 'test.com',
},
},
},
port: 20,
rpcallowip: undefined,

View File

@@ -1058,11 +1058,11 @@ export class MockApiService extends ApiService {
...Mock.LocalPkgs[params.id]!,
stateInfo: {
// if installing
// state: 'installing',
state: 'installing',
// if updating
state: 'updating',
manifest: mockPatchData.packageData[params.id]?.stateInfo.manifest!,
// state: 'updating',
// manifest: mockPatchData.packageData[params.id]?.stateInfo.manifest!,
// both
installingInfo: {

View File

@@ -14,7 +14,7 @@ import {
switchMap,
} from 'rxjs'
import { ConnectionService } from 'src/app/services/connection.service'
import { EOSService } from 'src/app/services/eos.service'
import { OSService } from 'src/app/services/os.service'
import { MarketplaceService } from 'src/app/services/marketplace.service'
import { NotificationService } from 'src/app/services/notification.service'
import { DataModel } from 'src/app/services/patch-db/data-model'
@@ -27,7 +27,7 @@ export class BadgeService {
private readonly notifications = inject(NotificationService)
private readonly exver = inject(Exver)
private readonly patch = inject<PatchDB<DataModel>>(PatchDB)
private readonly system$ = inject(EOSService).updateAvailable$.pipe(
private readonly system$ = inject(OSService).updateAvailable$.pipe(
map(Number),
)
private readonly metrics$ = this.patch

View File

@@ -73,7 +73,7 @@ export class FormService {
UntypedFormGroup | UntypedFormArray | UntypedFormControl
> = {}
Object.entries(config).map(([key, spec]) => {
group[key] = this.getFormEntry(spec, current ? current[key] : undefined)
group[key] = this.getFormEntry(spec, current?.[key])
})
return this.formBuilder.group(group, { validators })
}

View File

@@ -194,7 +194,7 @@ export class MarketplaceService {
)
}
getStatic$(
fetchStatic$(
pkg: MarketplacePkg,
type: 'LICENSE.md' | 'instructions.md',
): Observable<string> {

View File

@@ -10,7 +10,7 @@ import { Version } from '@start9labs/start-sdk'
@Injectable({
providedIn: 'root',
})
export class EOSService {
export class OSService {
osUpdate?: OSUpdate
updateAvailable$ = new BehaviorSubject<boolean>(false)
@@ -45,7 +45,7 @@ export class EOSService {
private readonly patch: PatchDB<DataModel>,
) {}
async loadEos(): Promise<void> {
async loadOS(): Promise<void> {
const { version, id } = await getServerInfo(this.patch)
this.osUpdate = await this.api.checkOSUpdate({ serverId: id })
const updateAvailable =

View File

@@ -1,41 +1,33 @@
import { Injectable } from '@angular/core'
import { inject, Injectable } from '@angular/core'
import { Observable } from 'rxjs'
import { filter, map, share, switchMap } from 'rxjs/operators'
import { PatchDB } from 'patch-db-client'
import { DataModel } from 'src/app/services/patch-db/data-model'
import { EOSService } from 'src/app/services/eos.service'
import { OSService } from 'src/app/services/os.service'
import { ConnectionService } from 'src/app/services/connection.service'
import { LocalStorageBootstrap } from './patch-db/local-storage-bootstrap'
// @TODO Alex this file has just become checking for StartOS updates. Maybe it can be removed/simplified. I'm not sure why getMarketplace$() line is commented out, I assume we are checking for service updates somewhere else?
@Injectable({
providedIn: 'root',
})
export class PatchDataService extends Observable<void> {
private readonly stream$ = this.connection$.pipe(
private readonly patch: PatchDB<DataModel> = inject(PatchDB)
private readonly os = inject(OSService)
private readonly bootstrapper = inject(LocalStorageBootstrap)
private readonly stream$ = inject(ConnectionService).pipe(
filter(Boolean),
switchMap(() => this.patch.watch$()),
map((cache, index) => {
this.bootstrapper.update(cache)
if (index === 0) {
this.checkForUpdates()
this.os.loadOS()
}
}),
share(),
)
constructor(
private readonly patch: PatchDB<DataModel>,
private readonly eosService: EOSService,
private readonly connection$: ConnectionService,
private readonly bootstrapper: LocalStorageBootstrap,
) {
constructor() {
super(subscriber => this.stream$.subscribe(subscriber))
}
private checkForUpdates(): void {
this.eosService.loadEos()
// this.marketplaceService.getMarketplace$().pipe(take(1)).subscribe()
}
}

View File

@@ -26,7 +26,7 @@ export const STATUS = new InjectionToken('', {
return CONNECTED
}),
),
{ initialValue: CONNECTED },
{ initialValue: CONNECTING },
),
})