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

148 lines
4.5 KiB
QML
Raw Normal View History

import QtQuick
import QtQuick.Controls
2023-01-08 23:00:13 +00:00
import QtQuick.Layouts
2021-08-09 00:41:52 +07:00
import PageEnum 1.0
2021-08-19 01:27:22 +03:00
import "./"
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.ServerSettings
logic: ServerSettingsLogic
2021-09-08 14:23:02 +03:00
enabled: ServerSettingsLogic.pageEnabled
2021-08-09 00:41:52 +07:00
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 {
2023-01-07 13:40:35 +00:00
id: caption
2021-07-28 16:13:29 +07:00
text: qsTr("Server settings")
2021-08-19 01:27:22 +03:00
anchors.horizontalCenter: parent.horizontalCenter
2021-07-28 16:13:29 +07:00
}
2022-01-28 16:03:21 +03:00
2023-01-07 13:40:35 +00:00
FlickableType {
id: fl
anchors.top: caption.bottom
anchors.bottom: logo.top
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType {
Layout.fillWidth: true
font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter
text: ServerSettingsLogic.labelCurrentVpnProtocolText
}
TextFieldType {
Layout.fillWidth: true
font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter
text: ServerSettingsLogic.labelServerText
readOnly: true
background: Item {}
}
LabelType {
Layout.fillWidth: true
text: ServerSettingsLogic.labelWaitInfoText
visible: ServerSettingsLogic.labelWaitInfoVisible
}
TextFieldType {
Layout.fillWidth: true
text: ServerSettingsLogic.lineEditDescriptionText
onEditingFinished: {
ServerSettingsLogic.lineEditDescriptionText = text
ServerSettingsLogic.onLineEditDescriptionEditingFinished()
}
}
BlueButtonType {
text: qsTr("Protocols and Services")
Layout.topMargin: 20
Layout.fillWidth: true
onClicked: {
UiLogic.goToPage(PageEnum.ServerContainers)
}
}
BlueButtonType {
Layout.fillWidth: true
2023-01-08 12:32:07 +00:00
Layout.topMargin: 10
2023-01-07 13:40:35 +00:00
text: qsTr("Share Server (FULL ACCESS)")
visible: ServerSettingsLogic.pushButtonShareFullVisible
onClicked: {
ServerSettingsLogic.onPushButtonShareFullClicked()
}
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 60
text: ServerSettingsLogic.pushButtonClearClientCacheText
visible: ServerSettingsLogic.pushButtonClearClientCacheVisible
2023-01-07 13:40:35 +00:00
onClicked: {
ServerSettingsLogic.onPushButtonClearClientCacheClicked()
2023-01-07 13:40:35 +00:00
}
}
2023-01-07 13:40:35 +00:00
BlueButtonType {
Layout.fillWidth: true
2023-01-08 12:32:07 +00:00
Layout.topMargin: 10
text: ServerSettingsLogic.pushButtonClearText
visible: ServerSettingsLogic.pushButtonClearVisible
onClicked: {
popupClearServer.open()
}
}
PopupWithQuestion {
id: popupClearServer
questionText: "Attention! All containers will be deleted on the server. This means that configuration files, keys and certificates will be deleted. Continue?"
yesFunc: function() {
ServerSettingsLogic.onPushButtonClearServer()
close()
}
noFunc: function() {
close()
2023-01-07 13:40:35 +00:00
}
}
2023-01-07 13:40:35 +00:00
BlueButtonType {
Layout.fillWidth: true
2023-01-08 12:32:07 +00:00
Layout.topMargin: 10
2023-01-07 13:40:35 +00:00
text: qsTr("Forget this server")
onClicked: {
popupForgetServer.open()
2023-01-07 13:40:35 +00:00
}
}
PopupWithQuestion {
id: popupForgetServer
questionText: "Attention! This action will not remove the container on the server, it will only remove the container information from the application. Continue?"
yesFunc: function() {
ServerSettingsLogic.onPushButtonForgetServer()
close()
}
noFunc: function() {
close()
}
}
2021-08-09 00:41:52 +07:00
}
2021-07-28 16:13:29 +07:00
}
2021-10-21 19:49:53 +03:00
2023-01-07 13:40:35 +00:00
2021-10-21 19:49:53 +03:00
Logo {
2023-01-07 13:40:35 +00:00
id : logo
2021-10-21 19:49:53 +03:00
anchors.bottom: parent.bottom
}
2021-07-28 16:13:29 +07:00
}