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

99 lines
3.2 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
BackButtonType {
id: backButton
2023-09-18 16:39:26 +05:00
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20 + PageController.safeAreaTopMargin
onFocusChanged: {
if (this.activeFocus) {
listView.positionViewAtBeginning()
}
2023-09-18 16:39:26 +05:00
}
}
ListViewType {
id: listView
2023-09-18 16:39:26 +05:00
anchors.top: backButton.bottom
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
2023-09-18 16:39:26 +05:00
header: ColumnLayout {
width: listView.width
2023-09-18 16:39:26 +05:00
2025-05-02 23:54:36 -07:00
BaseHeaderType {
2023-09-18 16:39:26 +05:00
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 24
2023-09-18 16:39:26 +05:00
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.")
}
}
2023-09-18 16:39:26 +05:00
model: 1 // fake model to force the ListView to be created without a model
delegate: ColumnLayout {
width: listView.width
2023-09-18 16:39:26 +05:00
LabelWithButtonType {
id: removeButton
Layout.fillWidth: true
Layout.leftMargin: 16
Layout.rightMargin: 16
2023-09-18 16:39:26 +05:00
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 (ServersUiController.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected
&& SettingsController.isAmneziaDnsEnabled()) {
PageController.showNotificationMessage(qsTr("Cannot remove AmneziaDNS from running server"))
} else {
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeContainer(ServersUiController.getServerId(ServersUiController.processedServerIndex), ServersUiController.processedContainerIndex)
}
2023-09-18 16:39:26 +05:00
}
var noButtonFunction = function() {}
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
}
}
}
}
}