Merge branch 'dev' of github.com:amnezia-vpn/desktop-client into feature/new-gui

This commit is contained in:
vladimir.kuznetsov 2023-04-18 15:47:11 +03:00
commit 87f01007cc
279 changed files with 3175 additions and 1503756 deletions

View file

@ -0,0 +1,15 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageBase {
id: root
property var protocol: ProtocolEnum.Any
page: PageEnum.ClientInfo
logic: ClientInfoLogic
}

View file

@ -0,0 +1,115 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageClientInfoBase {
id: root
protocol: ProtocolEnum.OpenVpn
BackButton {
id: back
enabled: !ClientInfoLogic.busyIndicatorIsRunning
}
Caption {
id: caption
text: qsTr("Client Info")
}
BusyIndicator {
z: 99
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
visible: ClientInfoLogic.busyIndicatorIsRunning
running: ClientInfoLogic.busyIndicatorIsRunning
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height
visible: ClientInfoLogic.pageContentVisible
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: GC.defaultMargin
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.fillWidth: true
font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter
text: ClientInfoLogic.labelCurrentVpnProtocolText
}
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
height: 21
text: qsTr("Client name")
}
TextFieldType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.fillWidth: true
Layout.preferredHeight: 31
text: ClientInfoLogic.lineEditNameAliasText
onEditingFinished: {
if (text !== ClientInfoLogic.lineEditNameAliasText) {
ClientInfoLogic.lineEditNameAliasText = text
ClientInfoLogic.onLineEditNameAliasEditingFinished()
}
}
}
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.topMargin: 20
height: 21
text: qsTr("Certificate id")
}
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
text: ClientInfoLogic.labelOpenVpnCertId
}
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.topMargin: 20
height: 21
text: qsTr("Certificate")
}
TextAreaType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.preferredHeight: 200
Layout.fillWidth: true
textArea.readOnly: true
textArea.wrapMode: TextEdit.WrapAnywhere
textArea.verticalAlignment: Text.AlignTop
textArea.text: ClientInfoLogic.textAreaOpenVpnCertData
}
BlueButtonType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.fillWidth: true
Layout.preferredHeight: 41
text: qsTr("Revoke Certificate")
onClicked: {
ClientInfoLogic.onRevokeOpenVpnCertificateClicked()
UiLogic.closePage()
}
}
}
}
}

View file

@ -0,0 +1,100 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageClientInfoBase {
id: root
protocol: ProtocolEnum.WireGuard
BackButton {
id: back
enabled: !ClientInfoLogic.busyIndicatorIsRunning
}
Caption {
id: caption
text: qsTr("Client Info")
}
BusyIndicator {
z: 99
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
visible: ClientInfoLogic.busyIndicatorIsRunning
running: ClientInfoLogic.busyIndicatorIsRunning
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: GC.defaultMargin
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.fillWidth: true
font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter
text: ClientInfoLogic.labelCurrentVpnProtocolText
}
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
height: 21
text: qsTr("Client name")
}
TextFieldType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.fillWidth: true
Layout.preferredHeight: 31
text: ClientInfoLogic.lineEditNameAliasText
onEditingFinished: {
if (text !== ClientInfoLogic.lineEditNameAliasText) {
ClientInfoLogic.lineEditNameAliasText = text
ClientInfoLogic.onLineEditNameAliasEditingFinished()
}
}
}
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.topMargin: 20
height: 21
text: qsTr("Public Key")
}
TextAreaType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.preferredHeight: 200
Layout.fillWidth: true
textArea.readOnly: true
textArea.wrapMode: TextEdit.WrapAnywhere
textArea.verticalAlignment: Text.AlignTop
textArea.text: ClientInfoLogic.textAreaWireGuardKeyData
}
BlueButtonType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.fillWidth: true
Layout.preferredHeight: 41
text: qsTr("Revoke Key")
onClicked: {
ClientInfoLogic.onRevokeWireGuardKeyClicked()
UiLogic.closePage()
}
}
}
}
}

View file

@ -88,6 +88,15 @@ PageBase {
}
}
BlueButtonType {
Layout.topMargin: 10
Layout.fillWidth: true
text: qsTr("Clients Management")
onClicked: {
UiLogic.goToPage(PageEnum.ClientManagement)
}
}
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?"

View file

