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
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
import StatusQ.Layout 0.1
|
2021-10-06 10:23:01 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-11-24 18:58:48 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2021-10-06 10:23:01 +00:00
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.controls 1.0
|
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
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
StatusSectionLayout {
|
2021-10-06 10:23:01 +00:00
|
|
|
id: root
|
2020-05-15 21:10:00 +00:00
|
|
|
|
2021-11-15 10:17:41 +00:00
|
|
|
property RootStore store: RootStore {}
|
2021-10-06 10:23:01 +00:00
|
|
|
|
2022-10-26 16:00:20 +00:00
|
|
|
notificationCount: activityCenterStore.unreadNotificationsCount
|
2023-02-07 15:53:56 +00:00
|
|
|
hasUnseenNotifications: activityCenterStore.hasUnseenNotifications
|
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
onNotificationButtonClicked: Global.openActivityCenterPopup()
|
2023-02-07 15:53:56 +00:00
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
centerPanel: ColumnLayout {
|
2020-05-15 21:10:00 +00:00
|
|
|
id: rpcColumn
|
|
|
|
spacing: 0
|
2020-06-23 18:51:10 +00:00
|
|
|
anchors.fill: parent
|
2020-05-15 21:10:00 +00:00
|
|
|
|
2021-11-15 10:17:41 +00:00
|
|
|
RateView {
|
|
|
|
store: root.store
|
|
|
|
}
|
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
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
2021-11-15 10:17:41 +00:00
|
|
|
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-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
|
|
|
|
}
|
2024-09-11 11:49:20 +00:00
|
|
|
StatusTextArea {
|
2021-09-17 16:16:58 +00:00
|
|
|
id: mailserverLogTxt
|
2022-01-11 23:16:17 +00:00
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
Layout.leftMargin: Style.current.padding
|
|
|
|
Layout.fillWidth: true
|
2024-09-11 11:49:20 +00:00
|
|
|
Layout.preferredHeight: 200
|
2021-09-17 16:16:58 +00:00
|
|
|
text: ""
|
2024-09-11 11:49:20 +00:00
|
|
|
readOnly: true
|
2021-09-17 16:16:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|
2024-09-11 11:49:20 +00:00
|
|
|
StatusTextArea {
|
2021-09-14 19:39:29 +00:00
|
|
|
id: logsTxt
|
2022-01-11 23:16:17 +00:00
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
Layout.leftMargin: Style.current.padding
|
|
|
|
Layout.fillWidth: true
|
2024-09-11 11:49:20 +00:00
|
|
|
Layout.preferredHeight: 200
|
2021-09-14 19:39:29 +00:00
|
|
|
text: ""
|
2024-09-11 11:49:20 +00:00
|
|
|
readOnly: true
|
2021-09-14 19:39:29 +00:00
|
|
|
}
|
2021-09-17 16:16:58 +00:00
|
|
|
}
|
2021-09-14 19:39:29 +00:00
|
|
|
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
2021-11-15 10:17:41 +00:00
|
|
|
Connections {
|
|
|
|
target: root.store.nodeModelInst
|
|
|
|
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 {
|
|
|
|
let lines = logsTxt.text.split("\n");
|
|
|
|
if (lines.length > 5){
|
|
|
|
lines.shift();
|
|
|
|
}
|
|
|
|
lines.push(logContent.trim())
|
|
|
|
logsTxt.text = lines.join("\n")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-09-14 19:39:29 +00:00
|
|
|
|
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
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
2021-11-15 10:17:41 +00:00
|
|
|
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: 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: {
|
2021-11-15 10:17:41 +00:00
|
|
|
root.store.onSend(txtData.text)
|
2020-05-15 21:10:00 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-11 11:49:20 +00:00
|
|
|
StatusTextField {
|
2020-05-15 21:10:00 +00:00
|
|
|
id: txtData
|
|
|
|
text: ""
|
|
|
|
leftPadding: 0
|
|
|
|
padding: 0
|
|
|
|
font.pixelSize: 14
|
2022-04-04 11:26:30 +00:00
|
|
|
placeholderText: qsTr("Type json-rpc message... e.g {\"method\": \"eth_accounts\"}")
|
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
|
2024-09-11 11:49:20 +00:00
|
|
|
onAccepted: {
|
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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-06-13 16:59:54 +00:00
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
id: resultContainer
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
Layout.leftMargin: Style.current.padding
|
|
|
|
StatusTextArea {
|
|
|
|
id: callResult
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: root.store.nodeModelInst.callResult
|
|
|
|
readOnly: true
|
|
|
|
}
|
|
|
|
}
|
2020-05-15 21:10:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;formeditorZoom:0.5;height:770;width:1152}
|
|
|
|
}
|
|
|
|
##^##*/
|