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