fix: write agent version into the log when upgrade firmware (#802)
This commit is contained in:
committed by
László Monda
parent
8afdeac306
commit
edcff069fd
@@ -1,7 +1,14 @@
|
||||
import { Injectable, NgZone } from '@angular/core';
|
||||
import { Action, Store } from '@ngrx/store';
|
||||
|
||||
import { DeviceConnectionState, IpcEvents, IpcResponse, LogService, SaveUserConfigurationData } from 'uhk-common';
|
||||
import {
|
||||
DeviceConnectionState,
|
||||
IpcEvents,
|
||||
IpcResponse,
|
||||
LogService,
|
||||
SaveUserConfigurationData,
|
||||
UpdateFirmwareData
|
||||
} from 'uhk-common';
|
||||
import { AppState } from '../store';
|
||||
import { IpcCommonRenderer } from './ipc-common-renderer';
|
||||
import {
|
||||
@@ -34,12 +41,8 @@ export class DeviceRendererService {
|
||||
this.ipcRenderer.send(IpcEvents.device.loadConfigurations);
|
||||
}
|
||||
|
||||
updateFirmware(data?: Array<number>): void {
|
||||
if (data) {
|
||||
this.ipcRenderer.send(IpcEvents.device.updateFirmware, JSON.stringify(data));
|
||||
} else {
|
||||
this.ipcRenderer.send(IpcEvents.device.updateFirmware);
|
||||
}
|
||||
updateFirmware(data: UpdateFirmwareData): void {
|
||||
this.ipcRenderer.send(IpcEvents.device.updateFirmware, JSON.stringify(data));
|
||||
}
|
||||
|
||||
startConnectionPoller(): void {
|
||||
|
||||
@@ -50,6 +50,7 @@ import {
|
||||
} from '../actions/user-config';
|
||||
import { DefaultUserConfigurationService } from '../../services/default-user-configuration.service';
|
||||
import { DataStorageRepositoryService } from '../../services/datastorage-repository.service';
|
||||
import { getVersions } from '../../util';
|
||||
|
||||
@Injectable()
|
||||
export class DeviceEffects {
|
||||
@@ -201,12 +202,17 @@ export class DeviceEffects {
|
||||
|
||||
@Effect({dispatch: false}) updateFirmware$ = this.actions$
|
||||
.ofType<UpdateFirmwareAction>(ActionTypes.UPDATE_FIRMWARE)
|
||||
.do(() => this.deviceRendererService.updateFirmware());
|
||||
.do(() => this.deviceRendererService.updateFirmware({
|
||||
versionInformation: getVersions()
|
||||
}));
|
||||
|
||||
@Effect({dispatch: false}) updateFirmwareWith$ = this.actions$
|
||||
.ofType<UpdateFirmwareWithAction>(ActionTypes.UPDATE_FIRMWARE_WITH)
|
||||
.map(action => action.payload)
|
||||
.do(data => this.deviceRendererService.updateFirmware(data));
|
||||
.do(data => this.deviceRendererService.updateFirmware({
|
||||
versionInformation: getVersions(),
|
||||
firmware: data
|
||||
}));
|
||||
|
||||
@Effect() updateFirmwareReply$ = this.actions$
|
||||
.ofType<UpdateFirmwareReplyAction>(ActionTypes.UPDATE_FIRMWARE_REPLY)
|
||||
|
||||
Reference in New Issue
Block a user