fix alerts i18n, fix status display, better, remove usb media, hide shutdown for install complete

This commit is contained in:
Matt Hill
2026-02-04 11:19:58 -07:00
parent 58e0b166cb
commit 2baf1a880b
12 changed files with 210 additions and 54 deletions

View File

@@ -35,7 +35,7 @@ type OnionForm = {
selector: 'section[torDomains]',
template: `
<header>
Tor Domains
{{ 'Tor Domains' | i18n }}
<a
tuiIconButton
docsLink

View File

@@ -4,6 +4,7 @@ import {
ErrorService,
i18nKey,
i18nPipe,
i18nService,
LoadingService,
} from '@start9labs/shared'
import { T } from '@start9labs/start-sdk'
@@ -24,6 +25,7 @@ export class ControlsService {
private readonly api = inject(ApiService)
private readonly patch = inject<PatchDB<DataModel>>(PatchDB)
private readonly i18n = inject(i18nPipe)
private readonly i18nService = inject(i18nService)
async start({ title, alerts, id }: T.Manifest, unmet: boolean) {
const deps =
@@ -31,7 +33,7 @@ export class ControlsService {
if (
(unmet && !(await this.alert(deps))) ||
(alerts.start && !(await this.alert(alerts.start as i18nKey)))
(alerts.start && !(await this.alert(alerts.start)))
) {
return
}
@@ -49,7 +51,7 @@ export class ControlsService {
async stop({ id, title, alerts }: T.Manifest) {
const depMessage = `${this.i18n.transform('Services that depend on')} ${title} ${this.i18n.transform('will no longer work properly and may crash.')}`
let content = alerts.stop || ''
let content = alerts.stop ? this.i18nService.localize(alerts.stop) : ''
if (hasCurrentDeps(id, await getAllPackages(this.patch))) {
content = content ? `${content}.\n\n${depMessage}` : depMessage
@@ -113,14 +115,14 @@ export class ControlsService {
})
}
private alert(content: i18nKey): Promise<boolean> {
private alert(content: T.LocaleString): Promise<boolean> {
return firstValueFrom(
this.dialog
.openConfirm({
label: 'Warning',
size: 's',
data: {
content,
content: this.i18nService.localize(content),
yes: 'Continue',
no: 'Cancel',
},

View File

@@ -31,7 +31,7 @@ export function getInstalledBaseStatus(statusInfo: T.StatusInfo): BaseStatus {
(!statusInfo.started ||
Object.values(statusInfo.health)
.filter(h => !!h)
.some(h => h.result === 'starting'))
.some(h => h.result === 'starting' || h.result === 'waiting'))
) {
return 'starting'
}

View File

@@ -5,6 +5,7 @@ import {
ErrorService,
i18nKey,
i18nPipe,
i18nService,
LoadingService,
} from '@start9labs/shared'
import { T } from '@start9labs/start-sdk'
@@ -27,6 +28,7 @@ export class StandardActionsService {
private readonly loader = inject(LoadingService)
private readonly router = inject(Router)
private readonly i18n = inject(i18nPipe)
private readonly i18nService = inject(i18nService)
async rebuild(id: string) {
const loader = this.loader.open('Rebuilding container').subscribe()
@@ -50,11 +52,12 @@ export class StandardActionsService {
): Promise<void> {
let content = soft
? ''
: alerts.uninstall ||
`${this.i18n.transform('Uninstalling')} ${title} ${this.i18n.transform('will permanently delete its data.')}`
: alerts.uninstall
? this.i18nService.localize(alerts.uninstall)
: `${this.i18n.transform('Uninstalling')} ${title} ${this.i18n.transform('will permanently delete its data.')}`
if (hasCurrentDeps(id, await getAllPackages(this.patch))) {
content = `${content}${content ? ' ' : ''}${this.i18n.transform('Services that depend on')} ${title} ${this.i18n.transform('will no longer work properly and may crash.')}`
content = `${content ? `${content} ` : ''}${this.i18n.transform('Services that depend on')} ${title} ${this.i18n.transform('will no longer work properly and may crash.')}`
}
if (!content) {