mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
chore: cleanup and small misc fixes
display success alert if on latest EOS after check for update fix bug with loader dismiss after alert present fix restart button on update complete alert and fix mocks to account for this state fix make clean and adjust default registry names
This commit is contained in:
@@ -12,19 +12,10 @@ import { ValueSpecObject } from 'src/app/pkg-config/config-types'
|
||||
import { GenericFormPage } from 'src/app/modals/generic-form/generic-form.page'
|
||||
import { PatchDbService } from '../../../services/patch-db/patch-db.service'
|
||||
import { v4 } from 'uuid'
|
||||
import {
|
||||
UIData,
|
||||
UIMarketplaceData,
|
||||
} from '../../../services/patch-db/data-model'
|
||||
import { UIMarketplaceData } from '../../../services/patch-db/data-model'
|
||||
import { ConfigService } from '../../../services/config.service'
|
||||
import { MarketplaceService } from 'src/app/services/marketplace.service'
|
||||
import {
|
||||
distinctUntilChanged,
|
||||
finalize,
|
||||
first,
|
||||
map,
|
||||
startWith,
|
||||
} from 'rxjs/operators'
|
||||
import { distinctUntilChanged, finalize, first } from 'rxjs/operators'
|
||||
|
||||
type Marketplaces = {
|
||||
id: string | undefined
|
||||
@@ -55,11 +46,8 @@ export class MarketplacesPage {
|
||||
|
||||
ngOnInit() {
|
||||
this.patch
|
||||
.watch$('ui')
|
||||
.pipe(
|
||||
map((ui: UIData) => ui.marketplace),
|
||||
distinctUntilChanged(),
|
||||
)
|
||||
.watch$('ui', 'marketplace')
|
||||
.pipe(distinctUntilChanged())
|
||||
.subscribe((mp: UIMarketplaceData | undefined) => {
|
||||
let marketplaces: Marketplaces = [
|
||||
{
|
||||
@@ -114,8 +102,7 @@ export class MarketplacesPage {
|
||||
|
||||
async presentAction(id: string = '') {
|
||||
// no need to view actions if is selected marketplace
|
||||
if (!id || id === this.patch.getData().ui.marketplace?.['selected-id'])
|
||||
return
|
||||
if (id === this.patch.getData().ui.marketplace?.['selected-id']) return
|
||||
|
||||
const buttons: ActionSheetButton[] = [
|
||||
{
|
||||
|
||||
@@ -16,6 +16,7 @@ import { WizardDefs } from 'src/app/components/app-wizard/wizard-defs'
|
||||
import { exists, isEmptyObject, ErrorToastService } from '@start9labs/shared'
|
||||
import { EOSService } from 'src/app/services/eos.service'
|
||||
import { LocalStorageService } from 'src/app/services/local-storage.service'
|
||||
import { RecoveredPackageDataEntry } from 'src/app/services/patch-db/data-model'
|
||||
|
||||
@Component({
|
||||
selector: 'server-show',
|
||||
@@ -47,7 +48,7 @@ export class ServerShowPage {
|
||||
this.patch
|
||||
.watch$('recovered-packages')
|
||||
.pipe(filter(exists), take(1))
|
||||
.subscribe(rps => {
|
||||
.subscribe((rps: { [id: string]: RecoveredPackageDataEntry }) => {
|
||||
this.hasRecoveredPackage = !isEmptyObject(rps)
|
||||
})
|
||||
}
|
||||
@@ -233,16 +234,36 @@ export class ServerShowPage {
|
||||
|
||||
try {
|
||||
const updateAvailable = await this.eosService.getEOS()
|
||||
|
||||
await loader.dismiss()
|
||||
|
||||
if (updateAvailable) {
|
||||
this.updateEos()
|
||||
} else {
|
||||
this.presentAlertLatest()
|
||||
}
|
||||
} catch (e: any) {
|
||||
await loader.dismiss()
|
||||
this.errToast.present(e)
|
||||
} finally {
|
||||
loader.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
async presentAlertLatest() {
|
||||
const alert = await this.alertCtrl.create({
|
||||
header: 'Up to date!',
|
||||
message: 'You are on the latest version of EmbassyOS.',
|
||||
buttons: [
|
||||
{
|
||||
text: 'OK',
|
||||
role: 'cancel',
|
||||
cssClass: 'enter-click',
|
||||
},
|
||||
],
|
||||
cssClass: 'alert-success-message',
|
||||
})
|
||||
alert.present()
|
||||
}
|
||||
|
||||
settings: ServerSettings = {
|
||||
Backups: [
|
||||
{
|
||||
@@ -332,8 +353,8 @@ export class ServerShowPage {
|
||||
disabled: of(false),
|
||||
},
|
||||
{
|
||||
title: 'Manually install a service',
|
||||
description: `Install a service by drag n' drop`,
|
||||
title: 'Manually Install A Service',
|
||||
description: `Install a service by drag and drop`,
|
||||
icon: 'push-outline',
|
||||
action: () =>
|
||||
this.navCtrl.navigateForward(['sideload'], {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button defaultHref="embassy"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title>Manually install a service</ion-title>
|
||||
<ion-title>Manually Install A Service</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user