-
- Installed
- Update Available
+
+
+ Installed
+ Update Available
-
+
Installing
-
+
Updating
-
+
Removing
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 6c96faf0e..b1718f32c 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
@@ -42,7 +42,7 @@
- Installed at {{ installedPkg.installed.manifest.version | displayEmver }}
+ Installed at {{ installedPkg.manifest.version | displayEmver }}
@@ -59,10 +59,10 @@
-
+
Update
-
+
Downgrade
diff --git a/ui/src/app/pipes/display-bulb.pipe.ts b/ui/src/app/pipes/display-bulb.pipe.ts
deleted file mode 100644
index 6457360ef..000000000
--- a/ui/src/app/pipes/display-bulb.pipe.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { Pipe, PipeTransform } from '@angular/core'
-import { combineLatest, Observable } from 'rxjs'
-import { map } from 'rxjs/operators'
-import { PatchDbModel } from '../services/patch-db/patch-db.service'
-import { renderPkgStatus } from '../services/pkg-status-rendering.service'
-
-@Pipe({
- name: 'displayBulb',
-})
-export class DisplayBulbPipe implements PipeTransform {
-
- constructor (
- private readonly patch: PatchDbModel,
- ) { }
-
- transform (pkgId: string, bulb: DisplayBulb, connected: boolean): Observable {
- return combineLatest([
- this.patch.watch$('package-data', pkgId, 'state'),
- this.patch.watch$('package-data', pkgId, 'installed', 'status'),
- ])
- .pipe(
- map(([state, status]) => {
- if (!connected) return bulb === 'off'
- const { color } = renderPkgStatus(state, status)
- switch (color) {
- case 'danger': return bulb === 'red'
- case 'success': return bulb === 'green'
- case 'warning': return bulb === 'yellow'
- default: return bulb === 'off'
- }
- }),
- )
- }
-}
-
-type DisplayBulb = 'off' | 'red' | 'green' | 'yellow'
diff --git a/ui/src/app/pipes/ui.pipe.ts b/ui/src/app/pipes/ui.pipe.ts
index f3a36b903..e2d241700 100644
--- a/ui/src/app/pipes/ui.pipe.ts
+++ b/ui/src/app/pipes/ui.pipe.ts
@@ -24,13 +24,3 @@ export class LaunchablePipe implements PipeTransform {
return this.configService.isLaunchable(pkg)
}
}
-
-@Pipe({
- name: 'manifest',
-})
-export class ManifestPipe implements PipeTransform {
-
- transform (pkg: PackageDataEntry): Manifest {
- return getManifest(pkg)
- }
-}
diff --git a/ui/src/app/services/api/mock-api.service.ts b/ui/src/app/services/api/mock-api.service.ts
index 5efe3b4a4..534582a98 100644
--- a/ui/src/app/services/api/mock-api.service.ts
+++ b/ui/src/app/services/api/mock-api.service.ts
@@ -307,7 +307,6 @@ export class MockApiService extends ApiService {
const pkg: PackageDataEntry = {
...Mock.bitcoinproxy,
state: PackageState.Installing,
- 'temp-manifest': Mock.MockManifestBitcoinProxy,
// installed: undefined,
'install-progress': {
size: 100,
diff --git a/ui/src/app/services/api/mock-app-fixures.ts b/ui/src/app/services/api/mock-app-fixures.ts
index 0dbbbf708..b0ef9f060 100644
--- a/ui/src/app/services/api/mock-app-fixures.ts
+++ b/ui/src/app/services/api/mock-app-fixures.ts
@@ -578,12 +578,11 @@ export module Mock {
icon: 'assets/img/service-icons/bitcoind.png',
instructions: 'instructionsUrl', // /public/package-data/bitcoind/0.21.1/INSTRUCTIONS.md
},
- 'temp-manifest': undefined,
+ manifest: {
+ ...MockManifestBitcoind,
+ version: '0.20.0',
+ },
installed: {
- manifest: {
- ...MockManifestBitcoind,
- version: '0.20.0',
- },
status: {
configured: true,
main: {
@@ -629,9 +628,8 @@ export module Mock {
icon: 'assets/img/service-icons/lnd.png',
instructions: 'instructionsUrl', // /public/package-data/lnd/0.21.1/INSTRUCTIONS.md
},
- 'temp-manifest': undefined,
+ manifest: MockManifestLnd,
installed: {
- manifest: MockManifestLnd,
status: {
configured: true,
main: {
@@ -681,9 +679,8 @@ export module Mock {
icon: 'assets/img/service-icons/bitcoin-proxy.png',
instructions: 'instructionsUrl', // /public/package-data/bitcoinproxy/0.2.2/INSTRUCTIONS.md
},
- 'temp-manifest': undefined,
+ manifest: MockManifestBitcoinProxy,
installed: {
- manifest: MockManifestBitcoinProxy,
status: {
configured: true,
main: {
diff --git a/ui/src/app/services/config.service.ts b/ui/src/app/services/config.service.ts
index 909501c45..0cd286032 100644
--- a/ui/src/app/services/config.service.ts
+++ b/ui/src/app/services/config.service.ts
@@ -53,16 +53,14 @@ export class ConfigService {
return false
}
- const installed = pkg.installed
-
- return installed.status.main.status === PackageMainStatus.Running &&
+ return pkg.installed.status.main.status === PackageMainStatus.Running &&
(
- (hasTorUi(installed.manifest.interfaces) && this.isTor()) ||
- (hasLanUi(installed.manifest.interfaces) && !this.isTor())
+ (hasTorUi(pkg.manifest.interfaces) && this.isTor()) ||
+ (hasLanUi(pkg.manifest.interfaces) && !this.isTor())
)
}
- launchableURL (pkg: InstalledPackageDataEntry): string {
+ launchableURL (pkg: PackageDataEntry): string {
return this.isTor() ? `http://${torUiAddress(pkg)}` : `https://${lanUiAddress(pkg)}`
}
}
@@ -75,7 +73,7 @@ export function hasLanUi (interfaces: { [id: string]: InterfaceDef }): boolean {
return !!Object.values(interfaces).find(i => i.ui && i['lan-config'])
}
-export function torUiAddress (pkg: InstalledPackageDataEntry): string {
+export function torUiAddress (pkg: PackageDataEntry): string {
const interfaces = pkg.manifest.interfaces
const id = Object.keys(interfaces).find(key => {
const val = interfaces[key]
@@ -84,7 +82,7 @@ export function torUiAddress (pkg: InstalledPackageDataEntry): string {
return pkg['interface-info'].addresses[id]['tor-address']
}
-export function lanUiAddress (pkg: InstalledPackageDataEntry): string {
+export function lanUiAddress (pkg: PackageDataEntry): string {
const interfaces = pkg.manifest.interfaces
const id = Object.keys(interfaces).find(key => {
const val = interfaces[key]
@@ -99,7 +97,7 @@ export function hasUi (interfaces: { [id: string]: InterfaceDef }): boolean {
export function getManifest (pkg: PackageDataEntry): Manifest {
if (pkg.state === PackageState.Installed) {
- return pkg.installed.manifest
+ return pkg.manifest
}
return pkg['temp-manifest']
}
diff --git a/ui/src/app/services/connection.service.ts b/ui/src/app/services/connection.service.ts
index 2eb225491..cbd9007d8 100644
--- a/ui/src/app/services/connection.service.ts
+++ b/ui/src/app/services/connection.service.ts
@@ -39,7 +39,7 @@ export class ConnectionService {
this.connectionFailure$.next(ConnectionFailure.Network)
} else if (!this.configService.isTor()) {
this.connectionFailure$.next(ConnectionFailure.Lan)
- } {
+ } else {
// diagnosing
this.connectionFailure$.next(ConnectionFailure.Diagnosing)
const torSuccess = await this.testAddrs(addrs?.tor || [])
diff --git a/ui/src/app/services/patch-db/data-model.ts b/ui/src/app/services/patch-db/data-model.ts
index 1e825b03e..77aaffd02 100644
--- a/ui/src/app/services/patch-db/data-model.ts
+++ b/ui/src/app/services/patch-db/data-model.ts
@@ -46,7 +46,7 @@ export interface PackageDataEntry {
instructions: URL
icon: URL
}
- 'temp-manifest'?: Manifest // exists when: installing, updating, removing
+ manifest: Manifest
installed?: InstalledPackageDataEntry, // exists when: installed, updating
'install-progress'?: InstallProgress, // exists when: installing, updating
}
@@ -62,7 +62,6 @@ export interface InstallProgress {
}
export interface InstalledPackageDataEntry {
- manifest: Manifest
status: Status
'interface-info': InterfaceInfo
'system-pointers': any[]
diff --git a/ui/src/assets/img/issue-bulb.png b/ui/src/assets/img/danger-bulb.png
similarity index 100%
rename from ui/src/assets/img/issue-bulb.png
rename to ui/src/assets/img/danger-bulb.png
diff --git a/ui/src/assets/img/running-bulb.png b/ui/src/assets/img/success-bulb.png
similarity index 100%
rename from ui/src/assets/img/running-bulb.png
rename to ui/src/assets/img/success-bulb.png