mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
task fix and keyboard fix
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { Component, inject, signal } from '@angular/core'
|
||||
import { Router } from '@angular/router'
|
||||
import { FormsModule } from '@angular/forms'
|
||||
import {
|
||||
getAllKeyboardsSorted,
|
||||
@@ -72,7 +71,6 @@ import { StateService } from '../services/state.service'
|
||||
],
|
||||
})
|
||||
export default class KeyboardPage {
|
||||
private readonly router = inject(Router)
|
||||
private readonly api = inject(ApiService)
|
||||
private readonly stateService = inject(StateService)
|
||||
|
||||
@@ -103,22 +101,9 @@ export default class KeyboardPage {
|
||||
})
|
||||
|
||||
this.stateService.keyboard = this.selected.layout
|
||||
await this.navigateToNextStep()
|
||||
await this.stateService.navigateAfterLocale()
|
||||
} finally {
|
||||
this.saving.set(false)
|
||||
}
|
||||
}
|
||||
|
||||
private async navigateToNextStep() {
|
||||
if (this.stateService.dataDriveGuid) {
|
||||
if (this.stateService.attach) {
|
||||
this.stateService.setupType = 'attach'
|
||||
await this.router.navigate(['/password'])
|
||||
} else {
|
||||
await this.router.navigate(['/home'])
|
||||
}
|
||||
} else {
|
||||
await this.router.navigate(['/drives'])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,8 +141,12 @@ export default class LanguagePage {
|
||||
|
||||
try {
|
||||
await this.api.setLanguage({ language: this.selected.name })
|
||||
// Always go to keyboard selection
|
||||
await this.router.navigate(['/keyboard'])
|
||||
|
||||
if (this.stateService.kiosk) {
|
||||
await this.router.navigate(['/keyboard'])
|
||||
} else {
|
||||
await this.stateService.navigateAfterLocale()
|
||||
}
|
||||
} finally {
|
||||
this.saving.set(false)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { inject, Injectable } from '@angular/core'
|
||||
import { Router } from '@angular/router'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
import { ApiService } from './api.service'
|
||||
|
||||
@@ -29,6 +30,7 @@ export type RecoverySource =
|
||||
})
|
||||
export class StateService {
|
||||
private readonly api = inject(ApiService)
|
||||
private readonly router = inject(Router)
|
||||
|
||||
// Determined at app init
|
||||
kiosk = false
|
||||
@@ -45,6 +47,23 @@ export class StateService {
|
||||
setupType?: SetupType
|
||||
recoverySource?: RecoverySource
|
||||
|
||||
/**
|
||||
* Navigate to the appropriate step after language/keyboard selection.
|
||||
* Keyboard selection is only needed in kiosk mode.
|
||||
*/
|
||||
async navigateAfterLocale(): Promise<void> {
|
||||
if (this.dataDriveGuid) {
|
||||
if (this.attach) {
|
||||
this.setupType = 'attach'
|
||||
await this.router.navigate(['/password'])
|
||||
} else {
|
||||
await this.router.navigate(['/home'])
|
||||
}
|
||||
} else {
|
||||
await this.router.navigate(['/drives'])
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called for attach flow (existing data drive)
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,6 @@ import {
|
||||
ALLOWED_STATUSES,
|
||||
getInstalledBaseStatus,
|
||||
INACTIVE_STATUSES,
|
||||
renderPkgStatus,
|
||||
} from 'src/app/services/pkg-status-rendering.service'
|
||||
import { getManifest } from 'src/app/utils/get-package-data'
|
||||
|
||||
@@ -153,7 +152,7 @@ export class ServiceTaskComponent {
|
||||
const action = pkg.actions[this.task().actionId]
|
||||
if (!action) return this.i18n.transform('Action not found')!
|
||||
|
||||
const status = renderPkgStatus(pkg).primary
|
||||
const status = getInstalledBaseStatus(pkg.statusInfo)
|
||||
|
||||
if (INACTIVE_STATUSES.includes(status)) return status as string
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@ import { getManifest } from 'src/app/utils/get-package-data'
|
||||
import { ServiceActionComponent } from '../components/action.component'
|
||||
import {
|
||||
ALLOWED_STATUSES,
|
||||
BaseStatus,
|
||||
getInstalledBaseStatus,
|
||||
INACTIVE_STATUSES,
|
||||
PrimaryStatus,
|
||||
renderPkgStatus,
|
||||
} from 'src/app/services/pkg-status-rendering.service'
|
||||
import { FormDialogService } from 'src/app/services/form-dialog.service'
|
||||
import { FormComponent } from 'src/app/routes/portal/components/form.component'
|
||||
@@ -108,7 +108,7 @@ export default class ServiceActionsRoute {
|
||||
const specialGroup = Object.values(pkg.actions).some(a => !!a.group)
|
||||
? 'Other'
|
||||
: 'General'
|
||||
const status = renderPkgStatus(pkg).primary
|
||||
const status = getInstalledBaseStatus(pkg.statusInfo)
|
||||
return {
|
||||
status,
|
||||
icon: pkg.icon,
|
||||
@@ -187,7 +187,7 @@ export default class ServiceActionsRoute {
|
||||
}
|
||||
|
||||
handle(
|
||||
status: PrimaryStatus,
|
||||
status: BaseStatus,
|
||||
icon: string,
|
||||
{ id, title }: T.Manifest,
|
||||
action: T.ActionMetadata & { id: string },
|
||||
|
||||
Reference in New Issue
Block a user