@ -0,0 +1,119 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Shapes 1.4
import SortFilterProxyModel 0.2
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.ClientManagement
logic: ClientManagementLogic
enabled: !ClientManagementLogic.busyIndicatorIsRunning
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Clients Management")
}
BusyIndicator {
z: 99
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
visible: ClientManagementLogic.busyIndicatorIsRunning
running: ClientManagementLogic.busyIndicatorIsRunning
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height
Column {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
LabelType {
font.pixelSize: 20
leftPadding: -20
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
text: ClientManagementLogic.labelCurrentVpnProtocolText
}
SortFilterProxyModel {
id: proxyClientManagementModel
sourceModel: UiLogic.clientManagementModel
sorters: RoleSorter { roleName: "clientName" }
}
ListView {
id: lv_clients
width: parent.width
implicitHeight: contentHeight + 20
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 20
topMargin: 10
spacing: 10
clip: true
model: proxyClientManagementModel
highlightRangeMode: ListView.ApplyRange
highlightMoveVelocity: -1
delegate: Item {
implicitWidth: lv_clients.width
implicitHeight: 60
MouseArea {
id: ms
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
ClientManagementLogic.onClientItemClicked(proxyClientManagementModel.mapToSource(index))
}
}
Rectangle {
anchors.fill: parent
gradient: ms.containsMouse ? gradient_containsMouse : gradient_notContainsMouse
LinearGradient {
id: gradient_notContainsMouse
x1: 0 ; y1:0
x2: 0 ; y2: height
stops: [
GradientStop { position: 0.0; color: "#FAFBFE" },
GradientStop { position: 1.0; color: "#ECEEFF" }
]
}
LinearGradient {
id: gradient_containsMouse
x1: 0 ; y1:0
x2: 0 ; y2: height
stops: [
GradientStop { position: 0.0; color: "#FAFBFE" },
GradientStop { position: 1.0; color: "#DCDEDF" }
]
}
}
LabelType {
x: 20
y: 20
font.pixelSize: 20
text: clientName
}
}
}
}
}
}

View file

@ -77,7 +77,7 @@ PageBase {
enabled: ServerConfiguringProgressLogic.pageEnabled
anchors.fill: pb_cancel
from: 0
to: ServerConfiguringProgressLogic.progressBarMaximium
to: ServerConfiguringProgressLogic.progressBarMaximum
value: ServerConfiguringProgressLogic.progressBarValue
visible: ServerConfiguringProgressLogic.progressBarVisible
background: Rectangle {

View file

@ -16,6 +16,7 @@ PageBase {
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Server settings")
@ -89,7 +90,6 @@ PageBase {
Layout.fillWidth: true
Layout.topMargin: 10
text: qsTr("Advanced server settings")
visible: ServerSettingsLogic.pushButtonShareFullVisible //todo
onClicked: {
UiLogic.goToPage(PageEnum.AdvancedServerSettings)
}

View file

@ -37,7 +37,7 @@ PageBase {
Layout.fillWidth: true
verticalAlignment: Text.AlignTop
text: qsTr('Optional.\n
You can enable VPN mode "For selected sites" and add blocked sites you need to visit manually. If you will choose this option, you will need add every bloked site you want to visit to the access list. You may switch between modes later.\n\nPlease note, you should add addresses to the list after VPN connection established. You may add any domain, URL or IP address, it will be resolved to IP address.')
You can enable VPN mode "For selected sites" and add blocked sites you need to visit manually. If you will choose this option, you will need add every blocked site you want to visit to the access list. You may switch between modes later.\n\nPlease note, you should add addresses to the list after VPN connection established. You may add any domain, URL or IP address, it will be resolved to IP address.')
}
CheckBoxType {

View file

@ -10,6 +10,14 @@ PageBase {
page: PageEnum.Start
logic: StartPageLogic
Connections {
target: StartPageLogic
function onShowPassphraseRequestMessage() {
popupWithTextField.open()
}
}
BackButton {
id: back_from_start
visible: pageLoader.depth > 1
@ -325,4 +333,22 @@ PageBase {
}
}
}
PopupWithTextField {
id: popupWithTextField
placeholderText: "Enter private key passphrase"
yesFunc: function() {
editingFinished()
close()
StartPageLogic.passphraseDialogClosed()
text = ""
}
noFunc: function() {
close()
StartPageLogic.passphraseDialogClosed()
}
onEditingFinished: {
StartPageLogic.privateKeyPassphrase = text
}
}
}

View file

@ -133,7 +133,7 @@ PageProtocolBase {
anchors.horizontalCenter: parent.horizontalCenter
anchors.fill: pb_save
from: 0
to: logic.progressBarResetMaximium
to: logic.progressBarResetMaximum
value: logic.progressBarResetValue
background: Rectangle {
implicitWidth: parent.width

View file

@ -393,7 +393,7 @@ PageProtocolBase {
id: progress_save
anchors.fill: pb_save
from: 0
to: logic.progressBarResetMaximium
to: logic.progressBarResetMaximum
value: logic.progressBarResetValue
visible: logic.progressBarResetVisible
background: Rectangle {

View file

@ -113,7 +113,7 @@ PageProtocolBase {
id: progressBar_reset
anchors.fill: pb_save
from: 0
to: logic.progressBarResetMaximium
to: logic.progressBarResetMaximum
value: logic.progressBarResetValue
visible: logic.progressBarResetVisible
background: Rectangle {

View file

@ -15,7 +15,7 @@ PageShareProtocolBase {
Caption {
id: caption
text: qsTr("Share SFTF settings")
text: qsTr("Share SFTP settings")
}
}