Compare commits

...

1 Commits

Author SHA1 Message Date
Matt Hill
3d49689b1e remove unnecessary warnings 2026-03-31 13:21:37 -06:00
8 changed files with 12 additions and 72 deletions

View File

@@ -399,7 +399,6 @@ export default {
425: 'Ausführen',
426: 'Aktion kann nur ausgeführt werden, wenn der Dienst',
427: 'Verboten',
428: 'kann vorübergehend Probleme verursachen',
429: 'hat unerfüllte Abhängigkeiten. Es wird nicht wie erwartet funktionieren.',
430: 'Container wird neu gebaut',
431: 'Deinstallation wird gestartet',

View File

@@ -398,7 +398,6 @@ export const ENGLISH: Record<string, number> = {
'Run': 425, // as in, run a piece of software
'Action can only be executed when service is': 426,
'Forbidden': 427,
'may temporarily experiences issues': 428,
'has unmet dependencies. It will not work as expected.': 429,
'Rebuilding container': 430,
'Beginning uninstall': 431,

View File

@@ -399,7 +399,6 @@ export default {
425: 'Ejecutar',
426: 'La acción solo se puede ejecutar cuando el servicio está',
427: 'Prohibido',
428: 'puede experimentar problemas temporales',
429: 'tiene dependencias no satisfechas. No funcionará como se espera.',
430: 'Reconstruyendo contenedor',
431: 'Iniciando desinstalación',

View File

@@ -399,7 +399,6 @@ export default {
425: 'Exécuter',
426: 'Action possible uniquement lorsque le service est',
427: 'Interdit',
428: 'peut rencontrer des problèmes temporaires',
429: 'a des dépendances non satisfaites. Il ne fonctionnera pas comme prévu.',
430: 'Reconstruction du conteneur',
431: 'Désinstallation initiée',

View File

@@ -399,7 +399,6 @@ export default {
425: 'Uruchom',
426: 'Akcja może być wykonana tylko gdy serwis jest',
427: 'Zabronione',
428: 'może tymczasowo napotkać problemy',
429: 'ma niespełnione zależności. Nie będzie działać zgodnie z oczekiwaniami.',
430: 'Odbudowywanie kontenera',
431: 'Rozpoczynanie odinstalowania',

View File

@@ -36,7 +36,7 @@ import { InterfaceService } from '../../../components/interfaces/interface.servi
<button
tuiButton
iconStart="@tui.rotate-cw"
(click)="controls.restart(manifest())"
(click)="controls.restart(manifest().id)"
>
{{ 'Restart' | i18n }}
</button>

View File

@@ -10,7 +10,6 @@ import { RouterLink } from '@angular/router'
import { MarketplacePkg } from '@start9labs/marketplace'
import {
DialogService,
i18nKey,
i18nPipe,
LocalizePipe,
MarkdownPipe,
@@ -32,7 +31,6 @@ import {
TuiProgressCircle,
} from '@taiga-ui/kit'
import { PatchDB } from 'patch-db-client'
import { defaultIfEmpty, firstValueFrom } from 'rxjs'
import { InstallingProgressPipe } from 'src/app/routes/portal/routes/services/pipes/install-progress.pipe'
import { MarketplaceService } from 'src/app/services/marketplace.service'
import {
@@ -41,8 +39,6 @@ import {
PackageDataEntry,
UpdatingState,
} from 'src/app/services/patch-db/data-model'
import { getAllPackages } from 'src/app/utils/get-package-data'
import { hasCurrentDeps } from 'src/app/utils/has-deps'
import UpdatesComponent from './updates.component'
@Component({
@@ -106,7 +102,7 @@ import UpdatesComponent from './updates.component'
size="s"
[loading]="!ready()"
[appearance]="error() ? 'destructive' : 'primary'"
(click.stop)="onClick()"
(click.stop)="update()"
>
{{ error() ? ('Retry' | i18n) : ('Update' | i18n) }}
</button>
@@ -274,22 +270,7 @@ export class UpdatesItemComponent {
readonly local =
input.required<PackageDataEntry<InstalledState | UpdatingState>>()
async onClick() {
this.ready.set(false)
this.error.set('')
if (hasCurrentDeps(this.item().id, await getAllPackages(this.patch))) {
if (await this.alert()) {
await this.update()
} else {
this.ready.set(true)
}
} else {
await this.update()
}
}
private async update() {
async update() {
const { id, version } = this.item()
const url = this.parent.current()?.url || ''
@@ -301,21 +282,4 @@ export class UpdatesItemComponent {
this.error.set(e.message)
}
}
private async alert(): Promise<boolean> {
return firstValueFrom(
this.dialog
.openConfirm({
label: 'Warning',
size: 's',
data: {
content:
`${this.i18n.transform('Services that depend on')} ${this.local().stateInfo.manifest.title} ${this.i18n.transform('will no longer work properly and may crash.')}` as i18nKey,
yes: 'Continue',
no: 'Cancel',
},
})
.pipe(defaultIfEmpty(false)),
)
}
}

View File

@@ -84,35 +84,16 @@ export class ControlsService {
})
}
async restart({ id, title }: T.Manifest) {
const packages = await getAllPackages(this.patch)
async restart(id: string) {
const loader = this.loader.open('Restarting').subscribe()
defer(() =>
hasCurrentDeps(id, packages)
? this.dialog
.openConfirm({
label: 'Warning',
size: 's',
data: {
content:
`${this.i18n.transform('Services that depend on')} ${title} ${this.i18n.transform('may temporarily experiences issues')}` as i18nKey,
yes: 'Restart',
no: 'Cancel',
},
})
.pipe(filter(Boolean))
: of(null),
).subscribe(async () => {
const loader = this.loader.open('Restarting').subscribe()
try {
await this.api.restartPackage({ id })
} catch (e: any) {
this.errorService.handleError(e)
} finally {
loader.unsubscribe()
}
})
try {
await this.api.restartPackage({ id })
} catch (e: any) {
this.errorService.handleError(e)
} finally {
loader.unsubscribe()
}
}
private alert(content: T.LocaleString): Promise<boolean> {