diff --git a/web/projects/ui/src/app/apps/portal/routes/dashboard/status.component.ts b/web/projects/ui/src/app/apps/portal/routes/dashboard/status.component.ts
index af1003bb0..3343df80a 100644
--- a/web/projects/ui/src/app/apps/portal/routes/dashboard/status.component.ts
+++ b/web/projects/ui/src/app/apps/portal/routes/dashboard/status.component.ts
@@ -1,4 +1,9 @@
-import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
+import {
+ ChangeDetectionStrategy,
+ Component,
+ inject,
+ Input,
+} from '@angular/core'
import { tuiPure } from '@taiga-ui/cdk'
import { TuiLoaderModule } from '@taiga-ui/core'
import { TuiIconModule } from '@taiga-ui/experimental'
@@ -35,8 +40,11 @@ import { InstallingProgressDisplayPipe } from '../service/pipes/install-progress
`,
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [TuiIconModule, TuiLoaderModule],
+ providers: [InstallingProgressDisplayPipe],
})
export class StatusComponent {
+ private readonly pipe = inject(InstallingProgressDisplayPipe)
+
@Input()
pkg!: PackageDataEntry
@@ -64,7 +72,7 @@ export class StatusComponent {
get status(): string {
if (this.pkg.stateInfo.installingInfo) {
- return `Installing...${new InstallingProgressDisplayPipe().transform(this.pkg.stateInfo.installingInfo.progress.overall)}`
+ return `Installing... ${this.pipe.transform(this.pkg.stateInfo.installingInfo.progress.overall)}`
}
switch (this.getStatus(this.pkg).primary) {
diff --git a/web/projects/ui/src/app/apps/portal/routes/dashboard/ui.component.ts b/web/projects/ui/src/app/apps/portal/routes/dashboard/ui.component.ts
index 5d917b949..8cb56f1cc 100644
--- a/web/projects/ui/src/app/apps/portal/routes/dashboard/ui.component.ts
+++ b/web/projects/ui/src/app/apps/portal/routes/dashboard/ui.component.ts
@@ -43,17 +43,15 @@ import {
} @else {
- @if (interfaces[0]; as info) {
-
- {{ info.name }}
-
- }
+
+ {{ interfaces[0]?.name }}
+
}
`,
changeDetection: ChangeDetectionStrategy.OnPush,
diff --git a/web/projects/ui/src/app/apps/portal/routes/system/settings/settings.service.ts b/web/projects/ui/src/app/apps/portal/routes/system/settings/settings.service.ts
index 5f2425a8b..c55add8c1 100644
--- a/web/projects/ui/src/app/apps/portal/routes/system/settings/settings.service.ts
+++ b/web/projects/ui/src/app/apps/portal/routes/system/settings/settings.service.ts
@@ -1,8 +1,15 @@
-import { inject, Injectable } from '@angular/core'
+import {
+ ChangeDetectionStrategy,
+ Component,
+ inject,
+ Injectable,
+} from '@angular/core'
+import { FormsModule } from '@angular/forms'
import { TuiAlertService, TuiDialogService } from '@taiga-ui/core'
import * as argon2 from '@start9labs/argon2'
import { ErrorService, LoadingService } from '@start9labs/shared'
-import { TUI_PROMPT } from '@taiga-ui/kit'
+import { TUI_PROMPT, TuiCheckboxLabeledModule } from '@taiga-ui/kit'
+import { PolymorpheusComponent } from '@tinkoff/ng-polymorpheus'
import { PatchDB } from 'patch-db-client'
import { filter, firstValueFrom, from, take } from 'rxjs'
import { switchMap } from 'rxjs/operators'
@@ -30,6 +37,8 @@ export class SettingsService {
private readonly api = inject(ApiService)
private readonly isTor = inject(ConfigService).isTor()
+ wipe = false
+
readonly settings: Record = {
General: [
{
@@ -122,19 +131,19 @@ export class SettingsService {
await this.proxyService.presentModalSetOutboundProxy(proxy)
}
- // @TODO-Alex previous this was done in experimental settings using a template ref.
private promptResetTor() {
+ this.wipe = false
this.dialogs
.open(TUI_PROMPT, {
label: this.isTor ? 'Warning' : 'Confirm',
data: {
- content: '@TODO how to display a checkbox in here?',
+ content: new PolymorpheusComponent(WipeComponent),
yes: 'Reset',
no: 'Cancel',
},
})
.pipe(filter(Boolean))
- .subscribe(() => this.resetTor(true))
+ .subscribe(() => this.resetTor(this.wipe))
}
private async resetTor(wipeState: boolean) {
@@ -258,3 +267,30 @@ export class SettingsService {
}
}
}
+
+@Component({
+ standalone: true,
+ template: `
+
+ @if (isTor) {
+ You are currently connected over Tor. If you reset the Tor daemon, you
+ will lose connectivity until it comes back online.
+ } @else {
+ Reset Tor?
+ }
+
+
+ Optionally wipe state to forcibly acquire new guard nodes. It is
+ recommended to try without wiping state first.
+
+
+ Wipe state
+
+ `,
+ changeDetection: ChangeDetectionStrategy.OnPush,
+ imports: [TuiCheckboxLabeledModule, FormsModule],
+})
+class WipeComponent {
+ readonly isTor = inject(ConfigService).isTor()
+ readonly service = inject(SettingsService)
+}
diff --git a/web/projects/ui/src/app/apps/portal/routes/system/updates/pipes/filter-updates.pipe.ts b/web/projects/ui/src/app/apps/portal/routes/system/updates/filter-updates.pipe.ts
similarity index 100%
rename from web/projects/ui/src/app/apps/portal/routes/system/updates/pipes/filter-updates.pipe.ts
rename to web/projects/ui/src/app/apps/portal/routes/system/updates/filter-updates.pipe.ts
diff --git a/web/projects/ui/src/app/apps/portal/routes/system/updates/components/item.component.ts b/web/projects/ui/src/app/apps/portal/routes/system/updates/item.component.ts
similarity index 84%
rename from web/projects/ui/src/app/apps/portal/routes/system/updates/components/item.component.ts
rename to web/projects/ui/src/app/apps/portal/routes/system/updates/item.component.ts
index 40dda37d4..f08ca2d9a 100644
--- a/web/projects/ui/src/app/apps/portal/routes/system/updates/components/item.component.ts
+++ b/web/projects/ui/src/app/apps/portal/routes/system/updates/item.component.ts
@@ -1,4 +1,3 @@
-import { NgIf } from '@angular/common'
import { Component, inject, Input } from '@angular/core'
import { RouterLink } from '@angular/router'
import {
@@ -27,17 +26,17 @@ import {
TuiProgressModule,
} from '@taiga-ui/kit'
import { NgDompurifyModule } from '@tinkoff/ng-dompurify'
+import { PatchDB } from 'patch-db-client'
+import { InstallingProgressPipe } from 'src/app/apps/portal/routes/service/pipes/install-progress.pipe'
+import { MarketplaceService } from 'src/app/services/marketplace.service'
import {
DataModel,
InstalledState,
PackageDataEntry,
UpdatingState,
} from 'src/app/services/patch-db/data-model'
-import { MarketplaceService } from 'src/app/services/marketplace.service'
-import { hasCurrentDeps } from 'src/app/util/has-deps'
-import { InstallingProgressPipe } from '../../../service/pipes/install-progress.pipe'
-import { PatchDB } from 'patch-db-client'
import { getAllPackages } from 'src/app/util/get-package-data'
+import { hasCurrentDeps } from 'src/app/util/has-deps'
@Component({
selector: 'updates-item',
@@ -56,29 +55,30 @@ import { getAllPackages } from 'src/app/util/get-package-data'