mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
Rework install progress types and pipes for clarity (#1513)
* rework install progress types and pipes for clarity * rework marketplace show display Co-authored-by: Matt Hill <matthill@Matt-M1.local>
This commit is contained in:
@@ -63,7 +63,7 @@ This section enables you to run a local frontend with a remote backend (eg. host
|
|||||||
2. Create a proxy configuration file from the sample:
|
2. Create a proxy configuration file from the sample:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cp proxy.conf.json.sample proxy.conf.json
|
cp proxy.conf-sample.json proxy.conf.json
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Change the target address to desired IP address in `proxy.conf.json`
|
3. Change the target address to desired IP address in `proxy.conf.json`
|
||||||
|
|||||||
@@ -1,22 +1,12 @@
|
|||||||
<ion-grid>
|
<div class="header montserrat">
|
||||||
<ion-row>
|
<img
|
||||||
<ion-col sizeXs="12" sizeSm="12" sizeMd="9" sizeLg="9" sizeXl="9">
|
class="logo"
|
||||||
<div class="header montserrat">
|
alt=""
|
||||||
<img
|
[src]="'data:image/png;base64,' + pkg.icon | trustUrl"
|
||||||
class="logo"
|
/>
|
||||||
alt=""
|
<div class="text">
|
||||||
[src]="'data:image/png;base64,' + pkg.icon | trustUrl"
|
<h1 class="title">{{ pkg.manifest.title }}</h1>
|
||||||
/>
|
<p class="version">{{ pkg.manifest.version | displayEmver }}</p>
|
||||||
<div class="text">
|
<ng-content></ng-content>
|
||||||
<h1 class="title">{{ pkg.manifest.title }}</h1>
|
</div>
|
||||||
<p class="version">{{ pkg.manifest.version | displayEmver }}</p>
|
</div>
|
||||||
<ng-content></ng-content>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ion-col>
|
|
||||||
<ion-col sizeMd="3" sizeXs="12" class="ion-align-self-center">
|
|
||||||
<ng-content select="[position=controls]"></ng-content>
|
|
||||||
</ion-col>
|
|
||||||
</ion-row>
|
|
||||||
<ng-content select="ion-row"></ng-content>
|
|
||||||
</ion-grid>
|
|
||||||
|
|||||||
@@ -1,25 +1,38 @@
|
|||||||
.header {
|
.header {
|
||||||
padding: 2%;
|
padding: 16px;
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
|
||||||
min-width: 15%;
|
|
||||||
max-width: 18%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
margin-left: 5%;
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
width: 80px;
|
||||||
|
margin-right: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
margin: 0 0 0 -2px;
|
margin: 0 0 0 -2px;
|
||||||
font-size: calc(20px + 3vw);
|
font-size: 36px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.version {
|
.version {
|
||||||
padding: 4px 0 12px 0;
|
padding: 4px 0 12px 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: calc(10px + 1vw);
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1000px) {
|
||||||
|
.logo {
|
||||||
|
width: 140px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 64px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.version {
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,13 +18,12 @@
|
|||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="installProgress">
|
<span *ngIf="installProgress">
|
||||||
<span *ngIf="installProgress < 99">
|
<ion-text
|
||||||
|
*ngIf="installProgress | installProgressDisplay as progress"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
Installing
|
Installing
|
||||||
<span class="loading-dots"></span>{{ installProgress }}%
|
<span class="loading-dots"></span>{{ progress }}
|
||||||
</span>
|
</ion-text>
|
||||||
<span *ngIf="installProgress >= 99">
|
|
||||||
Finalizing install. This could take a minute
|
|
||||||
<span class="loading-dots"></span>
|
|
||||||
</span>
|
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -3,10 +3,16 @@ import { CommonModule } from '@angular/common'
|
|||||||
import { IonicModule } from '@ionic/angular'
|
import { IonicModule } from '@ionic/angular'
|
||||||
import { UnitConversionPipesModule } from '@start9labs/shared'
|
import { UnitConversionPipesModule } from '@start9labs/shared'
|
||||||
import { StatusComponent } from './status.component'
|
import { StatusComponent } from './status.component'
|
||||||
|
import { InstallProgressPipeModule } from 'src/app/pipes/install-progress/install-progress.module'
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [StatusComponent],
|
declarations: [StatusComponent],
|
||||||
imports: [CommonModule, IonicModule, UnitConversionPipesModule],
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
IonicModule,
|
||||||
|
UnitConversionPipesModule,
|
||||||
|
InstallProgressPipeModule,
|
||||||
|
],
|
||||||
exports: [StatusComponent],
|
exports: [StatusComponent],
|
||||||
})
|
})
|
||||||
export class StatusComponentModule {}
|
export class StatusComponentModule {}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Component, Input } from '@angular/core'
|
import { Component, Input } from '@angular/core'
|
||||||
|
import { InstallProgress } from 'src/app/services/patch-db/data-model'
|
||||||
import {
|
import {
|
||||||
PrimaryRendering,
|
PrimaryRendering,
|
||||||
PrimaryStatus,
|
PrimaryStatus,
|
||||||
@@ -19,6 +20,6 @@ export class StatusComponent {
|
|||||||
@Input() style?: string = 'regular'
|
@Input() style?: string = 'regular'
|
||||||
@Input() weight?: string = 'normal'
|
@Input() weight?: string = 'normal'
|
||||||
@Input() disconnected?: boolean = false
|
@Input() disconnected?: boolean = false
|
||||||
@Input() installProgress?: number
|
@Input() installProgress?: InstallProgress
|
||||||
@Input() sigtermTimeout?: string | null = null
|
@Input() sigtermTimeout?: string | null = null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<status
|
<status
|
||||||
[disconnected]="connectionFailure"
|
[disconnected]="connectionFailure"
|
||||||
[rendering]="pkg.primaryRendering"
|
[rendering]="pkg.primaryRendering"
|
||||||
[installProgress]="pkg.installProgress?.totalProgress"
|
[installProgress]="pkg.entry['install-progress']"
|
||||||
weight="bold"
|
weight="bold"
|
||||||
size="small"
|
size="small"
|
||||||
[sigtermTimeout]="manifest.main['sigterm-timeout']"
|
[sigtermTimeout]="manifest.main['sigterm-timeout']"
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<status
|
<status
|
||||||
[disconnected]="!!(connectionFailure$ | async)"
|
[disconnected]="!!(connectionFailure$ | async)"
|
||||||
[rendering]="pkg.primaryRendering"
|
[rendering]="pkg.primaryRendering"
|
||||||
[installProgress]="pkg.installProgress?.totalProgress"
|
[installProgress]="pkg.entry['install-progress']"
|
||||||
weight="bold"
|
weight="bold"
|
||||||
size="small"
|
size="small"
|
||||||
[sigtermTimeout]="pkg.entry.manifest.main['sigterm-timeout']"
|
[sigtermTimeout]="pkg.entry.manifest.main['sigterm-timeout']"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { ToHealthChecksPipe } from './pipes/to-health-checks.pipe'
|
|||||||
import { ToButtonsPipe } from './pipes/to-buttons.pipe'
|
import { ToButtonsPipe } from './pipes/to-buttons.pipe'
|
||||||
import { ToDependenciesPipe } from './pipes/to-dependencies.pipe'
|
import { ToDependenciesPipe } from './pipes/to-dependencies.pipe'
|
||||||
import { ToStatusPipe } from './pipes/to-status.pipe'
|
import { ToStatusPipe } from './pipes/to-status.pipe'
|
||||||
import { InstallStatePipe } from './pipes/install-state.pipe'
|
import { ProgressDataPipe } from './pipes/progress-data.pipe'
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
@@ -33,7 +33,7 @@ const routes: Routes = [
|
|||||||
declarations: [
|
declarations: [
|
||||||
AppShowPage,
|
AppShowPage,
|
||||||
HealthColorPipe,
|
HealthColorPipe,
|
||||||
InstallStatePipe,
|
ProgressDataPipe,
|
||||||
ToHealthChecksPipe,
|
ToHealthChecksPipe,
|
||||||
ToButtonsPipe,
|
ToButtonsPipe,
|
||||||
ToDependenciesPipe,
|
ToDependenciesPipe,
|
||||||
|
|||||||
@@ -31,9 +31,9 @@
|
|||||||
<!-- ** installing, updating, restoring ** -->
|
<!-- ** installing, updating, restoring ** -->
|
||||||
<ion-content *ngIf="showProgress(pkg)">
|
<ion-content *ngIf="showProgress(pkg)">
|
||||||
<app-show-progress
|
<app-show-progress
|
||||||
*ngIf="pkg | installState as installProgress"
|
*ngIf="pkg | progressData as progressData"
|
||||||
[pkg]="pkg"
|
[pkg]="pkg"
|
||||||
[installProgress]="installProgress"
|
[progressData]="progressData"
|
||||||
></app-show-progress>
|
></app-show-progress>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import { ChangeDetectionStrategy, Component } from '@angular/core'
|
import { ChangeDetectionStrategy, Component } from '@angular/core'
|
||||||
import { NavController } from '@ionic/angular'
|
import { NavController } from '@ionic/angular'
|
||||||
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
import {
|
||||||
import { PackageState } from 'src/app/types/package-state'
|
PackageDataEntry,
|
||||||
|
PackageState,
|
||||||
|
} from 'src/app/services/patch-db/data-model'
|
||||||
import {
|
import {
|
||||||
PackageStatus,
|
PackageStatus,
|
||||||
PrimaryStatus,
|
PrimaryStatus,
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
<p>Downloading: {{ installProgress.downloadProgress }}%</p>
|
<p>Downloading: {{ progressData.downloadProgress }}%</p>
|
||||||
<ion-progress-bar
|
<ion-progress-bar
|
||||||
[color]="getColor('download-complete')"
|
[color]="getColor('download-complete')"
|
||||||
[value]="installProgress.downloadProgress / 100"
|
[value]="progressData.downloadProgress / 100"
|
||||||
[buffer]="!installProgress.downloadProgress ? 0 : 1"
|
[buffer]="!progressData.downloadProgress ? 0 : 1"
|
||||||
></ion-progress-bar>
|
></ion-progress-bar>
|
||||||
|
|
||||||
<p>Validating: {{ installProgress.validateProgress }}%</p>
|
<p>Validating: {{ progressData.validateProgress }}%</p>
|
||||||
<ion-progress-bar
|
<ion-progress-bar
|
||||||
[color]="getColor('validation-complete')"
|
[color]="getColor('validation-complete')"
|
||||||
[value]="installProgress.validateProgress / 100"
|
[value]="progressData.validateProgress / 100"
|
||||||
[buffer]="validationBuffer"
|
[buffer]="validationBuffer"
|
||||||
></ion-progress-bar>
|
></ion-progress-bar>
|
||||||
|
|
||||||
<p>Unpacking: {{ installProgress.unpackProgress }}%</p>
|
<p>Unpacking: {{ progressData.unpackProgress }}%</p>
|
||||||
<ion-progress-bar
|
<ion-progress-bar
|
||||||
[color]="getColor('unpack-complete')"
|
[color]="getColor('unpack-complete')"
|
||||||
[value]="installProgress.unpackProgress / 100"
|
[value]="progressData.unpackProgress / 100"
|
||||||
[buffer]="unpackingBuffer"
|
[buffer]="unpackingBuffer"
|
||||||
></ion-progress-bar>
|
></ion-progress-bar>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
|
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
|
||||||
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
import {
|
||||||
import { InstallProgress } from 'src/app/types/install-progress'
|
InstallProgress,
|
||||||
|
PackageDataEntry,
|
||||||
|
} from 'src/app/services/patch-db/data-model'
|
||||||
import { ProgressData } from 'src/app/types/progress-data'
|
import { ProgressData } from 'src/app/types/progress-data'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -14,18 +16,18 @@ export class AppShowProgressComponent {
|
|||||||
pkg: PackageDataEntry
|
pkg: PackageDataEntry
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
installProgress: ProgressData
|
progressData: ProgressData
|
||||||
|
|
||||||
get unpackingBuffer(): number {
|
get unpackingBuffer(): number {
|
||||||
return this.installProgress.validateProgress === 100 &&
|
return this.progressData.validateProgress === 100 &&
|
||||||
!this.installProgress.unpackProgress
|
!this.progressData.unpackProgress
|
||||||
? 0
|
? 0
|
||||||
: 1
|
: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
get validationBuffer(): number {
|
get validationBuffer(): number {
|
||||||
return this.installProgress.downloadProgress === 100 &&
|
return this.progressData.downloadProgress === 100 &&
|
||||||
!this.installProgress.validateProgress
|
!this.progressData.validateProgress
|
||||||
? 0
|
? 0
|
||||||
: 1
|
: 1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
size="x-large"
|
size="x-large"
|
||||||
weight="500"
|
weight="500"
|
||||||
[disconnected]="connectionFailure"
|
[disconnected]="connectionFailure"
|
||||||
[installProgress]="(pkg | installState)?.totalProgress"
|
[installProgress]="pkg['install-progress']"
|
||||||
[rendering]="PR[status.primary]"
|
[rendering]="PR[status.primary]"
|
||||||
[sigtermTimeout]="pkg.manifest.main['sigterm-timeout']"
|
[sigtermTimeout]="pkg.manifest.main['sigterm-timeout']"
|
||||||
></status>
|
></status>
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import {
|
|||||||
import {
|
import {
|
||||||
InterfaceDef,
|
InterfaceDef,
|
||||||
PackageDataEntry,
|
PackageDataEntry,
|
||||||
|
PackageState,
|
||||||
Status,
|
Status,
|
||||||
} from 'src/app/services/patch-db/data-model'
|
} from 'src/app/services/patch-db/data-model'
|
||||||
import { ErrorToastService } from '@start9labs/shared'
|
import { ErrorToastService } from '@start9labs/shared'
|
||||||
import { PackageState } from 'src/app/types/package-state'
|
|
||||||
import { wizardModal } from 'src/app/components/install-wizard/install-wizard.component'
|
import { wizardModal } from 'src/app/components/install-wizard/install-wizard.component'
|
||||||
import {
|
import {
|
||||||
AlertController,
|
AlertController,
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import { ProgressData } from 'src/app/types/progress-data'
|
|||||||
import { packageLoadingProgress } from 'src/app/util/package-loading-progress'
|
import { packageLoadingProgress } from 'src/app/util/package-loading-progress'
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({
|
||||||
name: 'installState',
|
name: 'progressData',
|
||||||
})
|
})
|
||||||
export class InstallStatePipe implements PipeTransform {
|
export class ProgressDataPipe implements PipeTransform {
|
||||||
transform(pkg: PackageDataEntry): ProgressData | null {
|
transform(pkg: PackageDataEntry): ProgressData | null {
|
||||||
return packageLoadingProgress(pkg['install-progress'])
|
return packageLoadingProgress(pkg['install-progress'])
|
||||||
}
|
}
|
||||||
@@ -1,33 +1,46 @@
|
|||||||
<ng-container *ngIf="localPkg; else install">
|
<div class="action-buttons">
|
||||||
<!-- not installing, updating, or removing -->
|
<ion-button
|
||||||
<ng-container *ngIf="localPkg.state === PackageState.Installed">
|
*ngIf="localPkg"
|
||||||
<ion-button
|
expand="block"
|
||||||
*ngIf="(version | compareEmver: pkg.manifest.version) === -1"
|
color="primary"
|
||||||
expand="block"
|
[routerLink]="['/services', pkg.manifest.id]"
|
||||||
(click)="presentModal('update')"
|
>
|
||||||
>
|
View Installed
|
||||||
Update
|
</ion-button>
|
||||||
</ion-button>
|
<ng-container *ngIf="localPkg; else install">
|
||||||
<ion-button
|
<ng-container *ngIf="localPkg.state === PackageState.Installed">
|
||||||
*ngIf="(version | compareEmver: pkg.manifest.version) === 1"
|
|
||||||
expand="block"
|
|
||||||
color="warning"
|
|
||||||
(click)="presentModal('downgrade')"
|
|
||||||
>
|
|
||||||
Downgrade
|
|
||||||
</ion-button>
|
|
||||||
<ng-container *ngIf="localStorageService.showDevTools$ | async">
|
|
||||||
<ion-button
|
<ion-button
|
||||||
*ngIf="(version | compareEmver: pkg.manifest.version) === 0"
|
*ngIf="(version | compareEmver: pkg.manifest.version) === -1"
|
||||||
expand="block"
|
expand="block"
|
||||||
(click)="tryInstall()"
|
color="success"
|
||||||
|
(click)="presentModal('update')"
|
||||||
>
|
>
|
||||||
Reinstall
|
Update
|
||||||
</ion-button>
|
</ion-button>
|
||||||
|
<ion-button
|
||||||
|
*ngIf="(version | compareEmver: pkg.manifest.version) === 1"
|
||||||
|
expand="block"
|
||||||
|
color="warning"
|
||||||
|
(click)="presentModal('downgrade')"
|
||||||
|
>
|
||||||
|
Downgrade
|
||||||
|
</ion-button>
|
||||||
|
<ng-container *ngIf="localStorageService.showDevTools$ | async">
|
||||||
|
<ion-button
|
||||||
|
*ngIf="(version | compareEmver: pkg.manifest.version) === 0"
|
||||||
|
expand="block"
|
||||||
|
color="success"
|
||||||
|
(click)="tryInstall()"
|
||||||
|
>
|
||||||
|
Reinstall
|
||||||
|
</ion-button>
|
||||||
|
</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<ng-template #install>
|
<ng-template #install>
|
||||||
<ion-button expand="block" (click)="tryInstall()">Install</ion-button>
|
<ion-button expand="block" color="success" (click)="tryInstall()">
|
||||||
</ng-template>
|
Install
|
||||||
|
</ion-button>
|
||||||
|
</ng-template>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import {
|
|||||||
} from '@start9labs/marketplace'
|
} from '@start9labs/marketplace'
|
||||||
import { pauseFor } from '@start9labs/shared'
|
import { pauseFor } from '@start9labs/shared'
|
||||||
|
|
||||||
import { PackageState } from 'src/app/types/package-state'
|
|
||||||
import {
|
import {
|
||||||
Manifest,
|
Manifest,
|
||||||
PackageDataEntry,
|
PackageDataEntry,
|
||||||
|
PackageState,
|
||||||
} from 'src/app/services/patch-db/data-model'
|
} from 'src/app/services/patch-db/data-model'
|
||||||
import { wizardModal } from 'src/app/components/install-wizard/install-wizard.component'
|
import { wizardModal } from 'src/app/components/install-wizard/install-wizard.component'
|
||||||
import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards'
|
import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards'
|
||||||
@@ -18,6 +18,7 @@ import { LocalStorageService } from 'src/app/services/local-storage.service'
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'marketplace-show-controls',
|
selector: 'marketplace-show-controls',
|
||||||
templateUrl: 'marketplace-show-controls.component.html',
|
templateUrl: 'marketplace-show-controls.component.html',
|
||||||
|
styleUrls: ['./marketplace-show-controls.page.scss'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class MarketplaceShowControlsComponent {
|
export class MarketplaceShowControlsComponent {
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
ion-button::part(native) {
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ion-button {
|
||||||
|
height: 44px;
|
||||||
|
margin: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1000px) {
|
||||||
|
|
||||||
|
.action-buttons {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
ion-button {
|
||||||
|
width: 240px;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,37 +3,11 @@
|
|||||||
<ion-content class="ion-padding">
|
<ion-content class="ion-padding">
|
||||||
<ng-container *ngIf="pkg$ | async as pkg else loading">
|
<ng-container *ngIf="pkg$ | async as pkg else loading">
|
||||||
<ng-container *ngIf="!(pkg | empty)">
|
<ng-container *ngIf="!(pkg | empty)">
|
||||||
<marketplace-package [pkg]="pkg">
|
<marketplace-package [pkg]="pkg"></marketplace-package>
|
||||||
<marketplace-status
|
<marketplace-show-controls
|
||||||
*ngIf="localPkg$ | async as localPkg"
|
[pkg]="pkg"
|
||||||
class="status"
|
[localPkg]="localPkg$ | async"
|
||||||
[localPkg]="localPkg"
|
></marketplace-show-controls>
|
||||||
></marketplace-status>
|
|
||||||
<marketplace-show-controls
|
|
||||||
position="controls"
|
|
||||||
[pkg]="pkg"
|
|
||||||
[localPkg]="localPkg$ | async"
|
|
||||||
></marketplace-show-controls>
|
|
||||||
<ion-row *ngIf="localPkg$ | async">
|
|
||||||
<ion-col
|
|
||||||
sizeXl="3"
|
|
||||||
sizeLg="3"
|
|
||||||
sizeMd="3"
|
|
||||||
sizeSm="12"
|
|
||||||
sizeXs="12"
|
|
||||||
class="ion-align-self-center"
|
|
||||||
>
|
|
||||||
<ion-button
|
|
||||||
expand="block"
|
|
||||||
fill="outline"
|
|
||||||
color="primary"
|
|
||||||
[routerLink]="['/services', pkg.manifest.id]"
|
|
||||||
>
|
|
||||||
View Service
|
|
||||||
</ion-button>
|
|
||||||
</ion-col>
|
|
||||||
</ion-row>
|
|
||||||
</marketplace-package>
|
|
||||||
|
|
||||||
<marketplace-show-dependent [pkg]="pkg"></marketplace-show-dependent>
|
<marketplace-show-dependent [pkg]="pkg"></marketplace-show-dependent>
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div *ngSwitchDefault>
|
<div *ngSwitchDefault>
|
||||||
<ion-text
|
<ion-text
|
||||||
*ngIf="localPkg['install-progress'] | installProgress as progress"
|
*ngIf="localPkg['install-progress'] | installProgressDisplay as progress"
|
||||||
color="primary"
|
color="primary"
|
||||||
>
|
>
|
||||||
Installing
|
Installing
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { Component, Input } from '@angular/core'
|
import { Component, Input } from '@angular/core'
|
||||||
import { PackageState } from 'src/app/types/package-state'
|
import {
|
||||||
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
PackageDataEntry,
|
||||||
|
PackageState,
|
||||||
|
} from 'src/app/services/patch-db/data-model'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'marketplace-status',
|
selector: 'marketplace-status',
|
||||||
|
|||||||
@@ -3,12 +3,17 @@ import { NgModule } from '@angular/core'
|
|||||||
import { IonicModule } from '@ionic/angular'
|
import { IonicModule } from '@ionic/angular'
|
||||||
import { EmverPipesModule } from '@start9labs/shared'
|
import { EmverPipesModule } from '@start9labs/shared'
|
||||||
|
|
||||||
import { InstallProgressPipe } from './install-progress.pipe'
|
import { InstallProgressPipeModule } from '../../../pipes/install-progress/install-progress.module'
|
||||||
import { MarketplaceStatusComponent } from './marketplace-status.component'
|
import { MarketplaceStatusComponent } from './marketplace-status.component'
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [CommonModule, IonicModule, EmverPipesModule],
|
imports: [
|
||||||
declarations: [MarketplaceStatusComponent, InstallProgressPipe],
|
CommonModule,
|
||||||
|
IonicModule,
|
||||||
|
EmverPipesModule,
|
||||||
|
InstallProgressPipeModule,
|
||||||
|
],
|
||||||
|
declarations: [MarketplaceStatusComponent],
|
||||||
exports: [MarketplaceStatusComponent],
|
exports: [MarketplaceStatusComponent],
|
||||||
})
|
})
|
||||||
export class MarketplaceStatusModule {}
|
export class MarketplaceStatusModule {}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { NgModule } from '@angular/core'
|
||||||
|
import { InstallProgressPipe } from './install-progress.pipe'
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [InstallProgressPipe],
|
||||||
|
exports: [InstallProgressPipe],
|
||||||
|
})
|
||||||
|
export class InstallProgressPipeModule {}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
import { Pipe, PipeTransform } from '@angular/core'
|
import { Pipe, PipeTransform } from '@angular/core'
|
||||||
import { InstallProgress } from 'src/app/types/install-progress'
|
import { InstallProgress } from 'src/app/services/patch-db/data-model'
|
||||||
import { packageLoadingProgress } from 'src/app/util/package-loading-progress'
|
import { packageLoadingProgress } from 'src/app/util/package-loading-progress'
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({
|
||||||
name: 'installProgress',
|
name: 'installProgressDisplay',
|
||||||
})
|
})
|
||||||
export class InstallProgressPipe implements PipeTransform {
|
export class InstallProgressPipe implements PipeTransform {
|
||||||
transform(loadData?: InstallProgress): string {
|
transform(installProgress?: InstallProgress): string {
|
||||||
const totalProgress = packageLoadingProgress(loadData)?.totalProgress || 0
|
const totalProgress = packageLoadingProgress(installProgress)?.totalProgress || 0
|
||||||
|
|
||||||
return totalProgress < 99 ? totalProgress + '%' : 'finalizing'
|
return totalProgress < 99 ? totalProgress + '%' : 'finalizing'
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Pipe, PipeTransform } from '@angular/core'
|
import { Pipe, PipeTransform } from '@angular/core'
|
||||||
import { PackageState } from 'src/app/types/package-state'
|
|
||||||
import {
|
import {
|
||||||
InterfaceDef,
|
InterfaceDef,
|
||||||
PackageMainStatus,
|
PackageMainStatus,
|
||||||
|
PackageState,
|
||||||
} from 'src/app/services/patch-db/data-model'
|
} from 'src/app/services/patch-db/data-model'
|
||||||
import { ConfigService } from '../../services/config.service'
|
import { ConfigService } from '../../services/config.service'
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { PackageState } from 'src/app/types/package-state'
|
|
||||||
import {
|
import {
|
||||||
DependencyErrorType,
|
DependencyErrorType,
|
||||||
DockerIoFormat,
|
DockerIoFormat,
|
||||||
Manifest,
|
Manifest,
|
||||||
PackageDataEntry,
|
PackageDataEntry,
|
||||||
PackageMainStatus,
|
PackageMainStatus,
|
||||||
|
PackageState,
|
||||||
} from 'src/app/services/patch-db/data-model'
|
} from 'src/app/services/patch-db/data-model'
|
||||||
import {
|
import {
|
||||||
Log,
|
Log,
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ import { Injectable } from '@angular/core'
|
|||||||
import { pauseFor } from '@start9labs/shared'
|
import { pauseFor } from '@start9labs/shared'
|
||||||
import { ApiService } from './embassy-api.service'
|
import { ApiService } from './embassy-api.service'
|
||||||
import { PatchOp, Update, Operation, RemoveOperation } from 'patch-db-client'
|
import { PatchOp, Update, Operation, RemoveOperation } from 'patch-db-client'
|
||||||
import { PackageState } from 'src/app/types/package-state'
|
|
||||||
import { InstallProgress } from 'src/app/types/install-progress'
|
|
||||||
import {
|
import {
|
||||||
DataModel,
|
DataModel,
|
||||||
DependencyErrorType,
|
DependencyErrorType,
|
||||||
|
InstallProgress,
|
||||||
PackageDataEntry,
|
PackageDataEntry,
|
||||||
PackageMainStatus,
|
PackageMainStatus,
|
||||||
|
PackageState,
|
||||||
ServerStatus,
|
ServerStatus,
|
||||||
} from 'src/app/services/patch-db/data-model'
|
} from 'src/app/services/patch-db/data-model'
|
||||||
import { CifsBackupTarget, Log, RR, WithRevision } from './api.types'
|
import { CifsBackupTarget, Log, RR, WithRevision } from './api.types'
|
||||||
@@ -690,7 +690,14 @@ export class MockApiService extends ApiService {
|
|||||||
params: RR.DryUninstallPackageReq,
|
params: RR.DryUninstallPackageReq,
|
||||||
): Promise<RR.DryUninstallPackageRes> {
|
): Promise<RR.DryUninstallPackageRes> {
|
||||||
await pauseFor(2000)
|
await pauseFor(2000)
|
||||||
return {}
|
return {
|
||||||
|
lnd: {
|
||||||
|
dependency: 'bitcoind',
|
||||||
|
error: {
|
||||||
|
type: DependencyErrorType.NotRunning,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async uninstallPackageRaw(
|
async uninstallPackageRaw(
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { PackageState } from 'src/app/types/package-state'
|
|
||||||
import {
|
import {
|
||||||
DataModel,
|
DataModel,
|
||||||
DependencyErrorType,
|
DependencyErrorType,
|
||||||
@@ -6,6 +5,7 @@ import {
|
|||||||
HealthResult,
|
HealthResult,
|
||||||
Manifest,
|
Manifest,
|
||||||
PackageMainStatus,
|
PackageMainStatus,
|
||||||
|
PackageState,
|
||||||
} from 'src/app/services/patch-db/data-model'
|
} from 'src/app/services/patch-db/data-model'
|
||||||
|
|
||||||
export const mockPatchData: DataModel = {
|
export const mockPatchData: DataModel = {
|
||||||
@@ -445,7 +445,7 @@ export const mockPatchData: DataModel = {
|
|||||||
'donation-url': null,
|
'donation-url': null,
|
||||||
alerts: {
|
alerts: {
|
||||||
install: null,
|
install: null,
|
||||||
uninstall: null,
|
uninstall: undefined,
|
||||||
restore:
|
restore:
|
||||||
'If this is a duplicate instance of the same LND node, you may loose your funds.',
|
'If this is a duplicate instance of the same LND node, you may loose your funds.',
|
||||||
start: 'Starting LND is good for your health.',
|
start: 'Starting LND is good for your health.',
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { WorkspaceConfig } from '@start9labs/shared'
|
import { WorkspaceConfig } from '@start9labs/shared'
|
||||||
import { PackageState } from 'src/app/types/package-state'
|
|
||||||
import {
|
import {
|
||||||
InterfaceDef,
|
InterfaceDef,
|
||||||
PackageDataEntry,
|
PackageDataEntry,
|
||||||
PackageMainStatus,
|
PackageMainStatus,
|
||||||
|
PackageState,
|
||||||
} from 'src/app/services/patch-db/data-model'
|
} from 'src/app/services/patch-db/data-model'
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ import { ConfigSpec } from 'src/app/pkg-config/config-types'
|
|||||||
import { Url } from '@start9labs/shared'
|
import { Url } from '@start9labs/shared'
|
||||||
import { MarketplaceManifest } from '@start9labs/marketplace'
|
import { MarketplaceManifest } from '@start9labs/marketplace'
|
||||||
import { BasicInfo } from 'src/app/pages/developer-routes/developer-menu/form-info'
|
import { BasicInfo } from 'src/app/pages/developer-routes/developer-menu/form-info'
|
||||||
import { PackageState } from 'src/app/types/package-state'
|
|
||||||
import { InstallProgress } from 'src/app/types/install-progress'
|
|
||||||
|
|
||||||
export interface DataModel {
|
export interface DataModel {
|
||||||
'server-info': ServerInfo
|
'server-info': ServerInfo
|
||||||
@@ -86,6 +84,14 @@ export interface PackageDataEntry {
|
|||||||
'install-progress'?: InstallProgress // exists when: installing, updating
|
'install-progress'?: InstallProgress // exists when: installing, updating
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum PackageState {
|
||||||
|
Installing = 'installing',
|
||||||
|
Installed = 'installed',
|
||||||
|
Updating = 'updating',
|
||||||
|
Removing = 'removing',
|
||||||
|
Restoring = 'restoring',
|
||||||
|
}
|
||||||
|
|
||||||
export interface InstalledPackageDataEntry {
|
export interface InstalledPackageDataEntry {
|
||||||
status: Status
|
status: Status
|
||||||
manifest: Manifest
|
manifest: Manifest
|
||||||
@@ -356,3 +362,13 @@ export interface DependencyErrorHealthChecksFailed {
|
|||||||
export interface DependencyErrorTransitive {
|
export interface DependencyErrorTransitive {
|
||||||
type: DependencyErrorType.Transitive
|
type: DependencyErrorType.Transitive
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface InstallProgress {
|
||||||
|
readonly size: number | null
|
||||||
|
readonly downloaded: number
|
||||||
|
readonly 'download-complete': boolean
|
||||||
|
readonly validated: number
|
||||||
|
readonly 'validation-complete': boolean
|
||||||
|
readonly unpacked: number
|
||||||
|
readonly 'unpack-complete': boolean
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { isEmptyObject } from '@start9labs/shared'
|
import { isEmptyObject } from '@start9labs/shared'
|
||||||
import { PackageState } from 'src/app/types/package-state'
|
|
||||||
import {
|
import {
|
||||||
PackageDataEntry,
|
PackageDataEntry,
|
||||||
PackageMainStatus,
|
PackageMainStatus,
|
||||||
|
PackageState,
|
||||||
Status,
|
Status,
|
||||||
} from 'src/app/services/patch-db/data-model'
|
} from 'src/app/services/patch-db/data-model'
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
export interface InstallProgress {
|
|
||||||
readonly size: number | null
|
|
||||||
readonly downloaded: number
|
|
||||||
readonly 'download-complete': boolean
|
|
||||||
readonly validated: number
|
|
||||||
readonly 'validation-complete': boolean
|
|
||||||
readonly unpacked: number
|
|
||||||
readonly 'unpack-complete': boolean
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
export enum PackageState {
|
|
||||||
Installing = 'installing',
|
|
||||||
Installed = 'installed',
|
|
||||||
Updating = 'updating',
|
|
||||||
Removing = 'removing',
|
|
||||||
Restoring = 'restoring',
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { isEmptyObject } from '@start9labs/shared'
|
import { isEmptyObject } from '@start9labs/shared'
|
||||||
import { InstallProgress } from 'src/app/types/install-progress'
|
|
||||||
import { ProgressData } from 'src/app/types/progress-data'
|
import { ProgressData } from 'src/app/types/progress-data'
|
||||||
|
import { InstallProgress } from '../services/patch-db/data-model'
|
||||||
|
|
||||||
export function packageLoadingProgress(
|
export function packageLoadingProgress(
|
||||||
loadData?: InstallProgress,
|
loadData?: InstallProgress,
|
||||||
|
|||||||
16
frontend/proxy.conf-sample.json
Normal file
16
frontend/proxy.conf-sample.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"/rpc/v1": {
|
||||||
|
"target": "http://<CHANGE_ME>/rpc/v1"
|
||||||
|
},
|
||||||
|
"/ws/*": {
|
||||||
|
"target": "http://<CHANGE_ME>",
|
||||||
|
"secure": false,
|
||||||
|
"ws": true
|
||||||
|
},
|
||||||
|
"/public/*": {
|
||||||
|
"target": "http://<CHANGE_ME>/public",
|
||||||
|
"pathRewrite": {
|
||||||
|
"^/public": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"/rpc/v1": {
|
|
||||||
"target": "http://localhost:8100/rpc/v1"
|
|
||||||
},
|
|
||||||
"/ws": {
|
|
||||||
"target": "http://localhost:8100/ws"
|
|
||||||
},
|
|
||||||
"/public/*": {
|
|
||||||
"target": "http://localhost:8100/public",
|
|
||||||
"pathRewrite": {
|
|
||||||
"^/public": ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user