mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-17 00:56:39 +00:00
display peer number in node tab
This commit is contained in:
parent
329d37e377
commit
067ed7b255
@ -30,7 +30,9 @@ proc init*(self: NodeController) =
|
|||||||
self.view.setLastMessage($WalletSignal(e).blockNumber)
|
self.view.setLastMessage($WalletSignal(e).blockNumber)
|
||||||
|
|
||||||
self.status.events.on(SignalType.DiscoverySummary.event) do(e:Args):
|
self.status.events.on(SignalType.DiscoverySummary.event) do(e:Args):
|
||||||
self.status.network.peerSummaryChange(DiscoverySummarySignal(e).enodes)
|
var data = DiscoverySummarySignal(e)
|
||||||
|
self.status.network.peerSummaryChange(data.enodes)
|
||||||
|
self.view.setPeerSize(data.enodes.len)
|
||||||
|
|
||||||
self.status.events.on(SignalType.Stats.event) do (e:Args):
|
self.status.events.on(SignalType.Stats.event) do (e:Args):
|
||||||
self.view.setStats(StatsSignal(e).stats)
|
self.view.setStats(StatsSignal(e).stats)
|
||||||
|
@ -13,6 +13,7 @@ QtObject:
|
|||||||
wakuBloomFilterMode*: bool
|
wakuBloomFilterMode*: bool
|
||||||
fullNode*: bool
|
fullNode*: bool
|
||||||
stats*: Stats
|
stats*: Stats
|
||||||
|
peerSize: int
|
||||||
|
|
||||||
proc setup(self: NodeView) =
|
proc setup(self: NodeView) =
|
||||||
self.QObject.setup
|
self.QObject.setup
|
||||||
@ -142,4 +143,19 @@ QtObject:
|
|||||||
|
|
||||||
QtProperty[string] downloadRate:
|
QtProperty[string] downloadRate:
|
||||||
read = downloadRate
|
read = downloadRate
|
||||||
notify = statsChanged
|
notify = statsChanged
|
||||||
|
|
||||||
|
proc getPeerSize*(self: NodeView): int {.slot.} = self.peerSize
|
||||||
|
|
||||||
|
proc peerSizeChanged*(self: NodeView, value: int) {.signal.}
|
||||||
|
|
||||||
|
proc setPeerSize*(self: NodeView, value: int) {.slot.} =
|
||||||
|
self.peerSize = value
|
||||||
|
self.peerSizeChanged(value)
|
||||||
|
|
||||||
|
proc resetPeers*(self: NodeView) {.slot.} =
|
||||||
|
self.setPeerSize(0)
|
||||||
|
|
||||||
|
QtProperty[int] peerSize:
|
||||||
|
read = getPeerSize
|
||||||
|
notify = peerSizeChanged
|
||||||
|
@ -20,6 +20,31 @@ Item {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: peerContainer2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
StyledText {
|
||||||
|
id: peerDescription
|
||||||
|
color: Style.current.lightBlueText
|
||||||
|
text: "Peers"
|
||||||
|
Layout.rightMargin: Style.current.padding
|
||||||
|
Layout.leftMargin: Style.current.padding
|
||||||
|
Layout.fillWidth: true
|
||||||
|
font.weight: Font.Medium
|
||||||
|
font.pixelSize: 20
|
||||||
|
}
|
||||||
|
StyledText {
|
||||||
|
id: peerNumber
|
||||||
|
color: Style.current.lightBlueText
|
||||||
|
text: nodeModel.peerSize
|
||||||
|
Layout.rightMargin: Style.current.padding
|
||||||
|
Layout.leftMargin: Style.current.padding
|
||||||
|
Layout.fillWidth: true
|
||||||
|
font.weight: Font.Medium
|
||||||
|
font.pixelSize: 20
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: messageContainer
|
id: messageContainer
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user