Files
amnezia-client/client/ui/qml/Pages/Protocols/PageProtoCloak.qml
T

195 lines
5.2 KiB
QML
Raw Normal View History

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
2021-09-16 19:49:50 +03:00
import ProtocolEnum 1.0
2021-09-14 00:39:07 +03:00
import "../"
2021-09-06 12:30:26 +03:00
import "../../Controls"
import "../../Config"
2021-07-28 16:13:29 +07:00
2021-09-16 19:49:50 +03:00
PageProtocolBase {
2021-07-28 16:13:29 +07:00
id: root
2021-09-16 19:49:50 +03:00
protocol: ProtocolEnum.Cloak
logic: UiLogic.protocolLogic(protocol)
2021-09-14 00:39:07 +03:00
2021-09-08 15:09:16 +03:00
BackButton {
2021-07-28 16:13:29 +07:00
id: back
enabled: !logic.pushButtonCancelVisible
2021-07-28 16:13:29 +07:00
}
2021-10-28 15:31:54 +03:00
Caption {
id: caption
text: qsTr("Cloak Settings")
}
ColumnLayout {
id: content
2021-09-19 14:31:38 +03:00
enabled: logic.pageEnabled
2021-10-28 15:31:54 +03:00
anchors.top: caption.bottom
anchors.left: root.left
anchors.right: root.right
anchors.bottom: pb_save.top
anchors.margins: 20
anchors.topMargin: 10
RowLayout {
Layout.fillWidth: true
LabelType {
height: 31
text: qsTr("Cipher")
Layout.preferredWidth: 0.3 * root.width - 10
}
ComboBoxType {
Layout.fillWidth: true
height: 31
model: [
qsTr("chacha20-poly1305"),
qsTr("aes-256-gcm"),
qsTr("aes-192-gcm"),
qsTr("aes-128-gcm")
]
currentIndex: {
for (let i = 0; i < model.length; ++i) {
if (logic.comboBoxCipherText === model[i]) {
return i
}
2021-07-28 16:13:29 +07:00
}
2021-10-28 15:31:54 +03:00
return -1
}
onCurrentTextChanged: {
logic.comboBoxCipherText = currentText
2021-07-28 16:13:29 +07:00
}
}
}
2021-10-28 15:31:54 +03:00
RowLayout {
Layout.fillWidth: true
LabelType {
Layout.preferredWidth: 0.3 * root.width - 10
height: 31
text: qsTr("Fake Web Site")
2021-07-28 16:13:29 +07:00
}
2021-10-28 15:31:54 +03:00
TextFieldType {
id: lineEdit_proto_cloak_site
Layout.fillWidth: true
height: 31
text: logic.lineEditSiteText
onEditingFinished: {
logic.lineEditSiteText = text
}
2021-07-28 16:13:29 +07:00
}
}
2021-10-28 15:31:54 +03:00
RowLayout {
Layout.fillWidth: true
LabelType {
Layout.preferredWidth: 0.3 * root.width - 10
height: 31
text: qsTr("Port")
2021-07-28 16:13:29 +07:00
}
2021-10-28 15:31:54 +03:00
TextFieldType {
id: lineEdit_proto_cloak_port
Layout.fillWidth: true
height: 31
text: logic.lineEditPortText
onEditingFinished: {
logic.lineEditPortText = text
2021-07-28 16:13:29 +07:00
}
2021-10-28 15:31:54 +03:00
enabled: logic.lineEditPortEnabled
2021-07-28 16:13:29 +07:00
}
}
2021-10-28 15:31:54 +03:00
Item {
Layout.fillHeight: true
}
}
LabelType {
id: label_server_busy
horizontalAlignment: Text.AlignHCenter
Layout.maximumWidth: parent.width
Layout.fillWidth: true
visible: logic.labelServerBusyVisible
text: logic.labelServerBusyText
}
2021-10-28 15:31:54 +03:00
LabelType {
id: label_proto_cloak_info
horizontalAlignment: Text.AlignHCenter
Layout.maximumWidth: parent.width
Layout.fillWidth: true
2021-10-28 15:31:54 +03:00
visible: logic.labelInfoVisible
text: logic.labelInfoText
}
ProgressBar {
id: progressBar_proto_cloak_reset
anchors.horizontalCenter: parent.horizontalCenter
anchors.fill: pb_save
from: 0
2023-04-11 09:50:44 -04:00
to: logic.progressBarResetMaximum
2021-10-28 15:31:54 +03:00
value: logic.progressBarResetValue
background: Rectangle {
implicitWidth: parent.width
implicitHeight: parent.height
color: "#100A44"
radius: 4
}
contentItem: Item {
implicitWidth: parent.width
implicitHeight: parent.height
Rectangle {
width: progressBar_proto_cloak_reset.visualPosition * parent.width
height: parent.height
radius: 4
color: Qt.rgba(255, 255, 255, 0.15);
2021-08-09 00:41:52 +07:00
}
2021-07-28 16:13:29 +07:00
}
2021-10-28 15:31:54 +03:00
visible: logic.progressBarResetVisible
LabelType {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: logic.progressBarText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#D4D4D4"
visible: logic.progressBarTextVisible
}
2021-07-28 16:13:29 +07:00
}
2021-10-28 15:31:54 +03:00
BlueButtonType {
id: pb_save
anchors.horizontalCenter: parent.horizontalCenter
enabled: logic.pageEnabled
anchors.bottom: root.bottom
anchors.bottomMargin: 20
width: root.width - 60
height: 40
text: qsTr("Save and restart VPN")
visible: logic.pushButtonSaveVisible
onClicked: {
logic.onPushButtonSaveClicked()
}
}
BlueButtonType {
anchors.fill: pb_save
text: qsTr("Cancel")
visible: logic.pushButtonCancelVisible
enabled: logic.pushButtonCancelVisible
onClicked: {
logic.onPushButtonCancelClicked()
}
}
2021-07-28 16:13:29 +07:00
}