-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce error status and pkg rebuild and fix mocks
- Loading branch information
Showing
16 changed files
with
351 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...rc/app/pages/apps-routes/app-show/components/app-show-error/app-show-error.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<ion-item-divider>Message</ion-item-divider> | ||
<div class="code-block ion-margin"> | ||
<code> | ||
<ion-text color="warning">{{ error.message }}</ion-text> | ||
</code> | ||
</div> | ||
|
||
<ion-item-divider>Actions</ion-item-divider> | ||
<div class="ion-margin"> | ||
<p> | ||
<b>Rebuild Container</b> | ||
is harmless action that and only takes a few seconds to complete. It will | ||
likely resolve this issue. | ||
<b>Uninstall Service</b> | ||
is a dangerous action that will remove the service from StartOS and wipe all | ||
its data. | ||
</p> | ||
<ion-button class="ion-margin-end" (click)="rebuild()"> | ||
Rebuild Container | ||
</ion-button> | ||
<ion-button (click)="tryUninstall()" color="danger"> | ||
Uninstall Service | ||
</ion-button> | ||
</div> | ||
|
||
<ng-container *ngIf="error.debug"> | ||
<ion-item-divider>Full Stack Trace</ion-item-divider> | ||
<div class="code-block ion-margin"> | ||
<code>{{ error.message }}</code> | ||
</div> | ||
</ng-container> |
45 changes: 45 additions & 0 deletions
45
.../src/app/pages/apps-routes/app-show/components/app-show-error/app-show-error.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core' | ||
import { ToastController } from '@ionic/angular' | ||
import { copyToClipboard } from '@start9labs/shared' | ||
import { T } from '@start9labs/start-sdk' | ||
import { StandardActionsService } from 'src/app/services/standard-actions.service' | ||
|
||
@Component({ | ||
selector: 'app-show-error', | ||
templateUrl: 'app-show-error.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class AppShowErrorComponent { | ||
@Input() | ||
manifest!: T.Manifest | ||
|
||
@Input() | ||
error!: T.MainStatus & { main: 'error' } | ||
|
||
constructor( | ||
private readonly toastCtrl: ToastController, | ||
private readonly standardActionsService: StandardActionsService, | ||
) {} | ||
|
||
async copy(text: string): Promise<void> { | ||
const success = await copyToClipboard(text) | ||
const message = success | ||
? 'Copied to clipboard!' | ||
: 'Failed to copy to clipboard.' | ||
|
||
const toast = await this.toastCtrl.create({ | ||
header: message, | ||
position: 'bottom', | ||
duration: 1000, | ||
}) | ||
await toast.present() | ||
} | ||
|
||
async rebuild() { | ||
return this.standardActionsService.rebuild(this.manifest.id) | ||
} | ||
|
||
async tryUninstall() { | ||
return this.standardActionsService.tryUninstall(this.manifest) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.