mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
refactor app wizards completely (#1537)
* refactor app wizards completely * display new and new options in config Co-authored-by: Matt Hill <matthill@Matt-M1.start9.dev>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core'
|
||||
import { capitalizeFirstLetter } from '@start9labs/shared'
|
||||
import { BaseSlide } from '../wizard-types'
|
||||
|
||||
@Component({
|
||||
selector: 'complete',
|
||||
templateUrl: './complete.component.html',
|
||||
styleUrls: ['../app-wizard.component.scss'],
|
||||
})
|
||||
export class CompleteComponent implements BaseSlide {
|
||||
@Input() params: {
|
||||
verb: string // loader verb: '*stopping* ...'
|
||||
title: string
|
||||
Fn: () => Promise<any>
|
||||
}
|
||||
|
||||
@Output() onSuccess: EventEmitter<void> = new EventEmitter()
|
||||
@Output() onError: EventEmitter<string> = new EventEmitter()
|
||||
|
||||
message: string
|
||||
|
||||
loading = true
|
||||
|
||||
async load() {
|
||||
this.message =
|
||||
capitalizeFirstLetter(this.params.verb) + ' ' + this.params.title
|
||||
try {
|
||||
await this.params.Fn()
|
||||
this.onSuccess.emit()
|
||||
} catch (e: any) {
|
||||
this.onError.emit(`Error: ${e.message || e}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user