Files
amnezia-client/client/ui/qml/Pages/PageNetworkSetting.qml
T

126 lines
3.4 KiB
QML
Raw Normal View History

2021-07-28 16:13:29 +07:00
import QtQuick 2.12
import QtQuick.Controls 2.12
2021-09-14 00:39:07 +03:00
import PageEnum 1.0
2021-07-28 16:13:29 +07:00
import "./"
2021-08-19 01:27:22 +03:00
import "../Controls"
import "../Config"
2021-07-28 16:13:29 +07:00
2021-09-14 00:39:07 +03:00
PageBase {
2021-07-28 16:13:29 +07:00
id: root
2021-09-14 00:39:07 +03:00
page: PageEnum.NetworkSettings
logic: NetworkSettingsLogic
2021-09-08 15:09:16 +03:00
BackButton {
2021-07-28 16:13:29 +07:00
id: back
}
2021-09-08 21:24:09 +03:00
Caption {
2021-10-21 19:49:53 +03:00
id: caption
2021-07-28 16:13:29 +07:00
text: qsTr("DNS Servers")
}
2022-02-01 19:48:59 +03:00
CheckBoxType {
id: cb_amnezia_dns
anchors.top: caption.bottom
x: 30
width: parent.width - 60
text: qsTr("Use AmneziaDNS service (recommended)")
checked: NetworkSettingsLogic.checkBoxUseAmneziaDnsChecked
onCheckedChanged: {
NetworkSettingsLogic.checkBoxUseAmneziaDnsChecked = checked
NetworkSettingsLogic.onCheckBoxUseAmneziaDnsToggled(checked)
2022-02-05 15:52:14 +03:00
UiLogic.onUpdateAllPages()
2022-02-01 19:48:59 +03:00
}
}
LabelType {
id: lb_amnezia_dns
x: 30
anchors.top: cb_amnezia_dns.bottom
width: parent.width - 60
text: qsTr("Use AmneziaDNS container on your server, when it installed.\n
Your AmneziaDNS server available only when it installed and VPN connected, it has internal IP address 172.29.172.254\n
If AmneziaDNS service is not installed on the same server, or this option is unchecked, the following DNS servers will be used:")
}
2021-07-28 16:13:29 +07:00
LabelType {
2021-10-21 19:49:53 +03:00
id: l1
2022-02-01 19:48:59 +03:00
x: 30
anchors.top: lb_amnezia_dns.bottom
width: parent.width - 30
2021-07-28 16:13:29 +07:00
height: 21
text: qsTr("Primary DNS server")
}
TextFieldType {
id: dns1
2022-02-01 19:48:59 +03:00
x: 30
2021-10-21 19:49:53 +03:00
anchors.top: l1.bottom
width: parent.width - 90
2021-07-28 16:13:29 +07:00
height: 40
2021-09-07 22:11:43 +03:00
text: NetworkSettingsLogic.lineEditDns1Text
2021-07-28 16:13:29 +07:00
onEditingFinished: {
2021-09-07 22:11:43 +03:00
NetworkSettingsLogic.lineEditDns1Text = text
NetworkSettingsLogic.onLineEditDns1EditFinished(text)
2022-02-05 15:52:14 +03:00
UiLogic.onUpdateAllPages()
2021-07-28 16:13:29 +07:00
}
validator: RegExpValidator {
2021-12-25 23:01:53 +03:00
regExp: NetworkSettingsLogic.ipAddressRegex
2021-07-28 16:13:29 +07:00
}
}
2022-02-05 15:52:14 +03:00
SvgButtonType {
2021-10-21 19:49:53 +03:00
id: resetDNS1
anchors. left: dns1.right
anchors.leftMargin: 10
anchors.verticalCenter: dns1.verticalCenter
width: 24
height: 24
2022-02-05 15:52:14 +03:00
icon.source: "qrc:/images/svg/refresh_black_24dp.svg"
2021-10-21 19:49:53 +03:00
onClicked: {
NetworkSettingsLogic.onPushButtonResetDns1Clicked()
2022-02-05 15:52:14 +03:00
UiLogic.onUpdateAllPages()
2021-10-21 19:49:53 +03:00
}
}
LabelType {
id: l2
2022-02-01 19:48:59 +03:00
x: 30
2021-10-21 19:49:53 +03:00
anchors.top: dns1.bottom
anchors.topMargin: 20
2022-02-01 19:48:59 +03:00
width: parent.width - 60
2021-10-21 19:49:53 +03:00
height: 21
text: qsTr("Secondray DNS server")
}
2021-07-28 16:13:29 +07:00
TextFieldType {
id: dns2
2022-02-01 19:48:59 +03:00
x: 30
2021-10-21 19:49:53 +03:00
anchors.top: l2.bottom
width: parent.width - 90
2021-07-28 16:13:29 +07:00
height: 40
2021-09-07 22:11:43 +03:00
text: NetworkSettingsLogic.lineEditDns2Text
2021-07-28 16:13:29 +07:00
onEditingFinished: {
2021-09-07 22:11:43 +03:00
NetworkSettingsLogic.lineEditDns2Text = text
NetworkSettingsLogic.onLineEditDns2EditFinished(text)
2022-02-05 15:52:14 +03:00
UiLogic.onUpdateAllPages()
2021-07-28 16:13:29 +07:00
}
validator: RegExpValidator {
2021-12-25 23:01:53 +03:00
regExp: NetworkSettingsLogic.ipAddressRegex
2021-07-28 16:13:29 +07:00
}
}
2022-02-05 15:52:14 +03:00
SvgButtonType {
2021-07-28 16:13:29 +07:00
id: resetDNS2
2021-10-21 19:49:53 +03:00
anchors. left: dns2.right
anchors.leftMargin: 10
anchors.verticalCenter: dns2.verticalCenter
2021-07-28 16:13:29 +07:00
width: 24
height: 24
2022-02-05 15:52:14 +03:00
icon.source: "qrc:/images/svg/refresh_black_24dp.svg"
2021-07-28 16:13:29 +07:00
onClicked: {
2021-09-07 22:11:43 +03:00
NetworkSettingsLogic.onPushButtonResetDns2Clicked()
2022-02-05 15:52:14 +03:00
UiLogic.onUpdateAllPages()
2021-07-28 16:13:29 +07:00
}
}
2021-10-21 19:49:53 +03:00
Logo {
anchors.bottom: parent.bottom
}
2021-07-28 16:13:29 +07:00
}