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

114 lines
3.8 KiB
QML
Raw Normal View History

import QtQuick
import QtQuick.Controls
2023-01-08 23:00:13 +00:00
import QtQuick.Layouts
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
2023-01-07 13:40:35 +00:00
FlickableType {
id: fl
2022-02-01 19:48:59 +03:00
anchors.top: caption.bottom
2023-01-07 13:40:35 +00:00
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
2022-02-01 19:48:59 +03:00
2023-01-07 13:40:35 +00:00
CheckBoxType {
Layout.preferredWidth: parent.width
text: qsTr("Use AmneziaDNS service (recommended)")
checked: NetworkSettingsLogic.checkBoxUseAmneziaDnsChecked
onCheckedChanged: {
NetworkSettingsLogic.checkBoxUseAmneziaDnsChecked = checked
NetworkSettingsLogic.onCheckBoxUseAmneziaDnsToggled(checked)
UiLogic.onUpdateAllPages()
}
}
LabelType {
Layout.preferredWidth: parent.width
text: qsTr("Use AmneziaDNS container on your server, when it installed.\n
2022-02-01 19:48:59 +03:00
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:")
2023-01-07 13:40:35 +00:00
}
2022-02-01 19:48:59 +03:00
2023-01-07 13:40:35 +00:00
LabelType {
Layout.topMargin: 15
text: qsTr("Primary DNS server")
}
TextFieldType {
height: 40
implicitWidth: parent.width
text: NetworkSettingsLogic.lineEditDns1Text
onEditingFinished: {
NetworkSettingsLogic.lineEditDns1Text = text
NetworkSettingsLogic.onLineEditDns1EditFinished(text)
UiLogic.onUpdateAllPages()
}
2023-01-08 23:00:13 +00:00
validator: RegularExpressionValidator {
regularExpression: NetworkSettingsLogic.ipAddressRegex
2023-01-07 13:40:35 +00:00
}
}
2021-10-21 19:49:53 +03:00
2023-01-07 13:40:35 +00:00
UrlButtonType {
text: qsTr("Reset to default")
label.horizontalAlignment: Text.AlignLeft
label.verticalAlignment: Text.AlignTop
label.font.pixelSize: 14
icon.source: "qrc:/images/svg/refresh_black_24dp.svg"
onClicked: {
NetworkSettingsLogic.onPushButtonResetDns1Clicked()
UiLogic.onUpdateAllPages()
}
}
2021-10-21 19:49:53 +03:00
2023-01-07 13:40:35 +00:00
LabelType {
text: qsTr("Secondary DNS server")
}
TextFieldType {
height: 40
implicitWidth: parent.width
text: NetworkSettingsLogic.lineEditDns2Text
onEditingFinished: {
NetworkSettingsLogic.lineEditDns2Text = text
NetworkSettingsLogic.onLineEditDns2EditFinished(text)
UiLogic.onUpdateAllPages()
}
2023-01-08 23:00:13 +00:00
validator: RegularExpressionValidator {
regularExpression: NetworkSettingsLogic.ipAddressRegex
2023-01-07 13:40:35 +00:00
}
}
UrlButtonType {
text: qsTr("Reset to default")
label.horizontalAlignment: Text.AlignLeft
label.verticalAlignment: Text.AlignTop
label.font.pixelSize: 14
icon.source: "qrc:/images/svg/refresh_black_24dp.svg"
onClicked: {
NetworkSettingsLogic.onPushButtonResetDns2Clicked()
UiLogic.onUpdateAllPages()
}
}
2021-07-28 16:13:29 +07:00
}
2021-10-21 19:49:53 +03:00
}
2021-07-28 16:13:29 +07:00
}