mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-06-14 06:01:04 +00:00
Reorganize Node components and state
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
import { Node } from './components/Node';
|
||||
import { Types, Maybe } from '@dotstats/common';
|
||||
|
||||
export namespace State {
|
||||
export interface Node {
|
||||
id: Types.NodeId;
|
||||
nodeDetails: Types.NodeDetails;
|
||||
nodeStats: Types.NodeStats;
|
||||
blockDetails: Types.BlockDetails;
|
||||
location: Maybe<Types.NodeLocation>;
|
||||
}
|
||||
}
|
||||
|
||||
export interface State {
|
||||
status: 'online' | 'offline' | 'upgrade-requested';
|
||||
best: Types.BlockNumber;
|
||||
@@ -9,7 +18,7 @@ export interface State {
|
||||
timeDiff: Types.Milliseconds;
|
||||
subscribed: Maybe<Types.ChainLabel>;
|
||||
chains: Map<Types.ChainLabel, Types.NodeCount>;
|
||||
nodes: Map<Types.NodeId, Node.Props>;
|
||||
nodes: Map<Types.NodeId, State.Node>;
|
||||
}
|
||||
|
||||
export type Update = <K extends keyof State>(changes: Pick<State, K> | null) => Readonly<State>;
|
||||
|
||||
Reference in New Issue
Block a user