mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
Compare commits
1 Commits
master
...
next/major
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d49689b1e |
@@ -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',
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user