Files
amnezia-client/client/ui/qml/Pages2/PageServiceDnsSettings.qml
T

100 lines
3.0 KiB
QML
Raw Normal View History

2023-09-18 16:39:26 +05:00
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
2024-07-07 13:42:38 +03:00
import Style 1.0
2023-09-18 16:39:26 +05:00
import "./"
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
import "../Components"
PageType {
id: root
ColumnLayout {
2024-04-18 17:54:55 +04:00
id: backButtonLayout
2023-09-18 16:39:26 +05:00
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
BackButtonType {
2024-04-18 17:54:55 +04:00
id: backButton
2023-09-18 16:39:26 +05:00
}
}
FlickableType {
id: fl
2024-04-18 17:54:55 +04:00
anchors.top: backButtonLayout.bottom
2023-09-18 16:39:26 +05:00
anchors.bottom: parent.bottom
contentHeight: content.implicitHeight
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
HeaderType {
id: header
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
headerText: "AmneziaDNS"
2023-09-18 16:39:26 +05:00
descriptionText: qsTr("A DNS service is installed on your server, and it is only accessible via VPN.\n") +
qsTr("The DNS address is the same as the address of your server. You can configure DNS in the settings, under the connections tab.")
}
LabelWithButtonType {
id: removeButton
Layout.topMargin: 24
width: parent.width
text: qsTr("Remove ") + ContainersModel.getProcessedContainerName()
textColor: AmneziaStyle.color.vibrantRed
2023-09-18 16:39:26 +05:00
clickedFunction: function() {
var headerText = qsTr("Remove %1 from server?").arg(ContainersModel.getProcessedContainerName())
2024-02-16 15:24:06 +05:00
var yesButtonText = qsTr("Continue")
var noButtonText = qsTr("Cancel")
2023-09-18 16:39:26 +05:00
2024-02-16 15:24:06 +05:00
var yesButtonFunction = function() {
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected
&& SettingsController.isAmneziaDnsEnabled()) {
PageController.showNotificationMessage(qsTr("Cannot remove AmneziaDNS from running server"))
} else
{
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeProcessedContainer()
}
2023-09-18 16:39:26 +05:00
}
2024-02-16 15:24:06 +05:00
var noButtonFunction = function() {
2024-04-18 17:54:55 +04:00
if (!GC.isMobile()) {
removeButton.rightButton.forceActiveFocus()
}
2023-09-18 16:39:26 +05:00
}
2024-02-16 15:24:06 +05:00
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
2023-09-18 16:39:26 +05:00
}
MouseArea {
anchors.fill: removeButton
cursorShape: Qt.PointingHandCursor
enabled: false
}
}
}
}
}