Feature/new registry (#2612)

* wip

* overhaul boot process

* wip: new registry

* wip

* wip

* wip

* wip

* wip

* wip

* os registry complete

* ui fixes

* fixes

* fixes

* more fixes

* fix merkle archive
This commit is contained in:
Aiden McClelland
2024-05-06 10:20:44 -06:00
committed by GitHub
parent 8a38666105
commit 9b14d714ca
167 changed files with 6297 additions and 3190 deletions

View File

@@ -5,16 +5,16 @@
>
<ion-list class="list">
<!-- show progress -->
<ng-container *ngIf="progress.size !== null; else calculating">
<ng-container *ngIf="!!progress.overall && progress.overall !== true && progress.overall.total; else calculating">
<ion-list-header>
<ion-label>
Downloading: {{ getProgress(progress.size, progress.downloaded) }}%
Downloading: {{ getProgress(progress.overall.total, progress.overall.done) }}%
</ion-label>
</ion-list-header>
<ion-progress-bar
class="progress"
color="secondary"
[value]="getProgress(progress.size, progress.downloaded) / 100"
[value]="getProgress(progress.overall.total, progress.overall.done) / 100"
></ion-progress-bar>
</ng-container>
<!-- show calculating -->

View File

@@ -8,7 +8,7 @@
<ion-progress-bar
[type]="
phase.progress === true ||
(phase.progress !== false && phase.progress.total)
(phase.progress !== false && phase.progress!== null && phase.progress.total)
? 'determinate'
: 'indeterminate'
"

View File

@@ -122,7 +122,7 @@ export class ToButtonsPipe implements PipeTransform {
private viewInMarketplaceButton(
pkg: PackageDataEntry<InstalledState>,
): Button {
const url = pkg.marketplaceUrl
const url = pkg.registry
const queryParams = url ? { url } : {}
let button: Button = {

View File

@@ -65,7 +65,7 @@ export class MarketplaceShowControlsComponent {
if (!this.localPkg) {
this.alertInstall(url)
} else {
const originalUrl = this.localPkg.marketplaceUrl
const originalUrl = this.localPkg.registry
if (!sameUrl(url, originalUrl)) {
const proceed = await this.presentAlertDifferentMarketplace(

View File

@@ -7,7 +7,8 @@ import { T } from '@start9labs/start-sdk'
export class InstallingProgressDisplayPipe implements PipeTransform {
transform(progress: T.Progress): string {
if (progress === true) return 'finalizing'
if (progress === false || !progress.total) return 'unknown %'
if (progress === false || progress === null || !progress.total)
return 'unknown %'
const percentage = Math.round((100 * progress.done) / progress.total)
return percentage < 99 ? String(percentage) + '%' : 'finalizing'
@@ -20,7 +21,7 @@ export class InstallingProgressDisplayPipe implements PipeTransform {
export class InstallingProgressPipe implements PipeTransform {
transform(progress: T.Progress): number | null {
if (progress === true) return 1
if (progress === false || !progress.total) return null
if (progress === false || progress === null || !progress.total) return null
return Number((progress.done / progress.total).toFixed(2))
}
}

View File

@@ -1633,7 +1633,7 @@ export module Mock {
currentDependencies: {},
hosts: {},
storeExposedDependents: [],
marketplaceUrl: 'https://registry.start9.com/',
registry: 'https://registry.start9.com/',
developerKey: 'developer-key',
}
@@ -1773,7 +1773,7 @@ export module Mock {
},
hosts: {},
storeExposedDependents: [],
marketplaceUrl: 'https://registry.start9.com/',
registry: 'https://registry.start9.com/',
developerKey: 'developer-key',
}
@@ -2024,7 +2024,7 @@ export module Mock {
},
hosts: {},
storeExposedDependents: [],
marketplaceUrl: 'https://registry.start9.com/',
registry: 'https://registry.start9.com/',
developerKey: 'developer-key',
}

View File

@@ -56,7 +56,7 @@ export module RR {
export type GetServerMetricsReq = {} // server.metrics
export type GetServerMetricsRes = Metrics
export type UpdateServerReq = { marketplaceUrl: string } // server.update
export type UpdateServerReq = { registry: string } // server.update
export type UpdateServerRes = 'updating' | 'no-updates'
export type RestartServerReq = {} // server.restart
@@ -192,7 +192,7 @@ export module RR {
id: string
versionSpec?: string
versionPriority?: 'min' | 'max'
marketplaceUrl: string
registry: string
} // package.install
export type InstallPackageRes = null

View File

@@ -30,7 +30,7 @@ export class LiveApiService extends ApiService {
private readonly patch: PatchDB<DataModel>,
) {
super()
; (window as any).rpcClient = this
;(window as any).rpcClient = this
}
// for getting static files: ex icons, instructions, licenses
@@ -158,7 +158,7 @@ export class LiveApiService extends ApiService {
async updateServer(url?: string): Promise<RR.UpdateServerRes> {
const params = {
marketplaceUrl: url || this.config.marketplace.start9,
registry: url || this.config.marketplace.start9,
}
return this.rpcRequest({ method: 'server.update', params })
}

View File

@@ -1017,7 +1017,11 @@ export class MockApiService extends ApiService {
const progress = JSON.parse(JSON.stringify(PROGRESS))
for (let [i, phase] of progress.phases.entries()) {
if (typeof phase.progress !== 'object' || !phase.progress.total) {
if (
!phase.progress ||
typeof phase.progress !== 'object' ||
!phase.progress.total
) {
await pauseFor(2000)
const patches: Operation<any>[] = [
@@ -1029,7 +1033,11 @@ export class MockApiService extends ApiService {
]
// overall
if (typeof progress.overall === 'object' && progress.overall.total) {
if (
progress.overall &&
typeof progress.overall === 'object' &&
progress.overall.total
) {
const step = progress.overall.total / progress.phases.length
progress.overall.done += step
@@ -1059,7 +1067,11 @@ export class MockApiService extends ApiService {
]
// overall
if (typeof progress.overall === 'object' && progress.overall.total) {
if (
progress.overall &&
typeof progress.overall === 'object' &&
progress.overall.total
) {
const step = progress.overall.total / progress.phases.length / 4
progress.overall.done += step

View File

@@ -348,7 +348,7 @@ export const mockPatchData: DataModel = {
currentDependencies: {},
hosts: {},
storeExposedDependents: [],
marketplaceUrl: 'https://registry.start9.com/',
registry: 'https://registry.start9.com/',
developerKey: 'developer-key',
},
lnd: {
@@ -600,7 +600,7 @@ export const mockPatchData: DataModel = {
},
hosts: {},
storeExposedDependents: [],
marketplaceUrl: 'https://registry.start9.com/',
registry: 'https://registry.start9.com/',
developerKey: 'developer-key',
},
},

View File

@@ -211,7 +211,7 @@ export class MarketplaceService implements AbstractMarketplaceService {
const params: RR.InstallPackageReq = {
id,
versionSpec: `=${version}`,
marketplaceUrl: url,
registry: url,
}
await this.api.installPackage(params)