Skip to content
Permalink
Browse files

[DDW-656] Log Daedalus state snapshot

  • Loading branch information...
DeeJayElly committed Jul 12, 2019
1 parent 565a4de commit 2506429e5a7ca372fd0a5b0f93d306d7a888e030
@@ -77,6 +77,13 @@ export const GET_STATE_DIRECTORY_PATH_CHANNEL = 'GetStateDirectoryPathChannel';
export type GetStateDirectoryPathRendererRequest = string | any;
export type GetStateDirectoryPathMainResponse = any;

/**
* Channel for getting log state snapshot
*/
export const GET_LOG_STATE_SNAPSHOT_CHANNEL = 'GetLogStateSnapshotChannel';
export type GetLogStateSnapshotRendererRequest = any;
export type GetLogStateSnapshotMainResponse = any;

/**
* Channel for loading a base64 encoded asset from within the `source/renderer` folder
*/
@@ -7,4 +7,5 @@ export default class NetworkStatusActions {
isSyncedAndReady: Action<any> = new Action();
tlsConfigIsReady: Action<any> = new Action();
restartNode: Action<any> = new Action();
logStateSnapshot: Action<any> = new Action();
}
@@ -76,7 +76,8 @@ export default class LoadingSyncingConnectingPage extends Component<Props> {
};

handleDownloadLogs = () => {
const { app } = this.props.actions;
const { app, networkStatus } = this.props.actions;
networkStatus.logStateSnapshot.trigger();
app.downloadLogs.trigger();
app.setNotificationVisibility.trigger(true);
};
@@ -39,7 +39,8 @@ export default class SupportSettingsPage extends Component<InjectedProps> {
};

handleDownloadLogs = () => {
const { app } = this.props.actions;
const { app, networkStatus } = this.props.actions;
networkStatus.logStateSnapshot.trigger();
app.downloadLogs.trigger();
app.setNotificationVisibility.trigger(true);
};
@@ -0,0 +1,13 @@
// @flow
import { GET_LOG_STATE_SNAPSHOT_CHANNEL } from '../../../common/ipc/api';
import type {
GetLogStateSnapshotRendererRequest,
GetLogStateSnapshotMainResponse,
} from '../../../common/ipc/api';
import { RendererIpcChannel } from './lib/RendererIpcChannel';

export const getLogStateSnapshotChannel: // IpcChannel<Incoming, Outgoing>
RendererIpcChannel<
GetLogStateSnapshotMainResponse,
GetLogStateSnapshotRendererRequest
> = new RendererIpcChannel(GET_LOG_STATE_SNAPSHOT_CHANNEL);
@@ -23,6 +23,7 @@ import {
import { CardanoNodeStates } from '../../../common/types/cardano-node.types';
import { getDiskSpaceStatusChannel } from '../ipc/getDiskSpaceChannel.js';
import { getStateDirectoryPathChannel } from '../ipc/getStateDirectoryPathChannel';
import { getLogStateSnapshotChannel } from '../ipc/getLogStateSnapshotChannel';
import type { GetNetworkStatusResponse } from '../api/nodes/types';
import type {
CardanoNodeState,
@@ -145,6 +146,8 @@ export default class NetworkStatusStore extends Store {
this._checkDiskSpace();

this._getStateDirectoryPath();

this.actions.networkStatus.logStateSnapshot.listen(this._logStateSnapshot);
}

// Setup network status polling interval
@@ -612,6 +615,10 @@ export default class NetworkStatusStore extends Store {
this.stateDirectoryPath = stateDirectoryPath;
};

@action _logStateSnapshot = () => {
getLogStateSnapshotChannel.send();
};

// DEFINE COMPUTED VALUES

@computed get isConnected(): boolean {

0 comments on commit 2506429

Please sign in to comment.
You can’t perform that action at this time.