Files
purple-electrumwallet/electrum/gui/qml/components/NetworkStats.qml
T

105 lines
2.4 KiB
QML
Raw Normal View History

2021-04-05 12:24:45 +02:00
import QtQuick 2.6
import QtQuick.Layouts 1.0
import QtQuick.Controls 2.0
import QtQuick.Controls.Material 2.0
2022-07-21 19:41:26 +02:00
import "controls"
2021-04-07 16:50:34 +02:00
Pane {
2021-04-05 12:24:45 +02:00
property string title: qsTr('Network')
GridLayout {
columns: 2
2022-03-23 13:48:30 +01:00
Label {
text: qsTr("Network: ");
color: Material.primaryHighlightedTextColor;
font.bold: true
}
Label {
text: Network.networkName
}
Label {
text: qsTr("Server: ");
color: Material.primaryHighlightedTextColor;
font.bold: true
}
Label {
text: Network.server
}
Label {
text: qsTr("Local Height: ");
color: Material.primaryHighlightedTextColor;
font.bold: true
}
Label {
text: Network.height
}
Label {
text: qsTr("Status: ");
color: Material.primaryHighlightedTextColor;
font.bold: true
}
2022-07-21 19:41:26 +02:00
RowLayout {
NetworkStatusIndicator {}
2022-07-21 19:41:26 +02:00
Label {
text: Network.status
}
2022-03-23 13:48:30 +01:00
}
Label {
text: qsTr("Network fees: ");
color: Material.primaryHighlightedTextColor;
font.bold: true
}
Label {
id: feeHistogram
}
Label {
text: qsTr("Gossip: ");
color: Material.primaryHighlightedTextColor;
font.bold: true
}
ColumnLayout {
visible: Config.useGossip
Label {
text: qsTr('%1 peers').arg(Network.gossipInfo.peers)
}
Label {
text: qsTr('%1 channels to fetch').arg(Network.gossipInfo.unknown_channels)
}
Label {
text: qsTr('%1 nodes, %2 channels').arg(Network.gossipInfo.db_nodes).arg(Network.gossipInfo.db_channels)
}
}
Label {
text: qsTr("disabled");
visible: !Config.useGossip
2022-03-23 13:48:30 +01:00
}
2021-04-05 12:24:45 +02:00
}
2022-03-23 13:48:30 +01:00
function setFeeHistogram() {
var txt = ''
Network.feeHistogram.forEach(function(item) {
txt = txt + item[0] + ': ' + item[1] + '\n';
})
feeHistogram.text = txt.trim()
}
Connections {
target: Network
function onFeeHistogramUpdated() {
setFeeHistogram()
}
}
Component.onCompleted: setFeeHistogram()
2021-04-05 12:24:45 +02:00
}