2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2021-10-06 10:23:01 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2020-06-19 18:06:58 +00:00
|
|
|
import "../../../shared"
|
2021-07-23 15:08:52 +00:00
|
|
|
|
2021-10-06 10:23:01 +00:00
|
|
|
import "stores"
|
|
|
|
import "views"
|
2020-05-15 21:10:00 +00:00
|
|
|
|
2020-06-23 18:51:10 +00:00
|
|
|
Item {
|
2021-10-06 10:23:01 +00:00
|
|
|
id: root
|
2020-05-15 21:10:00 +00:00
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
2021-10-06 10:23:01 +00:00
|
|
|
property var store: RootStore {}
|
|
|
|
|
2020-05-15 21:10:00 +00:00
|
|
|
ColumnLayout {
|
|
|
|
id: rpcColumn
|
|
|
|
spacing: 0
|
2020-06-23 18:51:10 +00:00
|
|
|
anchors.fill: parent
|
2020-05-15 21:10:00 +00:00
|
|
|
|
2021-10-06 10:23:01 +00:00
|
|
|
RateView {}
|
2021-07-23 15:08:52 +00:00
|
|
|
|
2021-08-23 18:45:00 +00:00
|
|
|
RowLayout {
|
|
|
|
id: peerContainer2
|
|
|
|
Layout.fillWidth: true
|
2021-10-06 10:23:01 +00:00
|
|
|
StatusBaseText {
|
2021-08-23 18:45:00 +00:00
|
|
|
id: peerDescription
|
2021-10-06 10:23:01 +00:00
|
|
|
color: Theme.palette.primaryColor1
|
2021-08-23 18:45:00 +00:00
|
|
|
text: "Peers"
|
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
Layout.leftMargin: Style.current.padding
|
|
|
|
Layout.fillWidth: true
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 20
|
|
|
|
}
|
2021-10-06 10:23:01 +00:00
|
|
|
StatusBaseText {
|
2021-08-23 18:45:00 +00:00
|
|
|
id: peerNumber
|
2021-10-06 10:23:01 +00:00
|
|
|
color: Theme.palette.primaryColor1
|
|
|
|
text: root.store.nodeModelInst.peerSize
|
2021-08-23 18:45:00 +00:00
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
Layout.leftMargin: Style.current.padding
|
|
|
|
Layout.fillWidth: true
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 20
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-25 01:31:20 +00:00
|
|
|
RowLayout {
|
|
|
|
id: bloomF
|
|
|
|
Layout.fillWidth: true
|
2021-10-06 10:23:01 +00:00
|
|
|
StatusBaseText {
|
|
|
|
color: Theme.palette.primaryColor1
|
2021-08-25 12:24:31 +00:00
|
|
|
text: qsTr("Bloom Filter Usage")
|
2021-08-25 01:31:20 +00:00
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
Layout.leftMargin: Style.current.padding
|
|
|
|
Layout.fillWidth: true
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 20
|
|
|
|
}
|
2021-10-06 10:23:01 +00:00
|
|
|
StatusBaseText {
|
2021-08-25 01:31:20 +00:00
|
|
|
id: bloomPerc
|
2021-10-06 10:23:01 +00:00
|
|
|
color: Theme.palette.primaryColor1
|
|
|
|
text: ((root.store.nodeModelInst.bloomBits / 512) * 100).toFixed(2) + "%"
|
2021-08-25 01:31:20 +00:00
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
Layout.leftMargin: Style.current.padding
|
|
|
|
Layout.fillWidth: true
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 20
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-16 18:07:43 +00:00
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
2021-10-06 10:23:01 +00:00
|
|
|
StatusBaseText {
|
|
|
|
color: Theme.palette.primaryColor1
|
2021-09-16 18:07:43 +00:00
|
|
|
text: qsTr("Active Mailserver")
|
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
Layout.leftMargin: Style.current.padding
|
|
|
|
Layout.fillWidth: true
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 20
|
|
|
|
}
|
2021-10-06 10:23:01 +00:00
|
|
|
StatusBaseText {
|
2021-09-16 18:07:43 +00:00
|
|
|
id: activeMailserverTxt
|
2021-10-06 10:23:01 +00:00
|
|
|
color: Theme.palette.directColor1
|
2021-09-16 18:07:43 +00:00
|
|
|
text: "..."
|
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
Layout.leftMargin: Style.current.padding
|
|
|
|
Layout.fillWidth: true
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 14
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Connections {
|
2021-10-06 10:23:01 +00:00
|
|
|
target: root.store.profileModelInst.mailservers
|
2021-09-16 18:07:43 +00:00
|
|
|
onActiveMailserverChanged: (activeMailserver) => {
|
2021-10-06 10:23:01 +00:00
|
|
|
activeMailserverTxt.text = root.store.getMailserverName(activeMailserver) + "\n" + activeMailserver
|
2021-09-16 18:07:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-17 16:16:58 +00:00
|
|
|
ColumnLayout {
|
|
|
|
id: mailserverLogsContainer
|
|
|
|
height: 300
|
2021-10-06 10:23:01 +00:00
|
|
|
StatusBaseText {
|
|
|
|
color: Theme.palette.primaryColor1
|
2021-09-17 16:16:58 +00:00
|
|
|
text: "Mailserver Interactions:"
|
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
Layout.leftMargin: Style.current.padding
|
|
|
|
Layout.fillWidth: true
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 20
|
|
|
|
}
|
2021-10-06 10:23:01 +00:00
|
|
|
// TODO: replace with StatusTextArea once it lives in StatusQ.
|
2021-09-17 16:16:58 +00:00
|
|
|
StyledTextArea {
|
|
|
|
id: mailserverLogTxt
|
|
|
|
text: ""
|
|
|
|
customHeight: 200
|
|
|
|
textField.readOnly: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-14 19:39:29 +00:00
|
|
|
ColumnLayout {
|
|
|
|
id: logContainer
|
|
|
|
height: 300
|
2021-10-06 10:23:01 +00:00
|
|
|
StatusBaseText {
|
2021-09-14 19:39:29 +00:00
|
|
|
id: logHeaderDesc
|
2021-10-06 10:23:01 +00:00
|
|
|
color: Theme.palette.primaryColor1
|
2021-09-14 19:39:29 +00:00
|
|
|
text: "Logs:"
|
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
Layout.leftMargin: Style.current.padding
|
|
|
|
Layout.fillWidth: true
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 20
|
|
|
|
}
|
2021-10-06 10:23:01 +00:00
|
|
|
// TODO: replace with StatusTextArea once it lives in StatusQ.
|
2021-09-14 19:39:29 +00:00
|
|
|
StyledTextArea {
|
|
|
|
id: logsTxt
|
|
|
|
text: ""
|
|
|
|
customHeight: 200
|
|
|
|
textField.readOnly: true
|
|
|
|
}
|
2021-09-17 16:16:58 +00:00
|
|
|
}
|
2021-09-14 19:39:29 +00:00
|
|
|
|
2021-09-17 16:16:58 +00:00
|
|
|
Connections {
|
2021-10-06 10:23:01 +00:00
|
|
|
target: root.store.nodeModelInst
|
2021-09-17 16:16:58 +00:00
|
|
|
function onLog(logContent) {
|
|
|
|
// TODO: this is ugly, but there's not even a design for this section
|
|
|
|
if(logContent.indexOf("mailserver") > 0){
|
|
|
|
let lines = mailserverLogTxt.text.split("\n");
|
|
|
|
if (lines.length > 10){
|
|
|
|
lines.shift();
|
|
|
|
}
|
|
|
|
lines.push(logContent.trim())
|
|
|
|
mailserverLogTxt.text = lines.join("\n")
|
|
|
|
} else {
|
2021-09-14 19:39:29 +00:00
|
|
|
let lines = logsTxt.text.split("\n");
|
|
|
|
if (lines.length > 5){
|
|
|
|
lines.shift();
|
|
|
|
}
|
|
|
|
lines.push(logContent.trim())
|
|
|
|
logsTxt.text = lines.join("\n")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-19 21:00:04 +00:00
|
|
|
ColumnLayout {
|
2020-05-19 20:53:11 +00:00
|
|
|
id: messageContainer
|
|
|
|
Layout.fillHeight: true
|
2021-10-06 10:23:01 +00:00
|
|
|
StatusBaseText {
|
2020-05-19 21:00:04 +00:00
|
|
|
id: testDescription
|
2021-10-06 10:23:01 +00:00
|
|
|
color: Theme.palette.primaryColor1
|
2020-05-19 21:00:04 +00:00
|
|
|
text: "latest block (auto updates):"
|
2020-07-02 15:14:31 +00:00
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
Layout.leftMargin: Style.current.padding
|
2020-05-19 21:00:04 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 20
|
|
|
|
}
|
2021-10-06 10:23:01 +00:00
|
|
|
StatusBaseText {
|
2020-05-19 20:53:11 +00:00
|
|
|
id: test
|
2021-10-06 10:23:01 +00:00
|
|
|
color: Theme.palette.primaryColor1
|
|
|
|
text: root.store.nodeModelInst.lastMessage
|
2020-07-02 15:14:31 +00:00
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
Layout.leftMargin: Style.current.padding
|
2020-05-19 20:53:11 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
font.weight: Font.Medium
|
2020-05-19 21:00:04 +00:00
|
|
|
font.pixelSize: 20
|
2020-05-19 20:53:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-15 21:10:00 +00:00
|
|
|
RowLayout {
|
|
|
|
id: resultContainer
|
|
|
|
Layout.fillHeight: true
|
2020-07-02 15:14:31 +00:00
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
Layout.leftMargin: Style.current.padding
|
2021-10-06 10:23:01 +00:00
|
|
|
// TODO: replace with StatusTextArea once it lives in StatusQ.
|
2020-05-15 21:10:00 +00:00
|
|
|
TextArea { id: callResult; Layout.fillWidth: true; text: nodeModel.callResult; readOnly: true }
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
id: rpcInputContainer
|
|
|
|
height: 70
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.bottomMargin: 0
|
|
|
|
Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
|
|
|
|
transformOrigin: Item.Bottom
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: element2
|
|
|
|
width: 200
|
|
|
|
height: 70
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: rectangle
|
|
|
|
color: "#00000000"
|
2020-07-13 18:45:54 +00:00
|
|
|
border.color: Style.current.border
|
2020-05-15 21:10:00 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: rpcSendBtn
|
|
|
|
x: 100
|
|
|
|
width: 30
|
|
|
|
height: 30
|
|
|
|
text: "\u2191"
|
|
|
|
font.bold: true
|
|
|
|
font.pointSize: 12
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 20
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 16
|
|
|
|
onClicked: {
|
|
|
|
nodeModel.onSend(txtData.text)
|
|
|
|
txtData.text = ""
|
|
|
|
}
|
|
|
|
enabled: txtData.text !== ""
|
|
|
|
background: Rectangle {
|
2020-07-02 15:14:31 +00:00
|
|
|
color: parent.enabled ? Style.current.blue : Style.current.grey
|
2020-05-15 21:10:00 +00:00
|
|
|
radius: 50
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-19 18:21:02 +00:00
|
|
|
StyledTextField {
|
2020-05-15 21:10:00 +00:00
|
|
|
id: txtData
|
|
|
|
text: ""
|
|
|
|
leftPadding: 0
|
|
|
|
padding: 0
|
|
|
|
font.pixelSize: 14
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Type json-rpc message... e.g {\"method\": \"eth_accounts\"}"
|
|
|
|
placeholderText: qsTrId("type-json-rpc-message")
|
2020-05-15 21:10:00 +00:00
|
|
|
anchors.right: rpcSendBtn.left
|
|
|
|
anchors.rightMargin: 16
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 24
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 24
|
|
|
|
Keys.onEnterPressed: {
|
2021-10-06 10:23:01 +00:00
|
|
|
root.store.onSend(txtData.text)
|
2020-05-15 21:10:00 +00:00
|
|
|
txtData.text = ""
|
|
|
|
}
|
|
|
|
Keys.onReturnPressed: {
|
2021-10-06 10:23:01 +00:00
|
|
|
root.store.onSend(txtData.text)
|
2020-05-15 21:10:00 +00:00
|
|
|
txtData.text = ""
|
|
|
|
}
|
|
|
|
background: Rectangle {
|
|
|
|
color: "#00000000"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: mouseArea1
|
|
|
|
anchors.rightMargin: 50
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked : {
|
|
|
|
txtData.forceActiveFocus(Qt.MouseFocusReason)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;formeditorZoom:0.5;height:770;width:1152}
|
|
|
|
}
|
|
|
|
##^##*/
|