github.com/chainopen/ethchaincode@v0.0.0-20190924072703-d975acdaa1c6/dashboard/assets/types/content.jsx (about) 1 // @flow 2 3 // Copyright 2017 The go-ethereum Authors 4 // This file is part of the go-ethereum library. 5 // 6 // The go-ethereum library is free software: you can redistribute it and/or modify 7 // it under the terms of the GNU Lesser General Public License as published by 8 // the Free Software Foundation, either version 3 of the License, or 9 // (at your option) any later version. 10 // 11 // The go-ethereum library is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU Lesser General Public License for more details. 15 // 16 // You should have received a copy of the GNU Lesser General Public License 17 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 18 19 export type Content = { 20 general: General, 21 home: Home, 22 chain: Chain, 23 txpool: TxPool, 24 network: Network, 25 system: System, 26 logs: Logs, 27 }; 28 29 export type ChartEntries = Array<ChartEntry>; 30 31 export type ChartEntry = { 32 value: number, 33 }; 34 35 export type General = { 36 version: ?string, 37 commit: ?string, 38 }; 39 40 export type Home = { 41 /* TODO (kurkomisi) */ 42 }; 43 44 export type Chain = { 45 /* TODO (kurkomisi) */ 46 }; 47 48 export type TxPool = { 49 /* TODO (kurkomisi) */ 50 }; 51 52 export type Network = { 53 peers: Peers, 54 diff: Array<PeerEvent> 55 }; 56 57 export type PeerEvent = { 58 ip: string, 59 id: string, 60 remove: string, 61 location: GeoLocation, 62 connected: Date, 63 disconnected: Date, 64 ingress: ChartEntries, 65 egress: ChartEntries, 66 activity: string, 67 }; 68 69 export type Peers = { 70 bundles: {[string]: PeerBundle}, 71 }; 72 73 export type PeerBundle = { 74 location: GeoLocation, 75 knownPeers: {[string]: KnownPeer}, 76 attempts: Array<UnknownPeer>, 77 }; 78 79 export type KnownPeer = { 80 connected: Array<Date>, 81 disconnected: Array<Date>, 82 ingress: Array<ChartEntries>, 83 egress: Array<ChartEntries>, 84 active: boolean, 85 }; 86 87 export type UnknownPeer = { 88 connected: Date, 89 disconnected: Date, 90 }; 91 92 export type GeoLocation = { 93 country: string, 94 city: string, 95 latitude: number, 96 longitude: number, 97 }; 98 99 export type System = { 100 activeMemory: ChartEntries, 101 virtualMemory: ChartEntries, 102 networkIngress: ChartEntries, 103 networkEgress: ChartEntries, 104 processCPU: ChartEntries, 105 systemCPU: ChartEntries, 106 diskRead: ChartEntries, 107 diskWrite: ChartEntries, 108 }; 109 110 export type Record = { 111 t: string, 112 lvl: Object, 113 msg: string, 114 ctx: Array<string> 115 }; 116 117 export type Chunk = { 118 content: string, 119 name: string, 120 }; 121 122 export type Logs = { 123 chunks: Array<Chunk>, 124 endTop: boolean, 125 endBottom: boolean, 126 topChanged: number, 127 bottomChanged: number, 128 }; 129 130 export type LogsMessage = { 131 source: ?LogFile, 132 chunk: Array<Record>, 133 }; 134 135 export type LogFile = { 136 name: string, 137 last: string, 138 };