2023-07-11 15:10:26 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import "../../views"
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property var networksModule
|
|
|
|
property var combinedNetwork
|
|
|
|
|
2023-09-04 15:36:28 +00:00
|
|
|
signal evaluateRpcEndPoint(string url, bool isMainUrl)
|
2023-07-11 15:10:26 +00:00
|
|
|
signal updateNetworkValues(int chainId, string newMainRpcInput, string newFailoverRpcUrl)
|
|
|
|
|
|
|
|
StatusTabBar {
|
|
|
|
id: editPreviwTabBar
|
|
|
|
StatusTabButton {
|
2023-09-22 09:58:02 +00:00
|
|
|
leftPadding: 0
|
2023-07-11 15:10:26 +00:00
|
|
|
text: qsTr("Live Network")
|
|
|
|
width: implicitWidth
|
|
|
|
}
|
|
|
|
StatusTabButton {
|
|
|
|
text: qsTr("Test Network")
|
|
|
|
width: implicitWidth
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-07 18:47:16 +00:00
|
|
|
Loader {
|
2023-07-11 15:10:26 +00:00
|
|
|
Layout.fillWidth: true
|
2023-08-07 18:47:16 +00:00
|
|
|
active: root.visible
|
|
|
|
sourceComponent: editPreviwTabBar.currentIndex === 0 ? editLiveNetwork: editTestNetwork
|
|
|
|
}
|
2023-07-11 15:10:26 +00:00
|
|
|
|
2023-08-07 18:47:16 +00:00
|
|
|
Component {
|
|
|
|
id: editLiveNetwork
|
2023-07-11 15:10:26 +00:00
|
|
|
EditNetworkForm {
|
|
|
|
network: !!root.combinedNetwork ? root.combinedNetwork.prod: null
|
|
|
|
networksModule: root.networksModule
|
2023-09-04 15:36:28 +00:00
|
|
|
onEvaluateRpcEndPoint: root.evaluateRpcEndPoint(url, isMainUrl)
|
2023-07-11 15:10:26 +00:00
|
|
|
onUpdateNetworkValues: root.updateNetworkValues(chainId, newMainRpcInput, newFailoverRpcUrl)
|
|
|
|
}
|
2023-08-07 18:47:16 +00:00
|
|
|
}
|
2023-07-11 15:10:26 +00:00
|
|
|
|
2023-08-07 18:47:16 +00:00
|
|
|
Component {
|
|
|
|
id: editTestNetwork
|
2023-07-11 15:10:26 +00:00
|
|
|
EditNetworkForm {
|
|
|
|
network: !!root.combinedNetwork ? root.combinedNetwork.test: null
|
|
|
|
networksModule: root.networksModule
|
2023-09-04 15:36:28 +00:00
|
|
|
onEvaluateRpcEndPoint: root.evaluateRpcEndPoint(url, isMainUrl)
|
2023-07-11 15:10:26 +00:00
|
|
|
onUpdateNetworkValues: root.updateNetworkValues(chainId, newMainRpcInput, newFailoverRpcUrl)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|