Remove app wiz and dry calls (#1541)

* no more app wiz or dry calls

* change spinner type

* better display for update available

* reintroduce dep breakages for update/downgrade and style alerts everywhere

* only show install alert on first install

Co-authored-by: Matt Hill <matthill@Matt-M1.local>
Co-authored-by: Matt Hill <matthill@Matt-M1.start9.dev>
This commit is contained in:
Matt Hill
2022-06-16 13:30:23 -06:00
committed by Lucy C
parent 37304a9d92
commit 0ac5b34f2d
57 changed files with 669 additions and 521 deletions

View File

@@ -9,7 +9,6 @@
<ion-content class="ion-padding-top">
<ion-item-group *ngIf="pkg">
<!-- ** standard actions ** -->
<ion-item-divider>Standard Actions</ion-item-divider>
<app-actions-item
@@ -18,11 +17,14 @@
description: 'This will uninstall the service from your Embassy and delete all data permanently.',
icon: 'trash-outline'
}"
(click)="uninstall()">
(click)="tryUninstall()"
>
</app-actions-item>
<!-- ** specific actions ** -->
<ion-item-divider *ngIf="!(pkg.manifest.actions | empty)">Actions for {{ pkg.manifest.title }}</ion-item-divider>
<ion-item-divider *ngIf="!(pkg.manifest.actions | empty)"
>Actions for {{ pkg.manifest.title }}</ion-item-divider
>
<app-actions-item
*ngFor="let action of pkg.manifest.actions | keyvalue: asIsOrder"
[action]="{
@@ -30,7 +32,8 @@
description: action.value.description,
icon: 'play-circle-outline'
}"
(click)="handleAction(action)">
(click)="handleAction(action)"
>
</app-actions-item>
</ion-item-group>
</ion-content>
</ion-content>

View File

