mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
eos dl restrictions
This commit is contained in:
committed by
Aiden McClelland
parent
5eae4ffeb4
commit
55bf7c71da
@@ -1,7 +1,7 @@
|
|||||||
import { Component, ViewChild } from '@angular/core'
|
import { Component, ViewChild } from '@angular/core'
|
||||||
import { MarketplacePkg } from 'src/app/services/api/api.types'
|
import { MarketplacePkg } from 'src/app/services/api/api.types'
|
||||||
import { wizardModal } from 'src/app/components/install-wizard/install-wizard.component'
|
import { wizardModal } from 'src/app/components/install-wizard/install-wizard.component'
|
||||||
import { IonContent, ModalController } from '@ionic/angular'
|
import { AlertController, IonContent, ModalController } from '@ionic/angular'
|
||||||
import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards'
|
import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards'
|
||||||
import { PackageDataEntry, PackageState } from 'src/app/services/patch-db/data-model'
|
import { PackageDataEntry, PackageState } from 'src/app/services/patch-db/data-model'
|
||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
@@ -9,6 +9,8 @@ import { ErrorToastService } from 'src/app/services/error-toast.service'
|
|||||||
import { MarketplaceService } from '../marketplace.service'
|
import { MarketplaceService } from '../marketplace.service'
|
||||||
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import Fuse from 'fuse.js/dist/fuse.min.js'
|
import Fuse from 'fuse.js/dist/fuse.min.js'
|
||||||
|
import { isEmptyObject } from 'src/app/util/misc.util'
|
||||||
|
import { Router } from '@angular/router'
|
||||||
|
|
||||||
const defaultOps = {
|
const defaultOps = {
|
||||||
isCaseSensitive: false,
|
isCaseSensitive: false,
|
||||||
@@ -42,6 +44,7 @@ export class MarketplaceListPage {
|
|||||||
@ViewChild(IonContent) content: IonContent
|
@ViewChild(IonContent) content: IonContent
|
||||||
|
|
||||||
pkgs: MarketplacePkg[] = []
|
pkgs: MarketplacePkg[] = []
|
||||||
|
hasRecoveredPackage: boolean
|
||||||
categories: string[]
|
categories: string[]
|
||||||
localPkgs: { [id: string]: PackageDataEntry } = { }
|
localPkgs: { [id: string]: PackageDataEntry } = { }
|
||||||
category = 'featured'
|
category = 'featured'
|
||||||
@@ -55,6 +58,8 @@ export class MarketplaceListPage {
|
|||||||
private readonly errToast: ErrorToastService,
|
private readonly errToast: ErrorToastService,
|
||||||
private readonly wizardBaker: WizardBaker,
|
private readonly wizardBaker: WizardBaker,
|
||||||
private readonly patch: PatchDbService,
|
private readonly patch: PatchDbService,
|
||||||
|
private readonly alertCtrl: AlertController,
|
||||||
|
private readonly router: Router,
|
||||||
public readonly marketplaceService: MarketplaceService,
|
public readonly marketplaceService: MarketplaceService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
@@ -66,6 +71,9 @@ export class MarketplaceListPage {
|
|||||||
pkg['install-progress'] = { ...pkg['install-progress'] }
|
pkg['install-progress'] = { ...pkg['install-progress'] }
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
|
this.patch.watch$('recovered-packages').subscribe(rps => {
|
||||||
|
this.hasRecoveredPackage = !isEmptyObject(rps)
|
||||||
|
}),
|
||||||
]
|
]
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -109,6 +117,28 @@ export class MarketplaceListPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async updateEos (): Promise<void> {
|
async updateEos (): Promise<void> {
|
||||||
|
if (this.hasRecoveredPackage) {
|
||||||
|
const alert = await this.alertCtrl.create({
|
||||||
|
header: 'Cannot Update',
|
||||||
|
message: 'You cannot update EmbassyOS when you have unresolved recovered services.',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
text: 'OK',
|
||||||
|
role: 'cancel',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Resolve',
|
||||||
|
handler: () => {
|
||||||
|
this.router.navigate(['/services/list'], { replaceUrl: true })
|
||||||
|
},
|
||||||
|
cssClass: 'enter-click',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
await alert.present()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const { version, headline, 'release-notes': releaseNotes } = this.marketplaceService.eos
|
const { version, headline, 'release-notes': releaseNotes } = this.marketplaceService.eos
|
||||||
|
|
||||||
await wizardModal(
|
await wizardModal(
|
||||||
|
|||||||
Reference in New Issue
Block a user