diff --git a/ui/src/app/pages/apps-routes/app-show/app-show.page.ts b/ui/src/app/pages/apps-routes/app-show/app-show.page.ts
index 21391d1f0..8597fd203 100644
--- a/ui/src/app/pages/apps-routes/app-show/app-show.page.ts
+++ b/ui/src/app/pages/apps-routes/app-show/app-show.page.ts
@@ -12,6 +12,7 @@ import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
import { DependencyErrorConfigUnsatisfied, DependencyErrorNotInstalled, DependencyErrorType, PackageDataEntry, PackageState } from 'src/app/services/patch-db/data-model'
import { FEStatus, PkgStatusRendering, renderPkgStatus } from 'src/app/services/pkg-status-rendering.service'
import { ConnectionService } from 'src/app/services/connection.service'
+import { ErrorToastService } from 'src/app/services/error-toast.service'
@Component({
selector: 'app-show',
@@ -19,7 +20,6 @@ import { ConnectionService } from 'src/app/services/connection.service'
styleUrls: ['./app-show.page.scss'],
})
export class AppShowPage {
- error: string
pkgId: string
pkg: PackageDataEntry
hideLAN: boolean
@@ -37,6 +37,7 @@ export class AppShowPage {
private readonly alertCtrl: AlertController,
private readonly route: ActivatedRoute,
private readonly navCtrl: NavController,
+ private readonly errToast: ErrorToastService,
private readonly loader: LoaderService,
private readonly modalCtrl: ModalController,
private readonly apiService: ApiService,
@@ -62,9 +63,9 @@ export class AppShowPage {
this.setButtons()
}
- ngAfterViewInit () {
- this.content.scrollToPoint(undefined, 1)
- }
+ // ngAfterViewInit () {
+ // this.content.scrollToPoint(undefined, 1)
+ // }
ngOnDestroy () {
this.subs.forEach(sub => sub.unsubscribe())
@@ -215,23 +216,24 @@ export class AppShowPage {
}
private setError (e: Error): Observable
{
- this.error = e.message
+ console.error(e)
+ this.errToast.present(e.message)
return of()
}
setButtons (): void {
this.buttons = [
{
- action: () => this.navCtrl.navigateForward(['metrics'], { relativeTo: this.route }),
- title: 'Health',
- icon: 'medkit-outline',
+ action: () => this.navCtrl.navigateForward(['instructions'], { relativeTo: this.route }),
+ title: 'Instructions',
+ icon: 'list-outline',
color: 'danger',
disabled: [],
},
{
- action: () => this.navCtrl.navigateForward(['instructions'], { relativeTo: this.route }),
- title: 'Instructions',
- icon: 'list-outline',
+ action: () => this.navCtrl.navigateForward(['metrics'], { relativeTo: this.route }),
+ title: 'Monitor',
+ icon: 'medkit-outline',
color: 'danger',
disabled: [],
},
diff --git a/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.html b/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.html
index d47524b2d..09d98df88 100644
--- a/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.html
+++ b/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.html
@@ -14,11 +14,6 @@
-
-
- {{ error }}
-
-
Now Available...
@@ -50,7 +45,7 @@
-
+
diff --git a/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.scss b/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.scss
index 4df2d43c9..595a7579d 100644
--- a/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.scss
+++ b/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.scss
@@ -23,4 +23,5 @@
.cat-selected {
border-width: 0 0 1px 0;
border-style: solid;
+ border-color: var(--ion-color-primary);
}
diff --git a/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.ts b/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.ts
index 05203eeb8..cd7c4832c 100644
--- a/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.ts
+++ b/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.ts
@@ -5,8 +5,9 @@ import { wizardModal } from 'src/app/components/install-wizard/install-wizard.co
import { IonContent, ModalController } from '@ionic/angular'
import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards'
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
-import { PackageDataEntry, PackageState } from 'src/app/services/patch-db/data-model'
+import { PackageState } from 'src/app/services/patch-db/data-model'
import { Subscription } from 'rxjs'
+import { ErrorToastService } from 'src/app/services/error-toast.service'
@Component({
selector: 'marketplace-list',
@@ -17,7 +18,6 @@ export class MarketplaceListPage {
@ViewChild(IonContent) content: IonContent
pageLoading = true
pkgsLoading = true
- error = ''
category = 'all'
query: string
@@ -37,6 +37,7 @@ export class MarketplaceListPage {
constructor (
private readonly apiService: ApiService,
private readonly modalCtrl: ModalController,
+ private readonly errToast: ErrorToastService,
private readonly wizardBaker: WizardBaker,
public readonly patch: PatchDbModel,
) { }
@@ -55,7 +56,7 @@ export class MarketplaceListPage {
this.pkgs = pkgs
} catch (e) {
console.error(e)
- this.error = e.message
+ this.errToast.present(e.message)
} finally {
this.pageLoading = false
this.pkgsLoading = false
@@ -106,7 +107,7 @@ export class MarketplaceListPage {
return pkgs
} catch (e) {
console.error(e)
- this.error = e.message
+ this.errToast.present(e.message)
} finally {
this.pkgsLoading = false
}
diff --git a/ui/src/app/pages/marketplace-routes/marketplace-show/marketplace-show.page.html b/ui/src/app/pages/marketplace-routes/marketplace-show/marketplace-show.page.html
index 901aabfe9..0c2e66fcd 100644
--- a/ui/src/app/pages/marketplace-routes/marketplace-show/marketplace-show.page.html
+++ b/ui/src/app/pages/marketplace-routes/marketplace-show/marketplace-show.page.html
@@ -12,213 +12,211 @@
-
+
-
-
- {{ error }}
-
-
-
-
-
-
-
-
-
-
- Install
-
-
-
-
-
-
- Update
-
-
- Downgrade
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ rec.dependentTitle }}
-
-
-
{{ rec.description }}
-
{{ pkg.manifest.title }} version {{ pkg.manifest.version | displayEmver }} is compatible.
-
{{ pkg.manifest.title }} version {{ pkg.manifest.version | displayEmver }} is NOT compatible.
-
-
-
-
-
-
-
-
-
-
- New in {{ pkg.manifest.version | displayEmver }}
-
- All Release Notes
-
-
-
-
-
-
-
-
-
- Description
-
-
- {{ pkg.manifest.description.long }}
-
-
-
-
- Dependencies
-
-
-
-
-
-
-
-
-
- {{ pkg['dependency-metadata'][dep.key].title }}
- (recommended)
-
- {{ dep.value.version | displayEmver }}
- {{ dep.value.description }}
-
-
-
-
-
-
-
-
- Additional Info
-
+
+
-
-
-
-
- Service ID
- {{ pkg.manifest.id }}
-
-
-
-
- Categories
- {{ pkg.categories.join(', ') }}
-
-
-
-
- Other Versions
- Click to view other versions
-
-
-
-
-
- License
- {{ pkg.manifest.license }}
-
-
-
-
-
- Instructions
- Click to view instructions
-
-
-
-
+
+
-
-
-
-
- Source Repository
- {{ pkg.manifest['upstream-repo'] }}
-
-
-
-
-
- Wrapper Repository
- {{ pkg.manifest['wrapper-repo'] }}
-
-
-
-
-
- Support Site
- {{ pkg.manifest['support-site'] }}
-
-
-
-
-
- Marketing Site
- {{ pkg.manifest['marketing-site'] }}
-
-
-
-
-
- Donation Site
- {{ donationUrl }}
-
-
-
-
+
+
+
+ Install
+
+
+
+
+
+
+ Update
+
+
+ Downgrade
+
+
+
-
-
+
+
+
+
+
+
+
+
+ {{ rec.dependentTitle }}
+
+
+
{{ rec.description }}
+
{{ pkg.manifest.title }} version {{ pkg.manifest.version | displayEmver }} is compatible.
+
{{ pkg.manifest.title }} version {{ pkg.manifest.version | displayEmver }} is NOT compatible.
+
+
+
+
+
+
+
+
+
+
+ New in {{ pkg.manifest.version | displayEmver }}
+
+ All Release Notes
+
+
+
+
+
+
+
+
+
+ Description
+
+
+ {{ pkg.manifest.description.long }}
+
+
+
+
+ Dependencies
+
+
+
+
+
+
+
+
+
+ {{ pkg['dependency-metadata'][dep.key].title }}
+ (recommended)
+
+ {{ dep.value.version | displayEmver }}
+ {{ dep.value.description }}
+
+
+
+
+
+
+
+
+ Additional Info
+
+
+
+
+
+
+
+ Service ID
+ {{ pkg.manifest.id }}
+
+
+
+
+ Categories
+ {{ pkg.categories.join(', ') }}
+
+
+
+
+ Other Versions
+ Click to view other versions
+
+
+
+
+
+ License
+ {{ pkg.manifest.license }}
+
+
+
+
+
+ Instructions
+ Click to view instructions
+
+
+
+
+
+
+
+
+
+ Source Repository
+ {{ pkg.manifest['upstream-repo'] }}
+
+
+
+
+
+ Wrapper Repository
+ {{ pkg.manifest['wrapper-repo'] }}
+
+
+
+
+
+ Support Site
+ {{ pkg.manifest['support-site'] }}
+
+
+
+
+
+ Marketing Site
+ {{ pkg.manifest['marketing-site'] }}
+
+
+
+
+
+ Donation Site
+ {{ donationUrl }}
+
+
+
+
+
+
+
+
+
+
diff --git a/ui/src/app/pages/marketplace-routes/marketplace-show/marketplace-show.page.ts b/ui/src/app/pages/marketplace-routes/marketplace-show/marketplace-show.page.ts
index 32f73abca..9963d457e 100644
--- a/ui/src/app/pages/marketplace-routes/marketplace-show/marketplace-show.page.ts
+++ b/ui/src/app/pages/marketplace-routes/marketplace-show/marketplace-show.page.ts
@@ -1,12 +1,13 @@
import { Component, ViewChild } from '@angular/core'
import { ActivatedRoute } from '@angular/router'
-import { AlertController, IonContent, ModalController, NavController } from '@ionic/angular'
+import { AlertController, IonContent, ModalController, NavController, ToastController } from '@ionic/angular'
import { wizardModal } from 'src/app/components/install-wizard/install-wizard.component'
import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards'
import { Emver } from 'src/app/services/emver.service'
import { displayEmver } from 'src/app/pipes/emver.pipe'
import { pauseFor, Recommendation } from 'src/app/util/misc.util'
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
+import { ErrorToastService } from 'src/app/services/error-toast.service'
import { PackageDataEntry, PackageState } from 'src/app/services/patch-db/data-model'
import { MarketplaceService } from '../marketplace.service'
import { Subscription } from 'rxjs'
@@ -19,7 +20,7 @@ import { MarkdownPage } from 'src/app/modals/markdown/markdown.page'
})
export class MarketplaceShowPage {
@ViewChild(IonContent) content: IonContent
- error = ''
+ loading = true
pkgId: string
installedPkg: PackageDataEntry
PackageState = PackageState
@@ -32,11 +33,12 @@ export class MarketplaceShowPage {
private readonly route: ActivatedRoute,
private readonly alertCtrl: AlertController,
private readonly modalCtrl: ModalController,
+ private readonly errToast: ErrorToastService,
private readonly wizardBaker: WizardBaker,
private readonly navCtrl: NavController,
private readonly emver: Emver,
private readonly patch: PatchDbModel,
- public readonly marketplaceService: MarketplaceService,
+ private readonly marketplaceService: MarketplaceService,
) { }
async ngOnInit () {
@@ -66,7 +68,10 @@ export class MarketplaceShowPage {
await this.marketplaceService.setPkg(this.pkgId, version)
} catch (e) {
console.error(e)
- this.error = e.message
+ this.errToast.present(e.message)
+ } finally {
+ await pauseFor(100)
+ this.loading = false
}
}
diff --git a/ui/src/app/pages/notifications/notifications.page.html b/ui/src/app/pages/notifications/notifications.page.html
index 03ea404d9..db6deade7 100644
--- a/ui/src/app/pages/notifications/notifications.page.html
+++ b/ui/src/app/pages/notifications/notifications.page.html
@@ -11,15 +11,10 @@
-
-
- {{ error }}
-
-
diff --git a/ui/src/app/pages/notifications/notifications.page.ts b/ui/src/app/pages/notifications/notifications.page.ts
index f39afcf28..9b92d657d 100644
--- a/ui/src/app/pages/notifications/notifications.page.ts
+++ b/ui/src/app/pages/notifications/notifications.page.ts
@@ -4,6 +4,7 @@ import { LoaderService } from 'src/app/services/loader.service'
import { ServerNotification, ServerNotifications } from 'src/app/services/api/api-types'
import { AlertController } from '@ionic/angular'
import { ActivatedRoute } from '@angular/router'
+import { ErrorToastService } from 'src/app/services/error-toast.service'
@Component({
selector: 'notifications',
@@ -11,7 +12,6 @@ import { ActivatedRoute } from '@angular/router'
styleUrls: ['notifications.page.scss'],
})
export class NotificationsPage {
- error = ''
loading = true
notifications: ServerNotifications = []
page = 1
@@ -22,6 +22,7 @@ export class NotificationsPage {
constructor (
private readonly apiService: ApiService,
private readonly loader: LoaderService,
+ private readonly errToast: ErrorToastService,
private readonly alertCtrl: AlertController,
private readonly route: ActivatedRoute,
) { }
@@ -50,10 +51,9 @@ export class NotificationsPage {
notifications = await this.apiService.getNotifications({ page: this.page, 'per-page': this.perPage })
this.needInfinite = notifications.length >= this.perPage
this.page++
- this.error = ''
} catch (e) {
console.error(e)
- this.error = e.message
+ this.errToast.present(e.message)
} finally {
return notifications
}
@@ -67,11 +67,10 @@ export class NotificationsPage {
}).displayDuringP(
this.apiService.deleteNotification({ id }).then(() => {
this.notifications.splice(index, 1)
- this.error = ''
}),
).catch(e => {
console.error(e)
- this.error = e.message
+ this.errToast.present(e.message)
})
}
diff --git a/ui/src/app/pages/server-routes/developer-routes/dev-ssh-keys/dev-ssh-keys.module.ts b/ui/src/app/pages/server-routes/developer-routes/dev-ssh-keys/dev-ssh-keys.module.ts
index c5602b137..290229ab1 100644
--- a/ui/src/app/pages/server-routes/developer-routes/dev-ssh-keys/dev-ssh-keys.module.ts
+++ b/ui/src/app/pages/server-routes/developer-routes/dev-ssh-keys/dev-ssh-keys.module.ts
@@ -5,6 +5,7 @@ import { RouterModule, Routes } from '@angular/router'
import { DevSSHKeysPage } from './dev-ssh-keys.page'
import { PwaBackComponentModule } from 'src/app/components/pwa-back-button/pwa-back.component.module'
import { SharingModule } from 'src/app/modules/sharing.module'
+import { TextSpinnerComponentModule } from 'src/app/components/text-spinner/text-spinner.component.module'
const routes: Routes = [
{
@@ -20,6 +21,7 @@ const routes: Routes = [
RouterModule.forChild(routes),
PwaBackComponentModule,
SharingModule,
+ TextSpinnerComponentModule,
],
declarations: [DevSSHKeysPage],
})
diff --git a/ui/src/app/pages/server-routes/developer-routes/dev-ssh-keys/dev-ssh-keys.page.html b/ui/src/app/pages/server-routes/developer-routes/dev-ssh-keys/dev-ssh-keys.page.html
index 45e1ad0f1..b851aa581 100644
--- a/ui/src/app/pages/server-routes/developer-routes/dev-ssh-keys/dev-ssh-keys.page.html
+++ b/ui/src/app/pages/server-routes/developer-routes/dev-ssh-keys/dev-ssh-keys.page.html
@@ -13,11 +13,7 @@
-
- {{ error }}
-
-
-
+
Saved Keys
diff --git a/ui/src/app/pages/server-routes/developer-routes/dev-ssh-keys/dev-ssh-keys.page.ts b/ui/src/app/pages/server-routes/developer-routes/dev-ssh-keys/dev-ssh-keys.page.ts
index 91e7b8ffc..3383bd6d3 100644
--- a/ui/src/app/pages/server-routes/developer-routes/dev-ssh-keys/dev-ssh-keys.page.ts
+++ b/ui/src/app/pages/server-routes/developer-routes/dev-ssh-keys/dev-ssh-keys.page.ts
@@ -5,6 +5,7 @@ import { LoaderService } from 'src/app/services/loader.service'
import { SSHService } from './ssh.service'
import { Subscription } from 'rxjs'
import { SSHKeys } from 'src/app/services/api/api-types'
+import { ErrorToastService } from 'src/app/services/error-toast.service'
@Component({
selector: 'dev-ssh-keys',
@@ -12,21 +13,19 @@ import { SSHKeys } from 'src/app/services/api/api-types'
styleUrls: ['dev-ssh-keys.page.scss'],
})
export class DevSSHKeysPage {
- error = ''
loading = true
sshKeys: SSHKeys
subs: Subscription[] = []
constructor (
private readonly loader: LoaderService,
+ private readonly errToast: ErrorToastService,
private readonly serverConfigService: ServerConfigService,
private readonly alertCtrl: AlertController,
private readonly sshService: SSHService,
) { }
async ngOnInit () {
- await this.sshService.getKeys()
-
this.subs = [
this.sshService.watch$()
.subscribe(keys => {
@@ -34,6 +33,8 @@ export class DevSSHKeysPage {
}),
]
+ await this.sshService.getKeys()
+
this.loading = false
}
@@ -68,7 +69,6 @@ export class DevSSHKeysPage {
}
async delete (hash: string): Promise {
- this.error = ''
this.loader.of({
message: 'Deleting...',
spinner: 'lines',
@@ -77,7 +77,7 @@ export class DevSSHKeysPage {
await this.sshService.delete(hash)
}).catch(e => {
console.error(e)
- this.error = ''
+ this.errToast.present(e.message)
})
}
diff --git a/ui/src/app/pages/server-routes/server-backup/server-backup.module.ts b/ui/src/app/pages/server-routes/server-backup/server-backup.module.ts
index 5d7a5efc1..7a411305d 100644
--- a/ui/src/app/pages/server-routes/server-backup/server-backup.module.ts
+++ b/ui/src/app/pages/server-routes/server-backup/server-backup.module.ts
@@ -5,6 +5,7 @@ import { ServerBackupPage } from './server-backup.page'
import { RouterModule, Routes } from '@angular/router'
import { BackupConfirmationComponentModule } from 'src/app/modals/backup-confirmation/backup-confirmation.component.module'
import { PwaBackComponentModule } from 'src/app/components/pwa-back-button/pwa-back.component.module'
+import { TextSpinnerComponentModule } from 'src/app/components/text-spinner/text-spinner.component.module'
const routes: Routes = [
{
@@ -20,6 +21,7 @@ const routes: Routes = [
RouterModule.forChild(routes),
BackupConfirmationComponentModule,
PwaBackComponentModule,
+ TextSpinnerComponentModule,
],
declarations: [
ServerBackupPage,
diff --git a/ui/src/app/pages/server-routes/server-backup/server-backup.page.html b/ui/src/app/pages/server-routes/server-backup/server-backup.page.html
index 5798aadc8..426bfa35a 100644
--- a/ui/src/app/pages/server-routes/server-backup/server-backup.page.html
+++ b/ui/src/app/pages/server-routes/server-backup/server-backup.page.html
@@ -13,12 +13,7 @@
-
-
- {{ error }}
-
-
-
+
diff --git a/ui/src/app/pages/server-routes/server-logs/server-logs.module.ts b/ui/src/app/pages/server-routes/server-logs/server-logs.module.ts
index 2640d0619..e1a7b0490 100644
--- a/ui/src/app/pages/server-routes/server-logs/server-logs.module.ts
+++ b/ui/src/app/pages/server-routes/server-logs/server-logs.module.ts
@@ -4,6 +4,7 @@ import { Routes, RouterModule } from '@angular/router'
import { IonicModule } from '@ionic/angular'
import { ServerLogsPage } from './server-logs.page'
import { PwaBackComponentModule } from 'src/app/components/pwa-back-button/pwa-back.component.module'
+import { TextSpinnerComponentModule } from 'src/app/components/text-spinner/text-spinner.component.module'
const routes: Routes = [
{
@@ -18,6 +19,7 @@ const routes: Routes = [
IonicModule,
RouterModule.forChild(routes),
PwaBackComponentModule,
+ TextSpinnerComponentModule,
],
declarations: [ServerLogsPage],
})
diff --git a/ui/src/app/pages/server-routes/server-logs/server-logs.page.html b/ui/src/app/pages/server-routes/server-logs/server-logs.page.html
index c1b8be35c..6747d77a8 100644
--- a/ui/src/app/pages/server-routes/server-logs/server-logs.page.html
+++ b/ui/src/app/pages/server-routes/server-logs/server-logs.page.html
@@ -13,11 +13,7 @@
-
- {{ error }}
-
-
-
+
{{ logs }}
diff --git a/ui/src/app/pages/server-routes/server-logs/server-logs.page.ts b/ui/src/app/pages/server-routes/server-logs/server-logs.page.ts
index dde826239..f0b79c93c 100644
--- a/ui/src/app/pages/server-routes/server-logs/server-logs.page.ts
+++ b/ui/src/app/pages/server-routes/server-logs/server-logs.page.ts
@@ -1,6 +1,7 @@
import { Component, ViewChild } from '@angular/core'
import { ApiService } from 'src/app/services/api/api.service'
import { IonContent } from '@ionic/angular'
+import { ErrorToastService } from 'src/app/services/error-toast.service'
@Component({
selector: 'server-logs',
@@ -10,10 +11,10 @@ import { IonContent } from '@ionic/angular'
export class ServerLogsPage {
@ViewChild(IonContent, { static: false }) private content: IonContent
loading = true
- error = ''
logs: string
constructor (
+ private readonly errToast: ErrorToastService,
private readonly apiService: ApiService,
) { }
@@ -27,11 +28,10 @@ export class ServerLogsPage {
try {
const logs = await this.apiService.getServerLogs({ })
this.logs = logs.map(l => `${l.timestamp} ${l.log}`).join('\n\n')
- this.error = ''
setTimeout(async () => await this.content.scrollToBottom(100), 200)
} catch (e) {
console.error(e)
- this.error = e.message
+ this.errToast.present(e.message)
} finally {
this.loading = false
}
diff --git a/ui/src/app/pages/server-routes/server-metrics/server-metrics.module.ts b/ui/src/app/pages/server-routes/server-metrics/server-metrics.module.ts
index a15976226..5cc4b27bb 100644
--- a/ui/src/app/pages/server-routes/server-metrics/server-metrics.module.ts
+++ b/ui/src/app/pages/server-routes/server-metrics/server-metrics.module.ts
@@ -4,6 +4,7 @@ import { Routes, RouterModule } from '@angular/router'
import { IonicModule } from '@ionic/angular'
import { ServerMetricsPage } from './server-metrics.page'
import { PwaBackComponentModule } from 'src/app/components/pwa-back-button/pwa-back.component.module'
+import { TextSpinnerComponentModule } from 'src/app/components/text-spinner/text-spinner.component.module'
const routes: Routes = [
{
@@ -18,6 +19,7 @@ const routes: Routes = [
IonicModule,
RouterModule.forChild(routes),
PwaBackComponentModule,
+ TextSpinnerComponentModule,
],
declarations: [ServerMetricsPage],
})
diff --git a/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.html b/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.html
index ad39aaad3..a114156ae 100644
--- a/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.html
+++ b/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.html
@@ -8,11 +8,7 @@
-
- {{ error }}
-
-
-
+
diff --git a/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.ts b/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.ts
index d2e1e680a..84cd72822 100644
--- a/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.ts
+++ b/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.ts
@@ -1,6 +1,7 @@
import { Component } from '@angular/core'
import { Metrics } from 'src/app/services/api/api-types'
import { ApiService } from 'src/app/services/api/api.service'
+import { ErrorToastService } from 'src/app/services/error-toast.service'
import { pauseFor } from 'src/app/util/misc.util'
@Component({
@@ -9,17 +10,16 @@ import { pauseFor } from 'src/app/util/misc.util'
styleUrls: ['./server-metrics.page.scss'],
})
export class ServerMetricsPage {
- error = ''
loading = true
going = false
metrics: Metrics = { }
constructor (
+ private readonly errToast: ErrorToastService,
private readonly apiService: ApiService,
) { }
ngOnInit () {
- this.loading = false
this.startDaemon()
}
@@ -44,8 +44,10 @@ export class ServerMetricsPage {
this.metrics = await this.apiService.getServerMetrics({ })
} catch (e) {
console.error(e)
- this.error = e.message
+ this.errToast.present(e.message)
this.stopDaemon()
+ } finally {
+ this.loading = false
}
}
diff --git a/ui/src/app/pages/server-routes/wifi/wifi-add/wifi-add.page.html b/ui/src/app/pages/server-routes/wifi/wifi-add/wifi-add.page.html
index c8b50cadf..db9008fa5 100644
--- a/ui/src/app/pages/server-routes/wifi/wifi-add/wifi-add.page.html
+++ b/ui/src/app/pages/server-routes/wifi/wifi-add/wifi-add.page.html
@@ -8,11 +8,6 @@
-
-
- {{ error }}
-
-
Select Country
diff --git a/ui/src/app/pages/server-routes/wifi/wifi-add/wifi-add.page.ts b/ui/src/app/pages/server-routes/wifi/wifi-add/wifi-add.page.ts
index d451e9057..acc86d8d4 100644
--- a/ui/src/app/pages/server-routes/wifi/wifi-add/wifi-add.page.ts
+++ b/ui/src/app/pages/server-routes/wifi/wifi-add/wifi-add.page.ts
@@ -3,6 +3,7 @@ import { NavController } from '@ionic/angular'
import { ApiService } from 'src/app/services/api/api.service'
import { WifiService } from '../wifi.service'
import { LoaderService } from 'src/app/services/loader.service'
+import { ErrorToastService } from 'src/app/services/error-toast.service'
@Component({
selector: 'wifi-add',
@@ -14,17 +15,16 @@ export class WifiAddPage {
countryCode = 'US'
ssid = ''
password = ''
- error = ''
constructor (
private readonly navCtrl: NavController,
+ private readonly errToast: ErrorToastService,
private readonly apiService: ApiService,
private readonly loader: LoaderService,
private readonly wifiService: WifiService,
) { }
async save (): Promise {
- this.error = ''
this.loader.of({
message: 'Saving...',
spinner: 'lines',
@@ -40,12 +40,11 @@ export class WifiAddPage {
this.navCtrl.back()
}).catch(e => {
console.error(e)
- this.error = e.message
+ this.errToast.present(e.message)
})
}
async saveAndConnect (): Promise {
- this.error = ''
this.loader.of({
message: 'Connecting. This could take while...',
spinner: 'lines',
@@ -64,7 +63,7 @@ export class WifiAddPage {
}
}).catch (e => {
console.error(e)
- this.error = e.message
+ this.errToast.present(e.message)
})
}
diff --git a/ui/src/app/pages/server-routes/wifi/wifi.page.html b/ui/src/app/pages/server-routes/wifi/wifi.page.html
index de3dce57c..54ab80ebe 100644
--- a/ui/src/app/pages/server-routes/wifi/wifi.page.html
+++ b/ui/src/app/pages/server-routes/wifi/wifi.page.html
@@ -13,10 +13,6 @@
-
- {{ error }}
-
-
diff --git a/ui/src/app/pages/server-routes/wifi/wifi.page.ts b/ui/src/app/pages/server-routes/wifi/wifi.page.ts
index c27f6c6e7..209ce95fe 100644
--- a/ui/src/app/pages/server-routes/wifi/wifi.page.ts
+++ b/ui/src/app/pages/server-routes/wifi/wifi.page.ts
@@ -7,6 +7,7 @@ import { LoaderService } from 'src/app/services/loader.service'
import { WiFiInfo } from 'src/app/services/patch-db/data-model'
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
import { Subscription } from 'rxjs'
+import { ErrorToastService } from 'src/app/services/error-toast.service'
@Component({
selector: 'wifi',
@@ -14,12 +15,12 @@ import { Subscription } from 'rxjs'
styleUrls: ['wifi.page.scss'],
})
export class WifiListPage {
- error = ''
subs: Subscription[] = []
constructor (
private readonly apiService: ApiService,
private readonly loader: LoaderService,
+ private readonly errToast: ErrorToastService,
private readonly actionCtrl: ActionSheetController,
private readonly wifiService: WifiService,
public readonly patch: PatchDbModel,
@@ -56,7 +57,6 @@ export class WifiListPage {
// Let's add country code here
async connect (ssid: string): Promise {
- this.error = ''
this.loader.of({
message: 'Connecting. This could take while...',
spinner: 'lines',
@@ -66,22 +66,20 @@ export class WifiListPage {
this.wifiService.confirmWifi(ssid)
}).catch(e => {
console.error(e)
- this.error = ''
+ this.errToast.present(e.message)
})
}
async delete (ssid: string): Promise {
- this.error = ''
this.loader.of({
message: 'Deleting...',
spinner: 'lines',
cssClass: 'loader',
}).displayDuringAsync(async () => {
await this.apiService.deleteWifi({ ssid })
- this.error = ''
}).catch(e => {
console.error(e)
- this.error = ''
+ this.errToast.present(e.message)
})
}
}
diff --git a/ui/src/app/services/api/mock-api.service.ts b/ui/src/app/services/api/mock-api.service.ts
index c35592316..a2fb2c275 100644
--- a/ui/src/app/services/api/mock-api.service.ts
+++ b/ui/src/app/services/api/mock-api.service.ts
@@ -494,8 +494,6 @@ export class MockApiService extends ApiService {
const url = `${registryURL}/sys/version/eos`
let eos = await this.http.simpleGet(url)
return (eos as any)
- await pauseFor(2000)
- return Mock.MarketplaceEos
}
async getAvailableList (params: RR.GetAvailableListReq): Promise {
@@ -515,7 +513,7 @@ export class MockApiService extends ApiService {
await pauseFor(2000)
return Mock.AvailableShow[params.id][params.version || 'latest']
}
- const url = `${registryURL}/marketplace/available?id=${params.id}&version=${params.version || '1.3.0'}`
+ const url = `${registryURL}/marketplace/available?id=${params.id}`
let res = await this.http.simpleGet(url)
console.log('res RES RES', res)
return (res as any)
diff --git a/ui/src/app/services/error-toast.service.ts b/ui/src/app/services/error-toast.service.ts
new file mode 100644
index 000000000..e9cc948e8
--- /dev/null
+++ b/ui/src/app/services/error-toast.service.ts
@@ -0,0 +1,47 @@
+import { Injectable } from '@angular/core'
+import { IonicSafeString, ToastController } from '@ionic/angular'
+import { ToastButton } from '@ionic/core'
+
+@Injectable({
+ providedIn: 'root',
+})
+export class ErrorToastService {
+ private toast: HTMLIonToastElement
+
+ constructor (
+ private readonly toastCtrl: ToastController,
+ ) { }
+
+ async present (message: string | IonicSafeString, link?: string): Promise {
+ if (this.toast) return
+
+ if (link) {
+ message = new IonicSafeString(message + `
Get Help`)
+ }
+
+ this.toast = await this.toastCtrl.create({
+ header: 'Error',
+ message,
+ duration: 0,
+ position: 'top',
+ cssClass: 'error-toast',
+ buttons: [
+ {
+ side: 'end',
+ icon: 'close',
+ handler: () => {
+ this.dismiss()
+ },
+ },
+ ],
+ })
+ await this.toast.present()
+ }
+
+ async dismiss (): Promise {
+ if (this.toast) {
+ await this.toast.dismiss()
+ this.toast = undefined
+ }
+ }
+}
\ No newline at end of file
diff --git a/ui/src/global.scss b/ui/src/global.scss
index 97d0cda0a..218a0dbe8 100644
--- a/ui/src/global.scss
+++ b/ui/src/global.scss
@@ -73,6 +73,16 @@ ion-toast {
--border-color: var(--ion-color-warning);
}
+.error-toast {
+ --border-color: var(--ion-color-danger);
+ width: 40%;
+ min-width: 400px;
+ --end: 8px;
+ right: 8px;
+ left: unset;
+ top: 64px;
+}
+
.sublist-spinner {
text-align: center;
margin-top: 40px;