fix: device recovery mode (#879)
This commit is contained in:
committed by
László Monda
parent
8c7d625573
commit
9112b597f8
@@ -5,7 +5,6 @@ import { DeviceFirmwareComponent } from './firmware/device-firmware.component';
|
||||
import { MouseSpeedComponent } from './mouse-speed/mouse-speed.component';
|
||||
import { LEDBrightnessComponent } from './led-brightness/led-brightness.component';
|
||||
import { RestoreConfigurationComponent } from './restore-configuration/restore-configuration.component';
|
||||
import { RecoveryModeComponent } from './recovery-mode/recovery-mode.component';
|
||||
|
||||
export const deviceRoutes: Routes = [
|
||||
{
|
||||
@@ -35,10 +34,6 @@ export const deviceRoutes: Routes = [
|
||||
{
|
||||
path: 'restore-user-configuration',
|
||||
component: RestoreConfigurationComponent
|
||||
},
|
||||
{
|
||||
path: 'recovery-mode',
|
||||
component: RecoveryModeComponent
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -15,6 +15,11 @@
|
||||
[disabled]="flashFirmwareButtonDisbabled$ | async"
|
||||
(click)="onRecoveryDevice()">Fix device
|
||||
</button>
|
||||
<button class="btn btn-default"
|
||||
type="button"
|
||||
[disabled]="updatingFirmware$ | async"
|
||||
(click)="onClose()">Close
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex-grow">
|
||||
|
||||
@@ -3,8 +3,8 @@ import { Store } from '@ngrx/store';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
import { XtermLog } from '../../../models/xterm-log';
|
||||
import { AppState, flashFirmwareButtonDisbabled, xtermLog } from '../../../store';
|
||||
import { RecoveryDeviceAction } from '../../../store/actions/device';
|
||||
import { AppState, flashFirmwareButtonDisbabled, updatingFirmware, xtermLog } from '../../../store';
|
||||
import { RecoveryDeviceAction, StartConnectionPollerAction } from '../../../store/actions/device';
|
||||
|
||||
@Component({
|
||||
selector: 'device-recovery-mode',
|
||||
@@ -17,6 +17,7 @@ import { RecoveryDeviceAction } from '../../../store/actions/device';
|
||||
})
|
||||
export class RecoveryModeComponent implements OnInit {
|
||||
flashFirmwareButtonDisbabled$: Observable<boolean>;
|
||||
updatingFirmware$: Observable<boolean>;
|
||||
|
||||
xtermLog$: Observable<Array<XtermLog>>;
|
||||
|
||||
@@ -25,10 +26,15 @@ export class RecoveryModeComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.flashFirmwareButtonDisbabled$ = this.store.select(flashFirmwareButtonDisbabled);
|
||||
this.updatingFirmware$ = this.store.select(updatingFirmware);
|
||||
this.xtermLog$ = this.store.select(xtermLog);
|
||||
}
|
||||
|
||||
onRecoveryDevice(): void {
|
||||
this.store.dispatch(new RecoveryDeviceAction());
|
||||
}
|
||||
|
||||
onClose(): void {
|
||||
this.store.dispatch(new StartConnectionPollerAction());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user