Merge branch 'dev' of github.com:amnezia-vpn/amnezia-client into HEAD

This commit is contained in:
vladimir.kuznetsov 2025-03-05 11:08:42 +07:00
commit c627b5a3cc
149 changed files with 11554 additions and 7646 deletions

View file

@ -20,8 +20,9 @@ Rectangle {
color: AmneziaStyle.color.transparent
radius: 13
visible: GC.isDesktop() && ServersModel.isDefaultServerFromApi
&& ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && SettingsController.isHomeAdLabelVisible
visible: false
// visible: GC.isDesktop() && ServersModel.isDefaultServerFromApi
// && ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && SettingsController.isHomeAdLabelVisible
MouseArea {
anchors.fill: parent
@ -53,7 +54,7 @@ Rectangle {
Layout.rightMargin: 10
Layout.leftMargin: 10
text: qsTr("Amnezia Premium - for access to any website")
text: qsTr("Amnezia Premium - for access to all websites and online resources")
color: AmneziaStyle.color.pearlGray
lineHeight: 18

View file

@ -135,7 +135,7 @@ DrawerType2 {
backgroundColor: AmneziaStyle.color.slateGray
textFieldPlaceholderText: qsTr("application name")
textField.placeholderText: qsTr("application name")
}
BasicButtonType {

View file

@ -0,0 +1,55 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
DrawerType2 {
property string serverNameText
id: root
objectName: "serverNameEditDrawer"
expandedStateContent: ColumnLayout {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 32
anchors.leftMargin: 16
anchors.rightMargin: 16
TextFieldWithHeaderType {
id: serverName
Layout.fillWidth: true
headerText: qsTr("Server name")
textField.text: root.serverNameText
textField.maximumLength: 30
checkEmptyText: true
}
BasicButtonType {
id: saveButton
Layout.fillWidth: true
text: qsTr("Save")
clickedFunc: function() {
if (serverName.textField.text === "") {
return
}
if (serverName.textField.text !== root.serverNameText) {
ServersModel.setProcessedServerData("name", serverName.textField.text);
}
root.closeTriggered()
}
}
}
}

View file

@ -110,7 +110,24 @@ ListView {
onClicked: function() {
ServersModel.processedIndex = index
PageController.goToPage(PageEnum.PageSettingsServerInfo)
if (ServersModel.getProcessedServerData("isServerFromGatewayApi")) {
if (ServersModel.getProcessedServerData("isCountrySelectionAvailable")) {
PageController.goToPage(PageEnum.PageSettingsApiAvailableCountries)
} else {
PageController.showBusyIndicator(true)
let result = ApiSettingsController.getAccountInfo(false)
PageController.showBusyIndicator(false)
if (!result) {
return
}
PageController.goToPage(PageEnum.PageSettingsApiServerInfo)
}
} else {
PageController.goToPage(PageEnum.PageSettingsServerInfo)
}
drawer.closeTriggered()
}
}

View file

@ -22,7 +22,9 @@ DrawerType2 {
property string headerText
property string configContentHeaderText
property string contentVisible
property string shareButtonText: qsTr("Share")
property string copyButtonText: qsTr("Copy")
property bool isSelfHostedConfig: true
property string configExtension: ".vpn"
property string configCaption: qsTr("Save AmneziaVPN config")
@ -71,8 +73,6 @@ DrawerType2 {
header: ColumnLayout {
width: listView.width
visible: root.contentVisible
BasicButtonType {
id: shareButton
Layout.fillWidth: true
@ -80,7 +80,7 @@ DrawerType2 {
Layout.leftMargin: 16
Layout.rightMargin: 16
text: qsTr("Share")
text: root.shareButtonText
leftImageSource: "qrc:/images/controls/share-2.svg"
clickedFunc: function() {
@ -116,7 +116,7 @@ DrawerType2 {
textColor: AmneziaStyle.color.paleGray
borderWidth: 1
text: qsTr("Copy")
text: root.copyButtonText
leftImageSource: "qrc:/images/controls/copy.svg"
Keys.onReturnPressed: { copyConfigTextButton.clicked() }
@ -153,6 +153,8 @@ DrawerType2 {
Layout.leftMargin: 16
Layout.rightMargin: 16
visible: root.isSelfHostedConfig
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
@ -283,6 +285,8 @@ DrawerType2 {
delegate: ColumnLayout {
width: listView.width
property bool isQrCodeVisible: root.isSelfHostedConfig ? ExportController.qrCodesCount > 0 : ApiConfigsController.qrCodesCount > 0
Rectangle {
id: qrCodeContainer
@ -292,7 +296,7 @@ DrawerType2 {
Layout.leftMargin: 16
Layout.rightMargin: 16
visible: ExportController.qrCodesCount > 0
visible: isQrCodeVisible
color: "white"
@ -300,7 +304,8 @@ DrawerType2 {
anchors.fill: parent
smooth: false
source: ExportController.qrCodesCount ? ExportController.qrCodes[0] : ""
source: root.isSelfHostedConfig ? (isQrCodeVisible ? ExportController.qrCodes[0] : "") :
(isQrCodeVisible ? ApiConfigsController.qrCodes[0] : "")
property bool isFocusable: true
@ -331,15 +336,17 @@ DrawerType2 {
Timer {
property int index: 0
interval: 1000
running: ExportController.qrCodesCount > 0
running: isQrCodeVisible
repeat: true
onTriggered: {
if (ExportController.qrCodesCount > 0) {
if (isQrCodeVisible) {
index++
if (index >= ExportController.qrCodesCount) {
let qrCodesCount = root.isSelfHostedConfig ? ExportController.qrCodesCount : ApiConfigsController.qrCodesCount
if (index >= qrCodesCount) {
index = 0
}
parent.source = ExportController.qrCodes[index]
parent.source = root.isSelfHostedConfig ? ExportController.qrCodes[index] : ApiConfigsController.qrCodes[index]
}
}
}
@ -357,7 +364,7 @@ DrawerType2 {
Layout.leftMargin: 16
Layout.rightMargin: 16
visible: ExportController.qrCodesCount > 0
visible: isQrCodeVisible
horizontalAlignment: Text.AlignHCenter
text: qsTr("To read the QR code in the Amnezia app, select \"Add server\" → \"I have data to connect\" → \"QR code, key or settings file\"")