@@ -4,6 +4,7 @@ import { ApiService } from 'src/app/services/api/embassy-api.service'
import {
AlertController,
IonContent,
IonicSafeString,
LoadingController,
ModalController,
NavController,
@@ -14,12 +15,11 @@ import {
PackageDataEntry,
PackageMainStatus,
} from 'src/app/services/patch-db/data-model'
import { wizardModal } from 'src/app/components/app-wizard/app-wizard.component'
import { WizardDefs } from 'src/app/components/app-wizard/wizard-defs'
import { Subscription } from 'rxjs'
import { GenericFormPage } from 'src/app/modals/generic-form/generic-form.page'
import { isEmptyObject, ErrorToastService, getPkgId } from '@start9labs/shared'
import { ActionSuccessPage } from 'src/app/modals/action-success/action-success.page'
import { hasCurrentDeps } from 'src/app/util/has-deps'
@Component({
selector: 'app-actions',
@@ -39,7 +39,6 @@ export class AppActionsPage {
private readonly alertCtrl: AlertController,
private readonly errToast: ErrorToastService,
private readonly loadingCtrl: LoadingController,
private readonly wizards: WizardDefs,
private readonly navCtrl: NavController,
private readonly patch: PatchDbService,
) {}
@@ -136,19 +135,52 @@ export class AppActionsPage {
}
}
async uninstall() {
const { id, title, alerts } = this.pkg.manifest
const success = await wizardModal(
this.modalCtrl,
this.wizards.uninstall({
id,
title,
uninstallAlert: alerts.uninstall || undefined,
}),
)
async tryUninstall(): Promise<void> {
const { title, alerts } = this.pkg.manifest
if (success) {
return this.navCtrl.navigateRoot('/services')
let message =
alerts.uninstall ||
`Uninstalling ${title} will permanently delete its data`
if (hasCurrentDeps(this.pkg)) {
message = `${message}. Services that depend on ${title} will no longer work properly and may crash`
}
const alert = await this.alertCtrl.create({
header: 'Warning',
message,
buttons: [
{
text: 'Cancel',
role: 'cancel',
},
{
text: 'Uninstall',
handler: () => {
this.uninstall()
},
cssClass: 'enter-click',
},
],
cssClass: 'alert-warning-message',
})
await alert.present()
}
private async uninstall() {
const loader = await this.loadingCtrl.create({
message: `Beginning uninstall...`,
})
await loader.present()
try {
await this.embassyApi.uninstallPackage({ id: this.pkgId })
this.navCtrl.navigateRoot('/services')
} catch (e: any) {
this.errToast.present(e)
} finally {
loader.dismiss()
}
}
@@ -157,7 +189,6 @@ export class AppActionsPage {
input?: object,
): Promise<boolean> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Executing action...',
})
await loader.present()

View File

@@ -13,50 +13,49 @@
</ion-item>
<ng-container *ngIf="isInstalled">
<ion-item lines="none">
<ion-button
*ngIf="isRunning"
class="action-button"
slot="start"
color="danger"
(click)="stop()"
>
<ion-icon slot="start" name="stop-outline"></ion-icon>
Stop
</ion-button>
<ion-grid>
<ion-row style="padding-left: 12px">
<ion-col>
<ng-container *ngIf="isRunning">
<ion-button class="action-button" color="danger" (click)="tryStop()">
<ion-icon slot="start" name="stop-outline"></ion-icon>
Stop
</ion-button>
</ng-container>
<ion-button
*ngIf="isStopped"
class="action-button"
slot="start"
color="success"
(click)="tryStart()"
>
<ion-icon slot="start" name="play-outline"></ion-icon>
Start
</ion-button>
<ion-button
*ngIf="isStopped"
class="action-button"
color="success"
(click)="tryStart()"
>
<ion-icon slot="start" name="play-outline"></ion-icon>
Start
</ion-button>
<ion-button
*ngIf="!pkgStatus?.configured"
class="action-button"
slot="start"
color="warning"
(click)="presentModalConfig()"
>
<ion-icon slot="start" name="construct-outline"></ion-icon>
Configure
</ion-button>
<ion-button
*ngIf="!pkgStatus?.configured"
class="action-button"
color="warning"
(click)="presentModalConfig()"
>
<ion-icon slot="start" name="construct-outline"></ion-icon>
Configure
</ion-button>
<ion-button
*ngIf="pkgStatus && (interfaces | hasUi)"
class="action-button"
slot="start"
color="primary"
[disabled]="!(pkg.state | isLaunchable: pkgStatus.main.status:interfaces)"
(click)="launchUi()"
>
<ion-icon slot="start" name="open-outline"></ion-icon>
Launch UI
</ion-button>
</ion-item>
</ng-container>
<ion-button
*ngIf="pkgStatus && (interfaces | hasUi)"
class="action-button"
color="primary"
[disabled]="
!(pkg.state | isLaunchable: pkgStatus.main.status:interfaces)
"
(click)="launchUi()"
>
<ion-icon slot="start" name="open-outline"></ion-icon>
Launch UI
</ion-button>
</ion-col>
</ion-row>
</ion-grid>
</ng-container>

View File

@@ -12,16 +12,15 @@ import {
Status,
} from 'src/app/services/patch-db/data-model'
import { ErrorToastService } from '@start9labs/shared'
import { wizardModal } from 'src/app/components/app-wizard/app-wizard.component'
import { WizardDefs } from 'src/app/components/app-wizard/wizard-defs'
import {
AlertController,
IonicSafeString,
LoadingController,
ModalController,
} from '@ionic/angular'
import { ApiService } from 'src/app/services/api/embassy-api.service'
import { ModalService } from 'src/app/services/modal.service'
import { DependencyInfo } from '../../pipes/to-dependencies.pipe'
import { hasCurrentDeps } from 'src/app/util/has-deps'
@Component({
selector: 'app-show-status',
@@ -48,9 +47,7 @@ export class AppShowStatusComponent {
private readonly alertCtrl: AlertController,
private readonly errToast: ErrorToastService,
private readonly loadingCtrl: LoadingController,
private readonly modalCtrl: ModalController,
private readonly embassyApi: ApiService,
private readonly wizards: WizardDefs,
private readonly launcherService: UiLauncherService,
private readonly modalService: ModalService,
) {}
@@ -105,41 +102,73 @@ export class AppShowStatusComponent {
this.start()
}
async stop(): Promise<void> {
const { id, title } = this.pkg.manifest
const hasDependents = !!Object.keys(
this.pkg.installed?.['current-dependents'] || {},
).filter(depId => depId !== id).length
async tryStop(): Promise<void> {
const { title, alerts } = this.pkg.manifest
if (!hasDependents) {
const loader = await this.loadingCtrl.create({
message: `Stopping...`,
spinner: 'lines',
let message = alerts.stop || ''
if (hasCurrentDeps(this.pkg)) {
const depMessage = `Services that depend on ${title} will no longer work properly and may crash`
message = message ? `${message}.\n\n${depMessage}` : depMessage
}
if (message) {
const alert = await this.alertCtrl.create({
header: 'Warning',
message,
buttons: [
{
text: 'Cancel',
role: 'cancel',
},
{
text: 'Stop',
handler: () => {
this.stop()
},
cssClass: 'enter-click',
},
],
cssClass: 'alert-warning-message',
})
await loader.present()
try {
await this.embassyApi.stopPackage({ id })
} catch (e: any) {
this.errToast.present(e)
} finally {
loader.dismiss()
}
await alert.present()
} else {
wizardModal(
this.modalCtrl,
this.wizards.stop({
id,
title,
}),
)
this.stop()
}
}
<<<<<<< HEAD
=======
async tryRestart(): Promise<void> {
if (hasCurrentDeps(this.pkg)) {
const alert = await this.alertCtrl.create({
header: 'Warning',
message: `Services that depend on ${this.pkg.manifest.title} may temporarily experiences issues`,
buttons: [
{
text: 'Cancel',
role: 'cancel',
},
{
text: 'Restart',
handler: () => {
this.restart()
},
cssClass: 'enter-click',
},
],
})
await alert.present()
} else {
this.restart()
}
}
>>>>>>> 918a1907... Remove app wiz and dry calls (#1541)
private async start(): Promise<void> {
const loader = await this.loadingCtrl.create({
message: `Starting...`,
spinner: 'lines',
})
await loader.present()
@@ -152,10 +181,43 @@ export class AppShowStatusComponent {
}
}
<<<<<<< HEAD
=======
private async stop(): Promise<void> {
const loader = await this.loadingCtrl.create({
message: 'Stopping...',
})
await loader.present()
try {
await this.embassyApi.stopPackage({ id: this.pkg.manifest.id })
} catch (e: any) {
this.errToast.present(e)
} finally {
loader.dismiss()
}
}
private async restart(): Promise<void> {
const loader = await this.loadingCtrl.create({
message: `Restarting...`,
})
await loader.present()
try {
await this.embassyApi.restartPackage({ id: this.pkg.manifest.id })
} catch (e: any) {
this.errToast.present(e)
} finally {
loader.dismiss()
}
}
>>>>>>> 918a1907... Remove app wiz and dry calls (#1541)
private async presentAlertStart(message: string): Promise<boolean> {
return new Promise(async resolve => {
const alert = await this.alertCtrl.create({
header: 'Warning',
header: 'Alert',
message,
buttons: [
{

View File

@@ -141,7 +141,6 @@ export class DeveloperListPage {
return
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Creating Project...',
})
await loader.present()
@@ -188,7 +187,6 @@ export class DeveloperListPage {
async editName(id: string, newName: string) {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Saving...',
})
await loader.present()
@@ -204,7 +202,6 @@ export class DeveloperListPage {
async delete(id: string) {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Removing Project...',
})
await loader.present()

View File

@@ -72,7 +72,6 @@ export class DeveloperMenuPage {
async saveBasicInfo(basicInfo: BasicInfo) {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Saving...',
})
await loader.present()

View File

@@ -34,8 +34,7 @@ export class LoginPage {
this.error = ''
this.loader = await this.loadingCtrl.create({
message: 'Logging in',
spinner: 'lines',
message: 'Logging in...',
})
await this.loader.present()

View File

@@ -10,24 +10,24 @@
<ng-container *ngIf="localPkg; else install">
<ng-container *ngIf="localPkg.state === PackageState.Installed">
<ion-button
*ngIf="(version | compareEmver: pkg.manifest.version) === -1"
*ngIf="(localVersion | compareEmver: pkg.manifest.version) === -1"
expand="block"
color="success"
(click)="presentModal('update')"
(click)="tryInstall()"
>
Update
</ion-button>
<ion-button
*ngIf="(version | compareEmver: pkg.manifest.version) === 1"
*ngIf="(localVersion | compareEmver: pkg.manifest.version) === 1"
expand="block"
color="warning"
(click)="presentModal('downgrade')"
(click)="tryInstall()"
>
Downgrade
</ion-button>
<ng-container *ngIf="localStorageService.showDevTools$ | async">
<ion-button
*ngIf="(version | compareEmver: pkg.manifest.version) === 0"
*ngIf="(localVersion | compareEmver: pkg.manifest.version) === 0"
expand="block"
color="success"
(click)="tryInstall()"

View File

@@ -1,19 +1,32 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
import { AlertController, ModalController, NavController } from '@ionic/angular'
import {
ChangeDetectionStrategy,
Component,
Inject,
Input,
} from '@angular/core'
import {
AlertController,
IonicSafeString,
LoadingController,
} from '@ionic/angular'
import {
AbstractMarketplaceService,
MarketplacePkg,
} from '@start9labs/marketplace'
import { pauseFor } from '@start9labs/shared'
import {
Manifest,
PackageDataEntry,
PackageState,
} from 'src/app/services/patch-db/data-model'
import { wizardModal } from 'src/app/components/app-wizard/app-wizard.component'
import { WizardDefs } from 'src/app/components/app-wizard/wizard-defs'
import { LocalStorageService } from 'src/app/services/local-storage.service'
import { MarketplaceService } from 'src/app/services/marketplace.service'
import { hasCurrentDeps } from 'src/app/util/has-deps'
import { Emver } from '../../../../../../../shared/src/services/emver.service'
import { first } from 'rxjs/operators'
import { ErrorToastService } from '../../../../../../../shared/src/services/error-toast.service'
import { ApiService } from 'src/app/services/api/embassy-api.service'
import { isEmptyObject } from '../../../../../../../shared/src/util/misc.util'
import { Breakages } from 'src/app/services/api/api.types'
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
@Component({
selector: 'marketplace-show-controls',
@@ -32,60 +45,149 @@ export class MarketplaceShowControlsComponent {
constructor(
private readonly alertCtrl: AlertController,
private readonly modalCtrl: ModalController,
private readonly wizards: WizardDefs,
private readonly navCtrl: NavController,
private readonly marketplaceService: AbstractMarketplaceService,
public readonly localStorageService: LocalStorageService,
@Inject(AbstractMarketplaceService)
private readonly marketplaceService: MarketplaceService,
private readonly loadingCtrl: LoadingController,
private readonly emver: Emver,
private readonly errToast: ErrorToastService,
private readonly embassyApi: ApiService,
private readonly patch: PatchDbService,
) {}
get version(): string {
get localVersion(): string {
return this.localPkg?.manifest.version || ''
}
async tryInstall() {
const { id, title, version, alerts } = this.pkg.manifest
if (!alerts.install) {
this.marketplaceService.install(id, version).subscribe()
if (!this.localPkg) {
this.alertInstall()
} else {
if (
this.emver.compare(this.localVersion, this.pkg.manifest.version) !==
0 &&
hasCurrentDeps(this.localPkg)
) {
this.dryInstall()
} else {
this.install()
}
}
}
private async dryInstall() {
const loader = await this.loadingCtrl.create({
message: 'Checking dependent services...',
})
await loader.present()
const { id, version } = this.pkg.manifest
try {
const breakages = await this.embassyApi.dryUpdatePackage({
id,
version: `=${version}`,
})
if (isEmptyObject(breakages)) {
this.install(loader)
} else {
await loader.dismiss()
const proceed = await this.presentAlertBreakages(breakages)
if (proceed) {
this.install()
}
}
} catch (e: any) {
this.errToast.present(e)
}
}
private async alertInstall() {
const installAlert = this.pkg.manifest.alerts.install
if (!installAlert) return this.install()
const alert = await this.alertCtrl.create({
header: 'Alert',
message: installAlert,
buttons: [
{
text: 'Cancel',
role: 'cancel',
},
{
text: 'Install',
handler: () => {
this.install()
},
cssClass: 'enter-click',
},
],
})
await alert.present()
}
private async install(loader?: HTMLIonLoadingElement) {
const message = 'Beginning Install...'
if (loader) {
loader.message = message
} else {
loader = await this.loadingCtrl.create({ message })
await loader.present()
}
const { id, version } = this.pkg.manifest
try {
await this.marketplaceService
.installPackage({
id,
'version-spec': `=${version}`,
})
.pipe(first())
.toPromise()
} catch (e: any) {
this.errToast.present(e)
} finally {
loader.dismiss()
}
}
private async presentAlertBreakages(breakages: Breakages): Promise<boolean> {
let message: string | IonicSafeString =
'As a result of this update, the following services will no longer work properly and may crash:<ul>'
const localPkgs = this.patch.getData()['package-data']
const bullets = Object.keys(breakages).map(id => {
const title = localPkgs[id].manifest.title
return `<li><b>${title}</b></li>`
})
message = new IonicSafeString(`${message}${bullets}</ul>`)
return new Promise(async resolve => {
const alert = await this.alertCtrl.create({
header: title,
subHeader: version,
message: alerts.install,
header: 'Warning',
message,
buttons: [
{
text: 'Cancel',
role: 'cancel',
handler: () => {
resolve(false)
},
},
{
text: 'Install',
handler: () =>
this.marketplaceService.install(id, version).subscribe(),
text: 'Continue',
handler: () => {
resolve(true)
},
cssClass: 'enter-click',
},
],
cssClass: 'alert-warning-message',
})
await alert.present()
}
}
async presentModal(action: 'update' | 'downgrade') {
// TODO: Fix type
const { id, title, version, dependencies, alerts } = this.pkg
.manifest as Manifest
const value = {
id,
title,
version,
serviceRequirements: dependencies,
installAlert: alerts.install || undefined,
}
wizardModal(
this.modalCtrl,
action === 'update'
? this.wizards.update(value)
: this.wizards.downgrade(value),
)
})
}
}

View File

@@ -72,7 +72,6 @@ export class NotificationsPage {
async delete(id: number, index: number): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Deleting...',
})
await loader.present()
@@ -100,10 +99,10 @@ export class NotificationsPage {
},
{
text: 'Delete',
cssClass: 'enter-click',
handler: () => {
this.deleteAll()
},
cssClass: 'enter-click',
},
],
})
@@ -160,7 +159,6 @@ export class NotificationsPage {
private async deleteAll(): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Deleting...',
})
await loader.present()

View File

@@ -145,7 +145,6 @@ export class MarketplacesPage {
: this.config.marketplace.url
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Validating Marketplace...',
})
await loader.present()
@@ -189,7 +188,6 @@ export class MarketplacesPage {
)
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Deleting...',
})
await loader.present()
@@ -219,7 +217,6 @@ export class MarketplacesPage {
if (currentUrls.includes(new URL(url).hostname)) return
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Validating Marketplace...',
})
@@ -264,7 +261,6 @@ export class MarketplacesPage {
if (currentUrls.includes(new URL(url).hostname)) return
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Validating Marketplace...',
})
await loader.present()

View File

@@ -66,7 +66,6 @@ export class PreferencesPage {
private async setDbValue(key: string, value: string): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Saving...',
})
await loader.present()

View File

@@ -65,7 +65,6 @@ export class RestorePage {
oldPassword?: string,
): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Decrypting drive...',
})
await loader.present()

View File

@@ -158,7 +158,6 @@ export class ServerBackupPage {
oldPassword?: string,
): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Beginning backup...',
})
await loader.present()

View File

@@ -6,6 +6,7 @@ import { ServerShowPage } from './server-show.page'
import { FormsModule } from '@angular/forms'
import { TextSpinnerComponentModule } from '@start9labs/shared'
import { BadgeMenuComponentModule } from 'src/app/components/badge-menu-button/badge-menu.component.module'
import { OSUpdatePageModule } from 'src/app/modals/os-update/os-update.page.module'
const routes: Routes = [
{
@@ -22,6 +23,7 @@ const routes: Routes = [
RouterModule.forChild(routes),
TextSpinnerComponentModule,
BadgeMenuComponentModule,
OSUpdatePageModule,
],
declarations: [ServerShowPage],
})

View File

@@ -69,18 +69,16 @@
</p>
<!-- "Software Update" button only -->
<p *ngIf="button.title === 'Software Update'">
<ng-container *ngIf="button.disabled | async; else enabled">
<ion-text
*ngIf="server['status-info'].updated"
class="inline"
color="warning"
>
Update Complete, Restart to apply changes
</ion-text>
</ng-container>
<ng-template #enabled>
<ion-text
*ngIf="server['status-info'].updated; else notUpdated"
class="inline"
color="warning"
>
Update Complete. Restart to apply changes
</ion-text>
<ng-template #notUpdated>
<ng-container
*ngIf="eosService.updateAvailable$ | async; else check"
*ngIf="eosService.showUpdate$ | async; else check"
>
<ion-text class="inline" color="success">
<ion-icon name="rocket-outline"></ion-icon>

View File

@@ -11,12 +11,11 @@ import { ActivatedRoute } from '@angular/router'
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
import { Observable, of } from 'rxjs'
import { filter, map, take } from 'rxjs/operators'
import { wizardModal } from 'src/app/components/app-wizard/app-wizard.component'
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'
import { OSUpdatePage } from 'src/app/modals/os-update/os-update.page'
@Component({
selector: 'server-show',
@@ -33,7 +32,6 @@ export class ServerShowPage {
constructor(
private readonly alertCtrl: AlertController,
private readonly modalCtrl: ModalController,
private readonly wizards: WizardDefs,
private readonly loadingCtrl: LoadingController,
private readonly errToast: ErrorToastService,
private readonly embassyApi: ApiService,
@@ -63,26 +61,19 @@ export class ServerShowPage {
})
await alert.present()
} else {
const {
version,
headline,
'release-notes': releaseNotes,
} = this.eosService.eos
await wizardModal(
this.modalCtrl,
this.wizards.updateOS({
version,
headline,
releaseNotes,
}),
)
const modal = await this.modalCtrl.create({
componentProps: {
releaseNotes: this.eosService.eos['release-notes'],
},
component: OSUpdatePage,
})
modal.present()
}
}
async presentAlertRestart() {
const alert = await this.alertCtrl.create({
header: 'Confirm',
header: 'Restart',
message:
'Are you sure you want to restart your Embassy? It can take several minutes to come back online.',
buttons: [
@@ -106,7 +97,7 @@ export class ServerShowPage {
const alert = await this.alertCtrl.create({
header: 'Warning',
message:
'Are you sure you want to power down your Embassy? This can take several minutes, and your Embassy will not come back online automatically. To power on again, You will need to physically unplug your Embassy and plug it back in.',
'Are you sure you want to power down your Embassy? This can take several minutes, and your Embassy will not come back online automatically. To power on again, You will need to physically unplug your Embassy and plug it back in',
buttons: [
{
text: 'Cancel',
@@ -120,6 +111,7 @@ export class ServerShowPage {
cssClass: 'enter-click',
},
],
cssClass: 'alert-warning-message',
})
await alert.present()
}
@@ -127,9 +119,9 @@ export class ServerShowPage {
async presentAlertSystemRebuild() {
const minutes = Object.keys(this.patch.getData()['package-data']).length * 2
const alert = await this.alertCtrl.create({
header: 'System Rebuild',
header: 'Warning',
message: new IonicSafeString(
`<ion-text color="warning">Warning:</ion-text> This action will tear down all service containers and rebuild them from scratch. No data will be deleted. This action is useful if your system gets into a bad state, and it should only be performed if you are experiencing general performance or reliability issues. It may take up to ${minutes} minutes to complete. During this time, you will lose all connectivity to your Embassy.`,
`This action will tear down all service containers and rebuild them from scratch. No data will be deleted. This action is useful if your system gets into a bad state, and it should only be performed if you are experiencing general performance or reliability issues. It may take up to ${minutes} minutes to complete. During this time, you will lose all connectivity to your Embassy.`,
),
buttons: [
{
@@ -144,15 +136,16 @@ export class ServerShowPage {
cssClass: 'enter-click',
},
],
cssClass: 'alert-warning-message',
})
await alert.present()
}
async presentAlertRepairDisk() {
const alert = await this.alertCtrl.create({
header: 'Repair Disk',
header: 'Warning',
message: new IonicSafeString(
`<ion-text color="warning">Warning:</ion-text> <p>This action will attempt to preform a disk repair operation and system reboot. No data will be deleted. This action should only be executed if directed by a Start9 support specialist. We recommend backing up your device before preforming this action.</p><p>If anything happens to the device during the reboot (between the bep and chime), such as loosing power, a power surge, unplugging the drive, or unplugging the Embassy, the filesystem *will* be in an unrecoverable state. Please proceed with caution.</p>`,
`<p>This action will attempt to preform a disk repair operation and system reboot. No data will be deleted. This action should only be executed if directed by a Start9 support specialist. We recommend backing up your device before preforming this action.</p><p>If anything happens to the device during the reboot (between the bep and chime), such as loosing power, a power surge, unplugging the drive, or unplugging the Embassy, the filesystem <i>will</i> be in an unrecoverable state. Please proceed with caution.</p>`,
),
buttons: [
{
@@ -173,13 +166,13 @@ export class ServerShowPage {
cssClass: 'enter-click',
},
],
cssClass: 'alert-warning-message',
})
await alert.present()
}
private async restart() {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Restarting...',
})
await loader.present()
@@ -195,7 +188,6 @@ export class ServerShowPage {
private async shutdown() {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Shutting down...',
})
await loader.present()
@@ -211,7 +203,6 @@ export class ServerShowPage {
private async systemRebuild() {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Hard Restarting...',
})
await loader.present()
@@ -227,7 +218,6 @@ export class ServerShowPage {
private async checkForEosUpdate(): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Checking for updates',
})
await loader.present()
@@ -282,14 +272,7 @@ export class ServerShowPage {
action: () =>
this.navCtrl.navigateForward(['restore'], { relativeTo: this.route }),
detail: true,
disabled: this.patch
.watch$('server-info', 'status-info')
.pipe(
map(
status =>
status && (status['backing-up'] || !!status['update-progress']),
),
),
disabled: this.eosService.updatingOrBackingUp$,
},
],
Settings: [
@@ -302,17 +285,7 @@ export class ServerShowPage {
? this.updateEos()
: this.checkForEosUpdate(),
detail: false,
disabled: this.patch
.watch$('server-info', 'status-info')
.pipe(
map(
status =>
status &&
(status['backing-up'] ||
!!status['update-progress'] ||
status.updated),
),
),
disabled: this.eosService.updatingOrBackingUp$,
},
{
title: 'Preferences',

View File

@@ -53,7 +53,6 @@ export class SessionsPage {
async kill(id: string): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Killing session...',
})
await loader.present()

View File

@@ -50,8 +50,7 @@ export class SideloadPage {
}
async setFile(files?: File[]) {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Verifying Package',
message: 'Verifying package',
cssClass: 'loader',
})
await loader.present()
@@ -84,8 +83,7 @@ export class SideloadPage {
async handleUpload() {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Uploading Package',
message: 'Uploading package',
cssClass: 'loader',
})
await loader.present()

View File

@@ -64,7 +64,6 @@ export class SSHKeysPage {
async add(pubkey: string): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Saving...',
})
await loader.present()
@@ -100,7 +99,6 @@ export class SSHKeysPage {
async delete(i: number): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Deleting...',
})
await loader.present()

View File

@@ -170,7 +170,7 @@ export class WifiPage {
private async setCountry(country: string): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Setting country...',
})
await loader.present()
@@ -261,7 +261,6 @@ export class WifiPage {
private async connect(ssid: string): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Connecting. This could take a while...',
})
await loader.present()
@@ -278,7 +277,6 @@ export class WifiPage {
private async delete(ssid: string): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Deleting...',
})
await loader.present()
@@ -296,7 +294,6 @@ export class WifiPage {
private async save(ssid: string, password: string): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Saving...',
})
await loader.present()
@@ -318,7 +315,6 @@ export class WifiPage {
private async saveAndConnect(ssid: string, password: string): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Connecting. This could take a while...',
})
await loader.present()