feat: rewrite setup wizard
This commit is contained in:
@ -6,8 +6,8 @@ import {MatFormFieldModule} from "@angular/material/form-field";
|
||||
import {MatSelectModule} from "@angular/material/select";
|
||||
import {MatInput} from "@angular/material/input";
|
||||
import {MatTooltip} from "@angular/material/tooltip";
|
||||
import {MatButton, MatIconButton} from "@angular/material/button";
|
||||
import {MatCheckbox} from "@angular/material/checkbox";
|
||||
import {of} from "rxjs";
|
||||
|
||||
@Component({
|
||||
selector: 'app-logging',
|
||||
@ -18,9 +18,7 @@ import {MatCheckbox} from "@angular/material/checkbox";
|
||||
MatSelectModule,
|
||||
MatInput,
|
||||
MatTooltip,
|
||||
MatIconButton,
|
||||
MatCheckbox,
|
||||
MatButton
|
||||
MatCheckbox
|
||||
|
||||
],
|
||||
templateUrl: './logging.component.html'
|
||||
@ -39,12 +37,11 @@ export class LoggingComponent {
|
||||
}
|
||||
}
|
||||
|
||||
protected skipButton() {
|
||||
this.navigationService.skipNavigation.emit(() => this.api.setLogging(null));
|
||||
}
|
||||
|
||||
constructor(
|
||||
private navigationService: NavigationService, private formBuilder: FormBuilder, private api: SetupService) {
|
||||
this.navigationService.setSkipButtonState(true);
|
||||
this.navigationService.skipButtonAction = () => this.api.setLogging(null);
|
||||
|
||||
this.loggingSettings = this.formBuilder.group({
|
||||
enabled: [true, Validators.required],
|
||||
logPath: [''],
|
||||
@ -59,11 +56,23 @@ export class LoggingComponent {
|
||||
|
||||
this.navigationService.nextButtonAction = () => {
|
||||
return this.api.setLogging({
|
||||
"enableLogToFile": this.loggingSettings.get('cron')?.value,
|
||||
"enableLogToFile": this.loggingSettings.get('enabled')?.value,
|
||||
"logFileName": this.loggingSettings.get('logName')?.value,
|
||||
"logFilePath": this.loggingSettings.get('logPath')?.value
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
api.loggingConfiguration().subscribe(x => {
|
||||
if (!x)
|
||||
return;
|
||||
|
||||
this.navigationService.skipButtonAction = () => of(true);
|
||||
this.navigationService.triggerAutoSkip(this.navigationService.skipButtonAction);
|
||||
|
||||
this.loggingSettings.get('enabled')?.setValue(x.enableLogToFile);
|
||||
this.loggingSettings.get('logName')?.setValue(x.logFileName);
|
||||
this.loggingSettings.get('logPath')?.setValue(x.logFilePath);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user