2022-10-20 20:09:17 +01:00
import QtQuick
import QtQuick . Controls
2023-01-09 12:38:01 +03: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
}
2023-01-09 12:38:01 +03:00
2021-09-08 21:24:09 +03:00
Caption {
2023-01-09 12:38:01 +03: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 {
2023-01-09 12:38:01 +03:00
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
2023-01-07 13:40:35 +00:00
anchors.rightMargin: 15
2023-01-09 12:38:01 +03:00
2023-01-07 13:40:35 +00:00
LabelType {
Layout.fillWidth: true
font.pixelSize: 20
horizontalAlignment: Text . AlignHCenter
text: ServerSettingsLogic . labelCurrentVpnProtocolText
2023-01-09 12:38:01 +03:00
}
TextFieldType {
Layout.fillWidth: true
font.pixelSize: 20
horizontalAlignment: Text . AlignHCenter
text: ServerSettingsLogic . labelServerText
readOnly: true
background: Item { }
}
LabelType {
Layout.fillWidth: true
2023-01-07 13:40:35 +00:00
text: ServerSettingsLogic . labelWaitInfoText
visible: ServerSettingsLogic . labelWaitInfoVisible
}
TextFieldType {
Layout.fillWidth: true
text: ServerSettingsLogic . lineEditDescriptionText
onEditingFinished: {
ServerSettingsLogic . lineEditDescriptionText = text
ServerSettingsLogic . onLineEditDescriptionEditingFinished ( )
}
2023-01-09 12:38:01 +03:00
}
BlueButtonType {
text: qsTr ( "Protocols and Services" )
2023-01-07 13:40:35 +00:00
Layout.topMargin: 20
Layout.fillWidth: true
2023-01-09 12:38:01 +03:00
onClicked: {
UiLogic . goToPage ( PageEnum . ServerContainers )
}
}
2023-02-20 09:46:50 +03:00
2023-01-09 12:38:01 +03:00
BlueButtonType {
Layout.fillWidth: true
2023-01-08 12:32:07 +00:00
Layout.topMargin: 10
2023-01-09 12:38:01 +03:00
text: qsTr ( "Share Server (FULL ACCESS)" )
visible: ServerSettingsLogic . pushButtonShareFullVisible
onClicked: {
ServerSettingsLogic . onPushButtonShareFullClicked ( )
}
}
2023-01-07 13:40:35 +00:00
BlueButtonType {
Layout.fillWidth: true
2023-02-20 09:46:50 +03:00
Layout.topMargin: 10
text: qsTr ( "Advanced server settings" )
visible: ServerSettingsLogic . pushButtonShareFullVisible //todo
2023-01-07 13:40:35 +00:00
onClicked: {
2023-02-20 09:46:50 +03:00
UiLogic . goToPage ( PageEnum . AdvancedServerSettings )
2023-01-07 13:40:35 +00:00
}
}
2023-01-27 10:25:14 +03:00
2023-01-09 12:38:01 +03:00
BlueButtonType {
2023-01-07 13:40:35 +00:00
Layout.topMargin: 60
2023-01-09 12:38:01 +03:00
Layout.fillWidth: true
text: qsTr ( "Clients Management" )
onClicked: {
UiLogic . goToPage ( PageEnum . ClientManagement )
}
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
2023-01-15 18:47:16 +03:00
text: ServerSettingsLogic . pushButtonClearClientCacheText
visible: ServerSettingsLogic . pushButtonClearClientCacheVisible
2023-01-09 12:38:01 +03:00
onClicked: {
2023-01-15 18:47:16 +03:00
ServerSettingsLogic . onPushButtonClearClientCacheClicked ( )
2023-01-09 12:38:01 +03:00
}
}
2023-01-27 10:25:14 +03:00
2023-01-07 13:40:35 +00:00
BlueButtonType {
2023-01-09 12:38:01 +03:00
Layout.fillWidth: true
2023-01-08 12:32:07 +00:00
Layout.topMargin: 10
2023-01-09 12:38:01 +03:00
text: qsTr ( "Forget this server" )
onClicked: {
2023-01-27 10:25:14 +03:00
popupForgetServer . open ( )
2023-01-09 12:38:01 +03:00
}
}
2023-01-27 10:25:14 +03:00
PopupWithQuestion {
id: popupForgetServer
2023-01-29 09:01:48 +03:00
questionText: "Attention! This action will not remove the container on the server, it will only remove the container information from the application. Continue?"
2023-01-27 10:25:14 +03:00
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
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
}