db757edcd2
Allows us to have a new config provider for each setup, with no overlap of the directories used, and automatic cleanup of those directories.
46 lines
1 KiB
TypeScript
46 lines
1 KiB
TypeScript
import { Component, Inject } from 'ng-metadata/core';
|
|
const templateUrl = require('./config-setup-app.component.html');
|
|
|
|
/**
|
|
* Initial Screen and Choice in the Config App
|
|
*/
|
|
@Component({
|
|
selector: 'config-setup-app',
|
|
templateUrl: templateUrl,
|
|
})
|
|
export class ConfigSetupAppComponent {
|
|
private state
|
|
: 'choice'
|
|
| 'setup'
|
|
| 'load'
|
|
| 'download';
|
|
|
|
private loadedConfig = false;
|
|
|
|
constructor(@Inject('ApiService') private apiService) {
|
|
this.state = 'choice';
|
|
}
|
|
|
|
private chooseSetup(): void {
|
|
this.apiService.scStartNewConfig()
|
|
.then(() => {
|
|
this.state = 'setup';
|
|
})
|
|
.catch(this.apiService.errorDisplay(
|
|
'Could not initialize new setup. Please report this error'
|
|
));
|
|
}
|
|
|
|
private chooseLoad(): void {
|
|
this.state = 'load';
|
|
this.loadedConfig = true;
|
|
}
|
|
|
|
private configLoaded(): void {
|
|
this.state = 'setup';
|
|
}
|
|
|
|
private setupCompleted(): void {
|
|
this.state = 'download';
|
|
}
|
|
}
|