mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
fix alerts i18n, fix status display, better, remove usb media, hide shutdown for install complete
This commit is contained in:
@@ -35,7 +35,7 @@ type OnionForm = {
|
||||
selector: 'section[torDomains]',
|
||||
template: `
|
||||
<header>
|
||||
Tor Domains
|
||||
{{ 'Tor Domains' | i18n }}
|
||||
<a
|
||||
tuiIconButton
|
||||
docsLink
|
||||
|
||||
@@ -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',
|
||||
},
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user