diff --git a/ui/src/app/pages/apps-routes/app-manifest/app-manifest.module.ts b/ui/src/app/pages/apps-routes/app-manifest/app-manifest.module.ts index ebdb23287..f794d3178 100644 --- a/ui/src/app/pages/apps-routes/app-manifest/app-manifest.module.ts +++ b/ui/src/app/pages/apps-routes/app-manifest/app-manifest.module.ts @@ -5,6 +5,7 @@ import { IonicModule } from '@ionic/angular' import { AppManifestPage } from './app-manifest.page' import { PwaBackComponentModule } from 'src/app/components/pwa-back-button/pwa-back.component.module' import { SharingModule } from 'src/app/modules/sharing.module' +import { FormsModule } from '@angular/forms' const routes: Routes = [ { @@ -17,6 +18,7 @@ const routes: Routes = [ imports: [ CommonModule, IonicModule, + FormsModule, RouterModule.forChild(routes), PwaBackComponentModule, SharingModule, diff --git a/ui/src/app/pages/apps-routes/app-manifest/app-manifest.page.html b/ui/src/app/pages/apps-routes/app-manifest/app-manifest.page.html index 56d21aa7d..00498f28c 100644 --- a/ui/src/app/pages/apps-routes/app-manifest/app-manifest.page.html +++ b/ui/src/app/pages/apps-routes/app-manifest/app-manifest.page.html @@ -3,43 +3,65 @@ - Manifest + Package Manifest + + + + + Formatted + + + Raw + + - - - {{ error }} - - - -
- - - - -

{{ prop.key }}

-
-
-
- - - - -

{{ prop.key }}

-

{{ prop.value }}

-
-
-
-
-
- - - - - {{ prop }} - - - + + +
+ + Formatted Manifest + + + + + + + + +
+ + + + +

{{ prop.key }}

+
+
+
+ + + + +

{{ prop.key }}

+

{{ prop.value }}

+
+
+
+
+
+ + + + + {{ prop }} + + + +
+ +
+

+  
diff --git a/ui/src/app/pages/apps-routes/app-manifest/app-manifest.page.scss b/ui/src/app/pages/apps-routes/app-manifest/app-manifest.page.scss index eea898305..3d34b4d98 100644 --- a/ui/src/app/pages/apps-routes/app-manifest/app-manifest.page.scss +++ b/ui/src/app/pages/apps-routes/app-manifest/app-manifest.page.scss @@ -1,3 +1,8 @@ -.metric-note { - font-size: 16px; +.raw { + background-color: var(--ion-color-light); + pre { + margin: 0; + padding: 12px; + white-space: pre-wrap; + } } \ No newline at end of file diff --git a/ui/src/app/pages/apps-routes/app-manifest/app-manifest.page.ts b/ui/src/app/pages/apps-routes/app-manifest/app-manifest.page.ts index 52e3280e2..e8079bcf3 100644 --- a/ui/src/app/pages/apps-routes/app-manifest/app-manifest.page.ts +++ b/ui/src/app/pages/apps-routes/app-manifest/app-manifest.page.ts @@ -1,12 +1,10 @@ import { Component } from '@angular/core' import { ActivatedRoute } from '@angular/router' -import { NavController } from '@ionic/angular' -import * as JsonPointer from 'json-pointer' import { Subscription } from 'rxjs' -import { distinctUntilChanged } from 'rxjs/operators' import { PackageDataEntry } from 'src/app/models/patch-db/data-model' import { PatchDbModel } from 'src/app/models/patch-db/patch-db-model' import { getManifest } from 'src/app/services/config.service' +import * as JsonPointer from 'json-pointer' @Component({ selector: 'app-manifest', @@ -19,11 +17,11 @@ export class AppManifestPage { pointer: string node: object subs: Subscription[] + segmentValue: 'formatted' | 'raw' = 'formatted' constructor ( private readonly route: ActivatedRoute, private readonly patch: PatchDbModel, - private readonly navCtrl: NavController, ) { } ngOnInit () { @@ -35,12 +33,6 @@ export class AppManifestPage { this.pkg = pkg this.setNode() }), - this.route.queryParams - .pipe(distinctUntilChanged()) - .subscribe(queryParams => { - this.pointer = queryParams['pointer'] - this.setNode() - }), ] this.setNode() @@ -50,16 +42,20 @@ export class AppManifestPage { this.subs.forEach(sub => sub.unsubscribe()) } - setNode () { + handleFormattedBack () { + const arr = this.pointer.split('/') + arr.pop() + this.pointer = arr.join('/') + this.setNode() + } + + private setNode () { this.node = JsonPointer.get(getManifest(this.pkg), this.pointer || '') } async goToNested (key: string): Promise { - this.navCtrl.navigateForward(`/services/installed/${this.pkgId}/manifest`, { - queryParams: { - pointer: `${this.pointer || ''}/${key}`, - }, - }) + this.pointer = `${this.pointer || ''}/${key}` + this.setNode() } asIsOrder (a: any, b: any) { diff --git a/ui/src/app/pages/apps-routes/app-metrics/app-metrics.page.html b/ui/src/app/pages/apps-routes/app-metrics/app-metrics.page.html index fb91e66cc..34350b04b 100644 --- a/ui/src/app/pages/apps-routes/app-metrics/app-metrics.page.html +++ b/ui/src/app/pages/apps-routes/app-metrics/app-metrics.page.html @@ -3,7 +3,7 @@ - Monitor + Health diff --git a/ui/src/app/pages/apps-routes/app-restore/app-restore.page.html b/ui/src/app/pages/apps-routes/app-restore/app-restore.page.html index 7790679ef..fca076785 100644 --- a/ui/src/app/pages/apps-routes/app-restore/app-restore.page.html +++ b/ui/src/app/pages/apps-routes/app-restore/app-restore.page.html @@ -3,7 +3,7 @@ - Restore From Backup + Restore Backup