Merge branch 'dev' into check_sudo_permissions (#1441)
* refactoring: improved the performance of secure_settings * bugfix: fixed textFields on PageSetupWizardCredentials * bugfix: fixed scrolling by keys on PageSettingsApiServerInfo * chore: hide site links for ios (#1374) * chore: fixed log output with split tunneling info * chore: hide "open logs folder" button for mobule platforms * chore: fixed again log output with split tunneling info * chore: bump version * Install apparmor (#1379) Install apparmor * chore: returned the backup page for androidTV * Enable PFS for Windows IKEv2 * refactoring: moved api info pages from ServerInfo * refactoring: moved gateway interaction functions to a separate class * bugfix: fixed storeEndpoint parsing * chore: returned links for mobile platforms * Update VPN protocol descriptions * Update VPN description texts * feature: added pages for subscription settings feature * feature: added page for export api native configs * feature: added error handling and minor ui fixes * refactor: update ios build configuration to use automatic code signing and prebuilt OpenVPNAdapter framework * feat: remove OpenVPNAdapter submodule * feat: remove ios openvpn script and associated cmake configuration * Update README.md * Update README_RU.md * Update README.md fix link * feature: added share vpn key to subscription settings page * bugfix: fixed possible crush on android * add timeouts in ipc client init * apply timeouts only for Windows * apply format to file * refactoring: simplified the validity check of the config before connection - improved project structure * bugfix: fixed visability of share drawer * feature: added 409 error handling from server response * chore: fixed android build * chore: fixed qr code display * Rewrite timeouts using waitForSource * feature: added error messages handler * feature: added issued configs info parsing * feature: added functionality to revoke api configs * chore: added links to instructions * chore: fixed qr code with vpnkey processing * chore: fixed native config post processing * chore: added link to android tv instruction * change node to IpcProcessTun2SocksReplica * chore: minor ui fixes * Update Windows OpenSSL (#1426) * Update Windows OpenSSL to 3.0.16 and add shared library for QSslSocket plugin * chore: update link to submodule 3rd-prebuild --------- Co-authored-by: vladimir.kuznetsov <nethiuswork@gmail.com> * chore: added 404 handling for revoke configs - added revoke before remove api server for premium v2 * chore: added log to see proxy decrypt errors * chore: minor ui fix * chore: bump version * bugfix: fixed mobile controllers initialization (#1436) * bugfix: fixed mobile controllers initialization * chore: bump version * Merge pull request #1440 from amnezia-vpn/feature/subscription-settings-page feature/subscription settings page --------- Co-authored-by: vladimir.kuznetsov <nethiuswork@gmail.com> Co-authored-by: pokamest <pokamest@gmail.com> Co-authored-by: Mykola Baibuz <mykola.baibuz@gmail.com> Co-authored-by: Yaroslav Yashin <yaroslav.yashin@gmail.com> Co-authored-by: KsZnak <ksu@amnezia.org> Co-authored-by: Cyril Anisimov <CyAn84@gmail.com>
This commit is contained in:
parent
64552d6080
commit
059257fc58
110 changed files with 4168 additions and 2156 deletions
|
|
@ -135,7 +135,7 @@ DrawerType2 {
|
|||
|
||||
backgroundColor: AmneziaStyle.color.slateGray
|
||||
|
||||
textFieldPlaceholderText: qsTr("application name")
|
||||
textField.placeholderText: qsTr("application name")
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
|
|
|
|||
55
client/ui/qml/Components/RenameServerDrawer.qml
Normal file
55
client/ui/qml/Components/RenameServerDrawer.qml
Normal 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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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\"")
|
||||
|
|
|
|||
38
client/ui/qml/Controls2/ListViewType.qml
Normal file
38
client/ui/qml/Controls2/ListViewType.qml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
ListView {
|
||||
id: root
|
||||
|
||||
property bool isFocusable: true
|
||||
|
||||
Keys.onTabPressed: {
|
||||
FocusController.nextKeyTabItem()
|
||||
}
|
||||
|
||||
Keys.onBacktabPressed: {
|
||||
FocusController.previousKeyTabItem()
|
||||
}
|
||||
|
||||
Keys.onUpPressed: {
|
||||
FocusController.nextKeyUpItem()
|
||||
}
|
||||
|
||||
Keys.onDownPressed: {
|
||||
FocusController.nextKeyDownItem()
|
||||
}
|
||||
|
||||
Keys.onLeftPressed: {
|
||||
FocusController.nextKeyLeftItem()
|
||||
}
|
||||
|
||||
Keys.onRightPressed: {
|
||||
FocusController.nextKeyRightItem()
|
||||
}
|
||||
|
||||
ScrollBar.vertical: ScrollBarType {}
|
||||
|
||||
clip: true
|
||||
reuseItems: true
|
||||
snapMode: ListView.SnapToItem
|
||||
}
|
||||
|
|
@ -22,11 +22,9 @@ Item {
|
|||
property var clickedFunc
|
||||
|
||||
property alias textField: textField
|
||||
property alias textFieldText: textField.text
|
||||
property string textFieldTextColor: AmneziaStyle.color.paleGray
|
||||
property string textFieldTextDisabledColor: AmneziaStyle.color.mutedGray
|
||||
|
||||
property string textFieldPlaceholderText
|
||||
property bool textFieldEditable: true
|
||||
|
||||
property string borderColor: AmneziaStyle.color.slateGray
|
||||
|
|
@ -101,7 +99,6 @@ Item {
|
|||
|
||||
inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText
|
||||
|
||||
placeholderText: root.textFieldPlaceholderText
|
||||
placeholderTextColor: AmneziaStyle.color.charcoalGray
|
||||
|
||||
selectionColor: AmneziaStyle.color.richBrown
|
||||
|
|
@ -129,8 +126,8 @@ Item {
|
|||
}
|
||||
|
||||
onActiveFocusChanged: {
|
||||
if (checkEmptyText && textFieldText === "") {
|
||||
errorText = qsTr("The field can't be empty")
|
||||
if (root.checkEmptyText && text === "") {
|
||||
root.errorText = qsTr("The field can't be empty")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,5 +27,6 @@ QtObject {
|
|||
readonly property color mistyGray: Qt.rgba(215/255, 216/255, 219/255, 0.8)
|
||||
readonly property color cloudyGray: Qt.rgba(215/255, 216/255, 219/255, 0.65)
|
||||
readonly property color pearlGray: '#EAEAEC'
|
||||
readonly property color translucentRichBrown: Qt.rgba(99/255, 51/255, 3/255, 0.26)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,18 +66,18 @@ PageType {
|
|||
Layout.leftMargin: 16
|
||||
|
||||
headerText: qsTr("Gateway endpoint")
|
||||
textFieldText: SettingsController.gatewayEndpoint
|
||||
textField.text: SettingsController.gatewayEndpoint
|
||||
|
||||
buttonImageSource: textFieldText !== "" ? "qrc:/images/controls/refresh-cw.svg" : ""
|
||||
buttonImageSource: textField.text !== "" ? "qrc:/images/controls/refresh-cw.svg" : ""
|
||||
|
||||
clickedFunc: function() {
|
||||
SettingsController.resetGatewayEndpoint()
|
||||
}
|
||||
|
||||
textField.onEditingFinished: {
|
||||
textFieldText = textField.text.replace(/^\s+|\s+$/g, '')
|
||||
if (textFieldText !== SettingsController.gatewayEndpoint) {
|
||||
SettingsController.gatewayEndpoint = textFieldText
|
||||
textField.text = textField.text.replace(/^\s+|\s+$/g, '')
|
||||
if (textField.text !== SettingsController.gatewayEndpoint) {
|
||||
SettingsController.gatewayEndpoint = textField.text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -297,7 +297,23 @@ PageType {
|
|||
|
||||
onClicked: {
|
||||
ServersModel.processedIndex = ServersModel.defaultIndex
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,12 +103,12 @@ PageType {
|
|||
Layout.topMargin: 40
|
||||
|
||||
headerText: qsTr("MTU")
|
||||
textFieldText: clientMtu
|
||||
textField.text: clientMtu
|
||||
textField.validator: IntValidator { bottom: 576; top: 65535 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== clientMtu) {
|
||||
clientMtu = textFieldText
|
||||
if (textField.text !== clientMtu) {
|
||||
clientMtu = textField.text
|
||||
}
|
||||
}
|
||||
checkEmptyText: true
|
||||
|
|
@ -121,12 +121,12 @@ PageType {
|
|||
Layout.topMargin: 16
|
||||
|
||||
headerText: "Jc - Junk packet count"
|
||||
textFieldText: clientJunkPacketCount
|
||||
textField.text: clientJunkPacketCount
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== clientJunkPacketCount) {
|
||||
clientJunkPacketCount = textFieldText
|
||||
if (textField.text !== clientJunkPacketCount) {
|
||||
clientJunkPacketCount = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -141,12 +141,12 @@ PageType {
|
|||
Layout.topMargin: 16
|
||||
|
||||
headerText: "Jmin - Junk packet minimum size"
|
||||
textFieldText: clientJunkPacketMinSize
|
||||
textField.text: clientJunkPacketMinSize
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== clientJunkPacketMinSize) {
|
||||
clientJunkPacketMinSize = textFieldText
|
||||
if (textField.text !== clientJunkPacketMinSize) {
|
||||
clientJunkPacketMinSize = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -161,12 +161,12 @@ PageType {
|
|||
Layout.topMargin: 16
|
||||
|
||||
headerText: "Jmax - Junk packet maximum size"
|
||||
textFieldText: clientJunkPacketMaxSize
|
||||
textField.text: clientJunkPacketMaxSize
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== clientJunkPacketMaxSize) {
|
||||
clientJunkPacketMaxSize = textFieldText
|
||||
if (textField.text !== clientJunkPacketMaxSize) {
|
||||
clientJunkPacketMaxSize = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -189,7 +189,7 @@ PageType {
|
|||
enabled: false
|
||||
|
||||
headerText: qsTr("Port")
|
||||
textFieldText: port
|
||||
textField.text: port
|
||||
}
|
||||
|
||||
TextFieldWithHeaderType {
|
||||
|
|
@ -200,7 +200,7 @@ PageType {
|
|||
enabled: false
|
||||
|
||||
headerText: "S1 - Init packet junk size"
|
||||
textFieldText: serverInitPacketJunkSize
|
||||
textField.text: serverInitPacketJunkSize
|
||||
}
|
||||
|
||||
TextFieldWithHeaderType {
|
||||
|
|
@ -211,7 +211,7 @@ PageType {
|
|||
enabled: false
|
||||
|
||||
headerText: "S2 - Response packet junk size"
|
||||
textFieldText: serverResponsePacketJunkSize
|
||||
textField.text: serverResponsePacketJunkSize
|
||||
}
|
||||
|
||||
TextFieldWithHeaderType {
|
||||
|
|
@ -222,7 +222,7 @@ PageType {
|
|||
enabled: false
|
||||
|
||||
headerText: "H1 - Init packet magic header"
|
||||
textFieldText: serverInitPacketMagicHeader
|
||||
textField.text: serverInitPacketMagicHeader
|
||||
}
|
||||
|
||||
TextFieldWithHeaderType {
|
||||
|
|
@ -233,7 +233,7 @@ PageType {
|
|||
enabled: false
|
||||
|
||||
headerText: "H2 - Response packet magic header"
|
||||
textFieldText: serverResponsePacketMagicHeader
|
||||
textField.text: serverResponsePacketMagicHeader
|
||||
}
|
||||
|
||||
TextFieldWithHeaderType {
|
||||
|
|
@ -244,7 +244,7 @@ PageType {
|
|||
enabled: false
|
||||
|
||||
headerText: "H3 - Underload packet magic header"
|
||||
textFieldText: serverUnderloadPacketMagicHeader
|
||||
textField.text: serverUnderloadPacketMagicHeader
|
||||
}
|
||||
|
||||
TextFieldWithHeaderType {
|
||||
|
|
@ -255,7 +255,7 @@ PageType {
|
|||
enabled: false
|
||||
|
||||
headerText: "H4 - Transport packet magic header"
|
||||
textFieldText: serverTransportPacketMagicHeader
|
||||
textField.text: serverTransportPacketMagicHeader
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,11 +106,11 @@ PageType {
|
|||
enabled: delegateItem.isEnabled
|
||||
|
||||
headerText: qsTr("VPN address subnet")
|
||||
textFieldText: subnetAddress
|
||||
textField.text: subnetAddress
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== subnetAddress) {
|
||||
subnetAddress = textFieldText
|
||||
if (textField.text !== subnetAddress) {
|
||||
subnetAddress = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -125,13 +125,13 @@ PageType {
|
|||
enabled: delegateItem.isEnabled
|
||||
|
||||
headerText: qsTr("Port")
|
||||
textFieldText: port
|
||||
textField.text: port
|
||||
textField.maximumLength: 5
|
||||
textField.validator: IntValidator { bottom: 1; top: 65535 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== port) {
|
||||
port = textFieldText
|
||||
if (textField.text !== port) {
|
||||
port = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -144,16 +144,16 @@ PageType {
|
|||
Layout.topMargin: 16
|
||||
|
||||
headerText: qsTr("Jc - Junk packet count")
|
||||
textFieldText: serverJunkPacketCount
|
||||
textField.text: serverJunkPacketCount
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText === "") {
|
||||
textFieldText = "0"
|
||||
if (textField.text === "") {
|
||||
textField.text = "0"
|
||||
}
|
||||
|
||||
if (textFieldText !== serverJunkPacketCount) {
|
||||
serverJunkPacketCount = textFieldText
|
||||
if (textField.text !== serverJunkPacketCount) {
|
||||
serverJunkPacketCount = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -166,12 +166,12 @@ PageType {
|
|||
Layout.topMargin: 16
|
||||
|
||||
headerText: qsTr("Jmin - Junk packet minimum size")
|
||||
textFieldText: serverJunkPacketMinSize
|
||||
textField.text: serverJunkPacketMinSize
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== serverJunkPacketMinSize) {
|
||||
serverJunkPacketMinSize = textFieldText
|
||||
if (textField.text !== serverJunkPacketMinSize) {
|
||||
serverJunkPacketMinSize = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -184,12 +184,12 @@ PageType {
|
|||
Layout.topMargin: 16
|
||||
|
||||
headerText: qsTr("Jmax - Junk packet maximum size")
|
||||
textFieldText: serverJunkPacketMaxSize
|
||||
textField.text: serverJunkPacketMaxSize
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== serverJunkPacketMaxSize) {
|
||||
serverJunkPacketMaxSize = textFieldText
|
||||
if (textField.text !== serverJunkPacketMaxSize) {
|
||||
serverJunkPacketMaxSize = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -202,12 +202,12 @@ PageType {
|
|||
Layout.topMargin: 16
|
||||
|
||||
headerText: qsTr("S1 - Init packet junk size")
|
||||
textFieldText: serverInitPacketJunkSize
|
||||
textField.text: serverInitPacketJunkSize
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== serverInitPacketJunkSize) {
|
||||
serverInitPacketJunkSize = textFieldText
|
||||
if (textField.text !== serverInitPacketJunkSize) {
|
||||
serverInitPacketJunkSize = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -226,12 +226,12 @@ PageType {
|
|||
Layout.topMargin: 16
|
||||
|
||||
headerText: qsTr("S2 - Response packet junk size")
|
||||
textFieldText: serverResponsePacketJunkSize
|
||||
textField.text: serverResponsePacketJunkSize
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== serverResponsePacketJunkSize) {
|
||||
serverResponsePacketJunkSize = textFieldText
|
||||
if (textField.text !== serverResponsePacketJunkSize) {
|
||||
serverResponsePacketJunkSize = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -250,12 +250,12 @@ PageType {
|
|||
Layout.topMargin: 16
|
||||
|
||||
headerText: qsTr("H1 - Init packet magic header")
|
||||
textFieldText: serverInitPacketMagicHeader
|
||||
textField.text: serverInitPacketMagicHeader
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== serverInitPacketMagicHeader) {
|
||||
serverInitPacketMagicHeader = textFieldText
|
||||
if (textField.text !== serverInitPacketMagicHeader) {
|
||||
serverInitPacketMagicHeader = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -268,12 +268,12 @@ PageType {
|
|||
Layout.topMargin: 16
|
||||
|
||||
headerText: qsTr("H2 - Response packet magic header")
|
||||
textFieldText: serverResponsePacketMagicHeader
|
||||
textField.text: serverResponsePacketMagicHeader
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== serverResponsePacketMagicHeader) {
|
||||
serverResponsePacketMagicHeader = textFieldText
|
||||
if (textField.text !== serverResponsePacketMagicHeader) {
|
||||
serverResponsePacketMagicHeader = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -286,12 +286,12 @@ PageType {
|
|||
Layout.topMargin: 16
|
||||
|
||||
headerText: qsTr("H4 - Transport packet magic header")
|
||||
textFieldText: serverTransportPacketMagicHeader
|
||||
textField.text: serverTransportPacketMagicHeader
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== serverTransportPacketMagicHeader) {
|
||||
serverTransportPacketMagicHeader = textFieldText
|
||||
if (textField.text !== serverTransportPacketMagicHeader) {
|
||||
serverTransportPacketMagicHeader = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -304,12 +304,12 @@ PageType {
|
|||
Layout.topMargin: 16
|
||||
|
||||
headerText: qsTr("H3 - Underload packet magic header")
|
||||
textFieldText: serverUnderloadPacketMagicHeader
|
||||
textField.text: serverUnderloadPacketMagicHeader
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== serverUnderloadPacketMagicHeader) {
|
||||
serverUnderloadPacketMagicHeader = textFieldText
|
||||
if (textField.text !== serverUnderloadPacketMagicHeader) {
|
||||
serverUnderloadPacketMagicHeader = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,18 +89,18 @@ PageType {
|
|||
Layout.topMargin: 32
|
||||
|
||||
headerText: qsTr("Disguised as traffic from")
|
||||
textFieldText: site
|
||||
textField.text: site
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== site) {
|
||||
var tmpText = textFieldText
|
||||
if (textField.text !== site) {
|
||||
var tmpText = textField.text
|
||||
tmpText = tmpText.toLocaleLowerCase()
|
||||
|
||||
var indexHttps = tmpText.indexOf("https://")
|
||||
if (indexHttps === 0) {
|
||||
tmpText = textFieldText.substring(8)
|
||||
tmpText = textField.text.substring(8)
|
||||
} else {
|
||||
site = textFieldText
|
||||
site = textField.text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -113,13 +113,13 @@ PageType {
|
|||
Layout.topMargin: 16
|
||||
|
||||
headerText: qsTr("Port")
|
||||
textFieldText: port
|
||||
textField.text: port
|
||||
textField.maximumLength: 5
|
||||
textField.validator: IntValidator { bottom: 1; top: 65535 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== port) {
|
||||
port = textFieldText
|
||||
if (textField.text !== port) {
|
||||
port = textField.text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,13 +88,13 @@ PageType {
|
|||
Layout.topMargin: 32
|
||||
|
||||
headerText: qsTr("VPN address subnet")
|
||||
textFieldText: subnetAddress
|
||||
textField.text: subnetAddress
|
||||
|
||||
parentFlickable: fl
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== subnetAddress) {
|
||||
subnetAddress = textFieldText
|
||||
if (textField.text !== subnetAddress) {
|
||||
subnetAddress = textField.text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -137,13 +137,13 @@ PageType {
|
|||
enabled: isPortEditable
|
||||
|
||||
headerText: qsTr("Port")
|
||||
textFieldText: port
|
||||
textField.text: port
|
||||
textField.maximumLength: 5
|
||||
textField.validator: IntValidator { bottom: 1; top: 65535 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== port) {
|
||||
port = textFieldText
|
||||
if (textField.text !== port) {
|
||||
port = textField.text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,13 +93,13 @@ PageType {
|
|||
enabled: isPortEditable
|
||||
|
||||
headerText: qsTr("Port")
|
||||
textFieldText: port
|
||||
textField.text: port
|
||||
textField.maximumLength: 5
|
||||
textField.validator: IntValidator { bottom: 1; top: 65535 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== port) {
|
||||
port = textFieldText
|
||||
if (textField.text !== port) {
|
||||
port = textField.text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,12 +97,12 @@ PageType {
|
|||
Layout.topMargin: 40
|
||||
|
||||
headerText: qsTr("MTU")
|
||||
textFieldText: clientMtu
|
||||
textField.text: clientMtu
|
||||
textField.validator: IntValidator { bottom: 576; top: 65535 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== clientMtu) {
|
||||
clientMtu = textFieldText
|
||||
if (textField.text !== clientMtu) {
|
||||
clientMtu = textField.text
|
||||
}
|
||||
}
|
||||
checkEmptyText: true
|
||||
|
|
@ -124,7 +124,7 @@ PageType {
|
|||
enabled: false
|
||||
|
||||
headerText: qsTr("Port")
|
||||
textFieldText: port
|
||||
textField.text: port
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,11 +90,11 @@ PageType {
|
|||
enabled: delegateItem.isEnabled
|
||||
|
||||
headerText: qsTr("VPN address subnet")
|
||||
textFieldText: subnetAddress
|
||||
textField.text: subnetAddress
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== subnetAddress) {
|
||||
subnetAddress = textFieldText
|
||||
if (textField.text !== subnetAddress) {
|
||||
subnetAddress = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -109,13 +109,13 @@ PageType {
|
|||
enabled: delegateItem.isEnabled
|
||||
|
||||
headerText: qsTr("Port")
|
||||
textFieldText: port
|
||||
textField.text: port
|
||||
textField.maximumLength: 5
|
||||
textField.validator: IntValidator { bottom: 1; top: 65535 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== port) {
|
||||
port = textFieldText
|
||||
if (textField.text !== port) {
|
||||
port = textField.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,18 +86,18 @@ PageType {
|
|||
Layout.topMargin: 32
|
||||
|
||||
headerText: qsTr("Disguised as traffic from")
|
||||
textFieldText: site
|
||||
textField.text: site
|
||||
|
||||
textField.onEditingFinished: {
|
||||
if (textFieldText !== site) {
|
||||
var tmpText = textFieldText
|
||||
if (textField.text !== site) {
|
||||
var tmpText = textField.text
|
||||
tmpText = tmpText.toLocaleLowerCase()
|
||||
|
||||
var indexHttps = tmpText.indexOf("https://")
|
||||
if (indexHttps === 0) {
|
||||
tmpText = textFieldText.substring(8)
|
||||
tmpText = textField.text.substring(8)
|
||||
} else {
|
||||
site = textFieldText
|
||||
site = textField.text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,9 +211,9 @@ PageType {
|
|||
port = tempPort
|
||||
username = tempUsername
|
||||
password = tempPassword
|
||||
portTextField.textFieldText = port
|
||||
usernameTextField.textFieldText = username
|
||||
passwordTextField.textFieldText = password
|
||||
portTextField.textField.text = port
|
||||
usernameTextField.textField.text = username
|
||||
passwordTextField.textField.text = password
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -231,14 +231,14 @@ PageType {
|
|||
parentFlickable: fl
|
||||
|
||||
headerText: qsTr("Port")
|
||||
textFieldText: port
|
||||
textField.text: port
|
||||
textField.maximumLength: 5
|
||||
textField.validator: IntValidator { bottom: 1; top: 65535 }
|
||||
|
||||
textField.onEditingFinished: {
|
||||
textFieldText = textField.text.replace(/^\s+|\s+$/g, '')
|
||||
if (textFieldText !== port) {
|
||||
port = textFieldText
|
||||
textField.text = textField.text.replace(/^\s+|\s+$/g, '')
|
||||
if (textField.text !== port) {
|
||||
port = textField.text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -251,14 +251,14 @@ PageType {
|
|||
parentFlickable: fl
|
||||
|
||||
headerText: qsTr("Username")
|
||||
textFieldPlaceholderText: "username"
|
||||
textFieldText: username
|
||||
textField.placeholderText: "username"
|
||||
textField.text: username
|
||||
textField.maximumLength: 32
|
||||
|
||||
textField.onEditingFinished: {
|
||||
textFieldText = textField.text.replace(/^\s+|\s+$/g, '')
|
||||
if (textFieldText !== username) {
|
||||
username = textFieldText
|
||||
textField.text = textField.text.replace(/^\s+|\s+$/g, '')
|
||||
if (textField.text !== username) {
|
||||
username = textField.text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -273,12 +273,12 @@ PageType {
|
|||
parentFlickable: fl
|
||||
|
||||
headerText: qsTr("Password")
|
||||
textFieldPlaceholderText: "password"
|
||||
textFieldText: password
|
||||
textField.placeholderText: "password"
|
||||
textField.text: password
|
||||
textField.maximumLength: 32
|
||||
|
||||
textField.echoMode: hidePassword ? TextInput.Password : TextInput.Normal
|
||||
buttonImageSource: textFieldText !== "" ? (hidePassword ? "qrc:/images/controls/eye.svg" : "qrc:/images/controls/eye-off.svg")
|
||||
buttonImageSource: textField.text !== "" ? (hidePassword ? "qrc:/images/controls/eye.svg" : "qrc:/images/controls/eye-off.svg")
|
||||
: ""
|
||||
|
||||
clickedFunc: function() {
|
||||
|
|
@ -286,9 +286,9 @@ PageType {
|
|||
}
|
||||
|
||||
textField.onFocusChanged: {
|
||||
textFieldText = textField.text.replace(/^\s+|\s+$/g, '')
|
||||
if (textFieldText !== password) {
|
||||
password = textFieldText
|
||||
textField.text = textField.text.replace(/^\s+|\s+$/g, '')
|
||||
if (textField.text !== password) {
|
||||
password = textField.text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -309,19 +309,19 @@ PageType {
|
|||
portTextField.errorText = qsTr("The port must be in the range of 1 to 65535")
|
||||
return
|
||||
}
|
||||
if (usernameTextField.textFieldText && passwordTextField.textFieldText === "") {
|
||||
if (usernameTextField.textField.text && passwordTextField.textField.text === "") {
|
||||
passwordTextField.errorText = qsTr("Password cannot be empty")
|
||||
return
|
||||
} else if (usernameTextField.textFieldText === "" && passwordTextField.textFieldText) {
|
||||
} else if (usernameTextField.textField.text === "" && passwordTextField.textField.text) {
|
||||
usernameTextField.errorText = qsTr("Username cannot be empty")
|
||||
return
|
||||
}
|
||||
|
||||
PageController.goToPage(PageEnum.PageSetupWizardInstalling)
|
||||
InstallController.updateContainer(Socks5ProxyConfigModel.getConfig())
|
||||
tempPort = portTextField.textFieldText
|
||||
tempUsername = usernameTextField.textFieldText
|
||||
tempPassword = passwordTextField.textFieldText
|
||||
tempPort = portTextField.textField.text
|
||||
tempUsername = usernameTextField.textField.text
|
||||
tempPassword = passwordTextField.textField.text
|
||||
changeSettingsDrawer.closeTriggered()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,7 +87,6 @@ PageType {
|
|||
|
||||
LabelWithButtonType {
|
||||
id: backup
|
||||
visible: !SettingsController.isOnTv()
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Backup")
|
||||
|
|
@ -99,9 +98,7 @@ PageType {
|
|||
}
|
||||
}
|
||||
|
||||
DividerType {
|
||||
visible: !SettingsController.isOnTv()
|
||||
}
|
||||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
id: about
|
||||
|
|
|
|||
|
|
@ -47,8 +47,7 @@ PageType {
|
|||
readonly property string description: qsTr("For reviews and bug reports")
|
||||
readonly property string imageSource: "qrc:/images/controls/mail.svg"
|
||||
readonly property var handler: function() {
|
||||
GC.copyToClipBoard(title)
|
||||
PageController.showNotificationMessage(qsTr("Copied"))
|
||||
Qt.openUrlExternally(qsTr("mailto:support@amnezia.org"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ import QtQuick.Controls
|
|||
import QtQuick.Layouts
|
||||
import QtQuick.Dialogs
|
||||
|
||||
import SortFilterProxyModel 0.2
|
||||
|
||||
import PageEnum 1.0
|
||||
import Style 1.0
|
||||
|
||||
|
|
@ -15,22 +17,85 @@ import "../Components"
|
|||
PageType {
|
||||
id: root
|
||||
|
||||
ListView {
|
||||
property var processedServer
|
||||
|
||||
Connections {
|
||||
target: ServersModel
|
||||
|
||||
function onProcessedServerChanged() {
|
||||
root.processedServer = proxyServersModel.get(0)
|
||||
}
|
||||
}
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: proxyServersModel
|
||||
objectName: "proxyServersModel"
|
||||
|
||||
sourceModel: ServersModel
|
||||
filters: [
|
||||
ValueFilter {
|
||||
roleName: "isCurrentlyProcessed"
|
||||
value: true
|
||||
}
|
||||
]
|
||||
|
||||
Component.onCompleted: {
|
||||
root.processedServer = proxyServersModel.get(0)
|
||||
}
|
||||
}
|
||||
|
||||
ListViewType {
|
||||
id: menuContent
|
||||
|
||||
property bool isFocusable: true
|
||||
anchors.fill: parent
|
||||
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
clip: true
|
||||
interactive: true
|
||||
model: ApiCountryModel
|
||||
|
||||
currentIndex: 0
|
||||
|
||||
ButtonGroup {
|
||||
id: containersRadioButtonGroup
|
||||
}
|
||||
|
||||
header: ColumnLayout {
|
||||
width: menuContent.width
|
||||
|
||||
spacing: 4
|
||||
|
||||
BackButtonType {
|
||||
id: backButton
|
||||
objectName: "backButton"
|
||||
|
||||
Layout.topMargin: 20
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
id: headerContent
|
||||
objectName: "headerContent"
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
Layout.bottomMargin: 10
|
||||
|
||||
actionButtonImage: "qrc:/images/controls/settings.svg"
|
||||
|
||||
headerText: root.processedServer.name
|
||||
descriptionText: qsTr("Locations for connection")
|
||||
|
||||
actionButtonFunction: function() {
|
||||
PageController.showBusyIndicator(true)
|
||||
let result = ApiSettingsController.getAccountInfo(false)
|
||||
PageController.showBusyIndicator(false)
|
||||
if (!result) {
|
||||
return
|
||||
}
|
||||
|
||||
PageController.goToPage(PageEnum.PageSettingsApiServerInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delegate: ColumnLayout {
|
||||
id: content
|
||||
|
||||
|
|
@ -63,9 +128,10 @@ PageType {
|
|||
PageController.showBusyIndicator(true)
|
||||
var prevIndex = ApiCountryModel.currentIndex
|
||||
ApiCountryModel.currentIndex = index
|
||||
if (!InstallController.updateServiceFromApi(ServersModel.defaultIndex, countryCode, countryName)) {
|
||||
if (!ApiConfigsController.updateServiceFromGateway(ServersModel.defaultIndex, countryCode, countryName)) {
|
||||
ApiCountryModel.currentIndex = prevIndex
|
||||
}
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
}
|
||||
|
||||
100
client/ui/qml/Pages2/PageSettingsApiDevices.qml
Normal file
100
client/ui/qml/Pages2/PageSettingsApiDevices.qml
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Dialogs
|
||||
|
||||
import QtCore
|
||||
|
||||
import SortFilterProxyModel 0.2
|
||||
|
||||
import PageEnum 1.0
|
||||
import Style 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
import "../Controls2/TextTypes"
|
||||
import "../Config"
|
||||
import "../Components"
|
||||
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
ListViewType {
|
||||
id: listView
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: 20
|
||||
anchors.bottomMargin: 24
|
||||
|
||||
model: ApiDevicesModel
|
||||
|
||||
header: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
BackButtonType {
|
||||
id: backButton
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
id: header
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
|
||||
headerText: qsTr("Connected devices")
|
||||
descriptionText: qsTr("To manage connected devices")
|
||||
}
|
||||
|
||||
WarningType {
|
||||
Layout.topMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
Layout.fillWidth: true
|
||||
|
||||
textString: qsTr("You can find the identifier on the Support tab or, for older versions of the app, "
|
||||
+ "by tapping '+' and then the three dots at the top of the page.")
|
||||
|
||||
iconPath: "qrc:/images/controls/alert-circle.svg"
|
||||
}
|
||||
}
|
||||
|
||||
delegate: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 6
|
||||
|
||||
text: osVersion + (isCurrentDevice ? qsTr(" (current device)") : "")
|
||||
descriptionText: qsTr("Support tag: ") + "\n" + supportTag + "\n" + qsTr("Last updated: ") + lastUpdate
|
||||
rightImageSource: "qrc:/images/controls/trash.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
var headerText = qsTr("Deactivate the subscription on selected device")
|
||||
var descriptionText = qsTr("The next time the “Connect” button is pressed, the device will be activated again")
|
||||
var yesButtonText = qsTr("Continue")
|
||||
var noButtonText = qsTr("Cancel")
|
||||
|
||||
var yesButtonFunction = function() {
|
||||
Qt.callLater(deactivateExternalDevice, supportTag, countryCode)
|
||||
}
|
||||
var noButtonFunction = function() {
|
||||
}
|
||||
|
||||
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
}
|
||||
}
|
||||
|
||||
function deactivateExternalDevice(supportTag, countryCode) {
|
||||
PageController.showBusyIndicator(true)
|
||||
if (ApiConfigsController.deactivateExternalDevice(supportTag, countryCode)) {
|
||||
ApiSettingsController.getAccountInfo(true)
|
||||
}
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
}
|
||||
124
client/ui/qml/Pages2/PageSettingsApiInstructions.qml
Normal file
124
client/ui/qml/Pages2/PageSettingsApiInstructions.qml
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import SortFilterProxyModel 0.2
|
||||
|
||||
import PageEnum 1.0
|
||||
import Style 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
import "../Controls2/TextTypes"
|
||||
import "../Config"
|
||||
import "../Components"
|
||||
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
QtObject {
|
||||
id: windows
|
||||
|
||||
readonly property string title: qsTr("Windows")
|
||||
readonly property string link: qsTr("https://docs.amnezia.org/documentation/instructions/connect-amnezia-premium#windows")
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: macos
|
||||
|
||||
readonly property string title: qsTr("macOS")
|
||||
readonly property string link: qsTr("https://docs.amnezia.org/documentation/instructions/connect-amnezia-premium#macos")
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: android
|
||||
|
||||
readonly property string title: qsTr("Android")
|
||||
readonly property string link: qsTr("https://docs.amnezia.org/documentation/instructions/connect-amnezia-premium#android")
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: androidTv
|
||||
|
||||
readonly property string title: qsTr("AndroidTV")
|
||||
readonly property string link: qsTr("https://docs.amnezia.org/ru/documentation/instructions/android_tv_connect/")
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: ios
|
||||
|
||||
readonly property string title: qsTr("iOS")
|
||||
readonly property string link: qsTr("https://docs.amnezia.org/documentation/instructions/connect-amnezia-premium#ios")
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: linux
|
||||
|
||||
readonly property string title: qsTr("Linux")
|
||||
readonly property string link: qsTr("https://docs.amnezia.org/documentation/instructions/connect-amnezia-premium#linux")
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: routers
|
||||
|
||||
readonly property string title: qsTr("Routers")
|
||||
readonly property string link: qsTr("https://docs.amnezia.org/documentation/instructions/connect-amnezia-premium#routers")
|
||||
}
|
||||
|
||||
property list<QtObject> instructionsModel: [
|
||||
windows,
|
||||
macos,
|
||||
android,
|
||||
androidTv,
|
||||
ios,
|
||||
linux,
|
||||
routers
|
||||
]
|
||||
|
||||
ListViewType {
|
||||
id: listView
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: 20
|
||||
anchors.bottomMargin: 24
|
||||
|
||||
model: instructionsModel
|
||||
|
||||
header: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
BackButtonType {
|
||||
id: backButton
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
id: header
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
|
||||
headerText: qsTr("How to connect on another device")
|
||||
descriptionText: qsTr("Instructions on the Amnezia website")
|
||||
}
|
||||
}
|
||||
|
||||
delegate: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 6
|
||||
|
||||
text: title
|
||||
rightImageSource: "qrc:/images/controls/external-link.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
Qt.openUrlExternally(link)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
}
|
||||
}
|
||||
}
|
||||
214
client/ui/qml/Pages2/PageSettingsApiNativeConfigs.qml
Normal file
214
client/ui/qml/Pages2/PageSettingsApiNativeConfigs.qml
Normal file
|
|
@ -0,0 +1,214 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Dialogs
|
||||
|
||||
import QtCore
|
||||
|
||||
import SortFilterProxyModel 0.2
|
||||
|
||||
import PageEnum 1.0
|
||||
import Style 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
import "../Controls2/TextTypes"
|
||||
import "../Config"
|
||||
import "../Components"
|
||||
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
property string configExtension: ".conf"
|
||||
property string configCaption: qsTr("Save AmneziaVPN config")
|
||||
|
||||
ListViewType {
|
||||
id: listView
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: 20
|
||||
anchors.bottomMargin: 24
|
||||
|
||||
model: ApiCountryModel
|
||||
|
||||
header: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
BackButtonType {
|
||||
id: backButton
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
id: header
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
|
||||
headerText: qsTr("Configuration files")
|
||||
descriptionText: qsTr("To connect a router or AmneziaWG application")
|
||||
}
|
||||
}
|
||||
|
||||
delegate: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 6
|
||||
|
||||
text: countryName
|
||||
descriptionText: isWorkerExpired ? qsTr("The configuration needs to be reissued") : ""
|
||||
descriptionColor: AmneziaStyle.color.vibrantRed
|
||||
|
||||
leftImageSource: "qrc:/countriesFlags/images/flagKit/" + countryImageCode + ".svg"
|
||||
rightImageSource: isIssued ? "qrc:/images/controls/more-vertical.svg" : "qrc:/images/controls/download.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
if (isIssued) {
|
||||
moreOptionsDrawer.countryName = countryName
|
||||
moreOptionsDrawer.countryCode = countryCode
|
||||
moreOptionsDrawer.openTriggered()
|
||||
} else {
|
||||
issueConfig(countryCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
}
|
||||
}
|
||||
|
||||
DrawerType2 {
|
||||
id: moreOptionsDrawer
|
||||
|
||||
property string countryName
|
||||
property string countryCode
|
||||
|
||||
anchors.fill: parent
|
||||
expandedHeight: parent.height * 0.4375
|
||||
|
||||
expandedStateContent: Item {
|
||||
implicitHeight: moreOptionsDrawer.expandedHeight
|
||||
|
||||
BackButtonType {
|
||||
id: moreOptionsDrawerBackButton
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.topMargin: 16
|
||||
|
||||
backButtonFunction: function() {
|
||||
moreOptionsDrawer.closeTriggered()
|
||||
}
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
anchors.top: moreOptionsDrawerBackButton.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
contentHeight: moreOptionsDrawerContent.height
|
||||
|
||||
ColumnLayout {
|
||||
id: moreOptionsDrawerContent
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
Header2Type {
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 16
|
||||
|
||||
headerText: qsTr("Configuration file ") + moreOptionsDrawer.countryName
|
||||
}
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Create a new")
|
||||
descriptionText: qsTr("The previously created one will stop working")
|
||||
|
||||
clickedFunction: function() {
|
||||
showQuestion(true, moreOptionsDrawer.countryCode, moreOptionsDrawer.countryName)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Revoke the current configuration file")
|
||||
|
||||
clickedFunction: function() {
|
||||
showQuestion(false, moreOptionsDrawer.countryCode, moreOptionsDrawer.countryName)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function issueConfig(countryCode) {
|
||||
var fileName = ""
|
||||
if (GC.isMobile()) {
|
||||
fileName = countryCode + configExtension
|
||||
} else {
|
||||
fileName = SystemController.getFileName(configCaption,
|
||||
qsTr("Config files (*" + configExtension + ")"),
|
||||
StandardPaths.standardLocations(StandardPaths.DocumentsLocation) + "/" + countryCode,
|
||||
true,
|
||||
configExtension)
|
||||
}
|
||||
if (fileName !== "") {
|
||||
PageController.showBusyIndicator(true)
|
||||
let result = ApiConfigsController.exportNativeConfig(countryCode, fileName)
|
||||
if (result) {
|
||||
ApiSettingsController.getAccountInfo(true)
|
||||
}
|
||||
|
||||
PageController.showBusyIndicator(false)
|
||||
if (result) {
|
||||
PageController.showNotificationMessage(qsTr("Config file saved"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function revokeConfig(countryCode) {
|
||||
PageController.showBusyIndicator(true)
|
||||
let result = ApiConfigsController.revokeNativeConfig(countryCode)
|
||||
if (result) {
|
||||
ApiSettingsController.getAccountInfo(true)
|
||||
}
|
||||
PageController.showBusyIndicator(false)
|
||||
|
||||
if (result) {
|
||||
PageController.showNotificationMessage(qsTr("The config has been revoked"))
|
||||
}
|
||||
}
|
||||
|
||||
function showQuestion(isConfigIssue, countryCode, countryName) {
|
||||
var headerText = qsTr("Revoke the actual %1 configuration file?").arg(countryName)
|
||||
var descriptionText = qsTr("The previously created file will no longer be valid. It will not be possible to connect using it.")
|
||||
var yesButtonText = qsTr("Continue")
|
||||
var noButtonText = qsTr("Cancel")
|
||||
|
||||
var yesButtonFunction = function() {
|
||||
if (isConfigIssue) {
|
||||
issueConfig(countryCode)
|
||||
} else {
|
||||
revokeConfig(countryCode)
|
||||
}
|
||||
moreOptionsDrawer.closeTriggered()
|
||||
}
|
||||
var noButtonFunction = function() {
|
||||
}
|
||||
|
||||
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,8 @@ import QtQuick.Controls
|
|||
import QtQuick.Layouts
|
||||
import QtQuick.Dialogs
|
||||
|
||||
import SortFilterProxyModel 0.2
|
||||
|
||||
import PageEnum 1.0
|
||||
import Style 1.0
|
||||
|
||||
|
|
@ -15,107 +17,264 @@ import "../Components"
|
|||
PageType {
|
||||
id: root
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
contentHeight: content.height
|
||||
property list<QtObject> labelsModel: [
|
||||
statusObject,
|
||||
endDateObject,
|
||||
deviceCountObject
|
||||
]
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
QtObject {
|
||||
id: statusObject
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
readonly property string title: qsTr("Subscription status")
|
||||
readonly property string contentKey: "subscriptionStatus"
|
||||
readonly property string objectImageSource: "qrc:/images/controls/info.svg"
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: endDateObject
|
||||
|
||||
readonly property string title: qsTr("Valid until")
|
||||
readonly property string contentKey: "endDate"
|
||||
readonly property string objectImageSource: "qrc:/images/controls/history.svg"
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: deviceCountObject
|
||||
|
||||
readonly property string title: qsTr("Connected devices")
|
||||
readonly property string contentKey: "connectedDevices"
|
||||
readonly property string objectImageSource: "qrc:/images/controls/monitor.svg"
|
||||
}
|
||||
|
||||
property var processedServer
|
||||
|
||||
Connections {
|
||||
target: ServersModel
|
||||
|
||||
function onProcessedServerChanged() {
|
||||
root.processedServer = proxyServersModel.get(0)
|
||||
}
|
||||
}
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: proxyServersModel
|
||||
objectName: "proxyServersModel"
|
||||
|
||||
sourceModel: ServersModel
|
||||
filters: [
|
||||
ValueFilter {
|
||||
roleName: "isCurrentlyProcessed"
|
||||
value: true
|
||||
}
|
||||
]
|
||||
|
||||
Component.onCompleted: {
|
||||
root.processedServer = proxyServersModel.get(0)
|
||||
}
|
||||
}
|
||||
|
||||
ListViewType {
|
||||
id: listView
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
model: labelsModel
|
||||
|
||||
header: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
spacing: 4
|
||||
|
||||
BackButtonType {
|
||||
id: backButton
|
||||
objectName: "backButton"
|
||||
|
||||
Layout.topMargin: 20
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
id: headerContent
|
||||
objectName: "headerContent"
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
Layout.bottomMargin: 10
|
||||
|
||||
actionButtonImage: "qrc:/images/controls/edit-3.svg"
|
||||
|
||||
headerText: root.processedServer.name
|
||||
descriptionText: ApiAccountInfoModel.data("serviceDescription")
|
||||
|
||||
actionButtonFunction: function() {
|
||||
serverNameEditDrawer.openTriggered()
|
||||
}
|
||||
}
|
||||
|
||||
RenameServerDrawer {
|
||||
id: serverNameEditDrawer
|
||||
|
||||
parent: root
|
||||
|
||||
anchors.fill: parent
|
||||
expandedHeight: root.height * 0.35
|
||||
|
||||
serverNameText: root.processedServer.name
|
||||
}
|
||||
}
|
||||
|
||||
delegate: ColumnLayout {
|
||||
width: listView.width
|
||||
spacing: 0
|
||||
|
||||
LabelWithImageType {
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 16
|
||||
Connections {
|
||||
target: ApiAccountInfoModel
|
||||
|
||||
imageSource: "qrc:/images/controls/map-pin.svg"
|
||||
leftText: qsTr("For the region")
|
||||
rightText: ApiServicesModel.getSelectedServiceData("region")
|
||||
function onModelReset() {
|
||||
delegateItem.rightText = ApiAccountInfoModel.data(contentKey)
|
||||
}
|
||||
}
|
||||
|
||||
LabelWithImageType {
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 16
|
||||
|
||||
imageSource: "qrc:/images/controls/tag.svg"
|
||||
leftText: qsTr("Price")
|
||||
rightText: ApiServicesModel.getSelectedServiceData("price")
|
||||
}
|
||||
|
||||
LabelWithImageType {
|
||||
property bool showSubscriptionEndDate: ServersModel.getProcessedServerData("isCountrySelectionAvailable")
|
||||
id: delegateItem
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 16
|
||||
|
||||
imageSource: "qrc:/images/controls/history.svg"
|
||||
leftText: showSubscriptionEndDate ? qsTr("Valid until") : qsTr("Work period")
|
||||
rightText: showSubscriptionEndDate ? ApiServicesModel.getSelectedServiceData("endDate")
|
||||
: ApiServicesModel.getSelectedServiceData("workPeriod")
|
||||
imageSource: objectImageSource
|
||||
leftText: title
|
||||
rightText: ApiAccountInfoModel.data(contentKey)
|
||||
|
||||
visible: rightText !== ""
|
||||
}
|
||||
}
|
||||
|
||||
LabelWithImageType {
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 16
|
||||
footer: ColumnLayout {
|
||||
id: footer
|
||||
|
||||
imageSource: "qrc:/images/controls/gauge.svg"
|
||||
leftText: qsTr("Speed")
|
||||
rightText: ApiServicesModel.getSelectedServiceData("speed")
|
||||
}
|
||||
width: listView.width
|
||||
spacing: 0
|
||||
|
||||
ParagraphTextType {
|
||||
Layout.fillWidth: true
|
||||
readonly property bool isVisibleForAmneziaFree: ApiAccountInfoModel.data("isComponentVisible")
|
||||
|
||||
WarningType {
|
||||
id: warning
|
||||
|
||||
Layout.topMargin: 32
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
Layout.fillWidth: true
|
||||
|
||||
onLinkActivated: function(link) {
|
||||
Qt.openUrlExternally(link)
|
||||
}
|
||||
textFormat: Text.RichText
|
||||
text: {
|
||||
var text = ApiServicesModel.getSelectedServiceData("features")
|
||||
if (text === undefined) {
|
||||
return ""
|
||||
}
|
||||
return text.replace("%1", LanguageModel.getCurrentSiteUrl())
|
||||
}
|
||||
backGroundColor: AmneziaStyle.color.translucentRichBrown
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.NoButton
|
||||
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
}
|
||||
textString: qsTr("Configurations have been updated for some countries. Download and install the updated configuration files")
|
||||
|
||||
iconPath: "qrc:/images/controls/alert-circle.svg"
|
||||
|
||||
visible: ApiAccountInfoModel.data("hasExpiredWorker")
|
||||
}
|
||||
|
||||
LabelWithButtonType {
|
||||
id: supportUuid
|
||||
id: vpnKey
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: warning.visible ? 16 : 32
|
||||
|
||||
text: qsTr("Support tag")
|
||||
descriptionText: SettingsController.getInstallationUuid()
|
||||
visible: false //footer.isVisibleForAmneziaFree
|
||||
|
||||
descriptionOnTop: true
|
||||
|
||||
rightImageSource: "qrc:/images/controls/copy.svg"
|
||||
rightImageColor: AmneziaStyle.color.paleGray
|
||||
text: qsTr("Subscription key")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
GC.copyToClipBoard(descriptionText)
|
||||
PageController.showNotificationMessage(qsTr("Copied"))
|
||||
if (!GC.isMobile()) {
|
||||
this.rightButton.forceActiveFocus()
|
||||
}
|
||||
shareConnectionDrawer.headerText = qsTr("Amnezia Premium subscription key")
|
||||
|
||||
shareConnectionDrawer.openTriggered()
|
||||
shareConnectionDrawer.isSelfHostedConfig = false;
|
||||
shareConnectionDrawer.shareButtonText = qsTr("Save VPN key to file")
|
||||
shareConnectionDrawer.copyButtonText = qsTr("Copy VPN key")
|
||||
|
||||
|
||||
PageController.showBusyIndicator(true)
|
||||
|
||||
ApiConfigsController.prepareVpnKeyExport()
|
||||
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {
|
||||
visible: false //footer.isVisibleForAmneziaFree
|
||||
}
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: warning.visible ? 16 : 32
|
||||
|
||||
visible: footer.isVisibleForAmneziaFree
|
||||
|
||||
text: qsTr("Configuration files")
|
||||
|
||||
descriptionText: qsTr("To connect a router or AmneziaWG application")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
ApiSettingsController.updateApiCountryModel()
|
||||
PageController.goToPage(PageEnum.PageSettingsApiNativeConfigs)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {
|
||||
visible: footer.isVisibleForAmneziaFree
|
||||
}
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
visible: footer.isVisibleForAmneziaFree
|
||||
|
||||
text: qsTr("Connected devices")
|
||||
|
||||
descriptionText: qsTr("To manage connected devices")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
ApiSettingsController.updateApiDevicesModel()
|
||||
PageController.goToPage(PageEnum.PageSettingsApiDevices)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {
|
||||
visible: footer.isVisibleForAmneziaFree
|
||||
}
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: footer.isVisibleForAmneziaFree ? 0 : 32
|
||||
|
||||
text: qsTr("Support")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsApiSupport)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("How to connect on another device")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsApiInstructions)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
|
||||
BasicButtonType {
|
||||
id: resetButton
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
|
@ -141,20 +300,57 @@ PageType {
|
|||
PageController.showNotificationMessage(qsTr("Cannot reload API config during active connection"))
|
||||
} else {
|
||||
PageController.showBusyIndicator(true)
|
||||
InstallController.updateServiceFromApi(ServersModel.processedIndex, "", "", true)
|
||||
ApiConfigsController.updateServiceFromGateway(ServersModel.processedIndex, "", "", true)
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
}
|
||||
var noButtonFunction = function() {
|
||||
if (!GC.isMobile()) {
|
||||
removeButton.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
|
||||
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
|
||||
}
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
id: revokeButton
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.bottomMargin: 16
|
||||
Layout.leftMargin: 8
|
||||
implicitHeight: 32
|
||||
|
||||
visible: footer.isVisibleForAmneziaFree
|
||||
|
||||
defaultColor: "transparent"
|
||||
hoveredColor: AmneziaStyle.color.translucentWhite
|
||||
pressedColor: AmneziaStyle.color.sheerWhite
|
||||
textColor: AmneziaStyle.color.vibrantRed
|
||||
|
||||
text: qsTr("Deactivate the subscription on this device")
|
||||
|
||||
clickedFunc: function() {
|
||||
var headerText = qsTr("Deactivate the subscription on this device?")
|
||||
var descriptionText = qsTr("The next time the “Connect” button is pressed, the device will be activated again")
|
||||
var yesButtonText = qsTr("Continue")
|
||||
var noButtonText = qsTr("Cancel")
|
||||
|
||||
var yesButtonFunction = function() {
|
||||
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) {
|
||||
PageController.showNotificationMessage(qsTr("Cannot deactivate subscription during active connection"))
|
||||
} else {
|
||||
PageController.showBusyIndicator(true)
|
||||
if (ApiConfigsController.deactivateDevice()) {
|
||||
ApiSettingsController.getAccountInfo(true)
|
||||
}
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
}
|
||||
var noButtonFunction = function() {
|
||||
}
|
||||
|
||||
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
|
||||
}
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
id: removeButton
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
|
@ -179,14 +375,13 @@ PageType {
|
|||
PageController.showNotificationMessage(qsTr("Cannot remove server during active connection"))
|
||||
} else {
|
||||
PageController.showBusyIndicator(true)
|
||||
InstallController.removeProcessedServer()
|
||||
if (ApiConfigsController.deactivateDevice()) {
|
||||
InstallController.removeProcessedServer()
|
||||
}
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
}
|
||||
var noButtonFunction = function() {
|
||||
if (!GC.isMobile()) {
|
||||
removeButton.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
|
||||
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
|
||||
|
|
@ -194,4 +389,10 @@ PageType {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
ShareConnectionDrawer {
|
||||
id: shareConnectionDrawer
|
||||
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
|
|
|
|||
127
client/ui/qml/Pages2/PageSettingsApiSupport.qml
Normal file
127
client/ui/qml/Pages2/PageSettingsApiSupport.qml
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import SortFilterProxyModel 0.2
|
||||
|
||||
import PageEnum 1.0
|
||||
import Style 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
import "../Controls2/TextTypes"
|
||||
import "../Config"
|
||||
import "../Components"
|
||||
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
QtObject {
|
||||
id: telegram
|
||||
|
||||
readonly property string title: qsTr("Telegram")
|
||||
readonly property string description: "@" + ApiAccountInfoModel.getTelegramBotLink()
|
||||
readonly property string link: "https://t.me/" + ApiAccountInfoModel.getTelegramBotLink()
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: techSupport
|
||||
|
||||
readonly property string title: qsTr("For technical support")
|
||||
readonly property string description: qsTr("support@amnezia.org")
|
||||
readonly property string link: "mailto:support@amnezia.org"
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: paymentSupport
|
||||
|
||||
readonly property string title: qsTr("For payment issues")
|
||||
readonly property string description: qsTr("help@vpnpay.io")
|
||||
readonly property string link: "mailto:help@vpnpay.io"
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: site
|
||||
|
||||
readonly property string title: qsTr("Site")
|
||||
readonly property string description: qsTr("amnezia.org")
|
||||
readonly property string link: LanguageModel.getCurrentSiteUrl()
|
||||
}
|
||||
|
||||
property list<QtObject> supportModel: [
|
||||
telegram,
|
||||
techSupport,
|
||||
paymentSupport,
|
||||
site
|
||||
]
|
||||
|
||||
ListViewType {
|
||||
id: listView
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: 20
|
||||
anchors.bottomMargin: 24
|
||||
|
||||
model: supportModel
|
||||
|
||||
header: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
BackButtonType {
|
||||
id: backButton
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
id: header
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
|
||||
headerText: qsTr("Support")
|
||||
descriptionText: qsTr("Our technical support specialists are ready to help you at any time")
|
||||
}
|
||||
}
|
||||
|
||||
delegate: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
text: title
|
||||
descriptionText: description
|
||||
rightImageSource: "qrc:/images/controls/external-link.svg"
|
||||
clickedFunction: function() {
|
||||
Qt.openUrlExternally(link)
|
||||
}
|
||||
}
|
||||
DividerType {}
|
||||
}
|
||||
|
||||
|
||||
footer: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
LabelWithButtonType {
|
||||
id: supportUuid
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Support tag")
|
||||
descriptionText: SettingsController.getInstallationUuid()
|
||||
|
||||
descriptionOnTop: true
|
||||
|
||||
rightImageSource: "qrc:/images/controls/copy.svg"
|
||||
rightImageColor: AmneziaStyle.color.paleGray
|
||||
|
||||
clickedFunction: function() {
|
||||
GC.copyToClipBoard(descriptionText)
|
||||
PageController.showNotificationMessage(qsTr("Copied"))
|
||||
if (!GC.isMobile()) {
|
||||
this.rightButton.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -252,7 +252,7 @@ PageType {
|
|||
|
||||
Layout.fillWidth: true
|
||||
|
||||
textFieldPlaceholderText: qsTr("application name")
|
||||
textField.placeholderText: qsTr("application name")
|
||||
buttonImageSource: "qrc:/images/controls/plus.svg"
|
||||
|
||||
rightButtonClickedOnEnter: true
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ PageType {
|
|||
Layout.fillWidth: true
|
||||
headerText: qsTr("Primary DNS")
|
||||
|
||||
textFieldText: SettingsController.primaryDns
|
||||
textField.text: SettingsController.primaryDns
|
||||
textField.validator: RegularExpressionValidator {
|
||||
regularExpression: InstallController.ipAddressRegExp()
|
||||
}
|
||||
|
|
@ -79,7 +79,7 @@ PageType {
|
|||
Layout.fillWidth: true
|
||||
headerText: qsTr("Secondary DNS")
|
||||
|
||||
textFieldText: SettingsController.secondaryDns
|
||||
textField.text: SettingsController.secondaryDns
|
||||
textField.validator: RegularExpressionValidator {
|
||||
regularExpression: InstallController.ipAddressRegExp()
|
||||
}
|
||||
|
|
@ -105,9 +105,9 @@ PageType {
|
|||
|
||||
var yesButtonFunction = function() {
|
||||
SettingsController.primaryDns = "1.1.1.1"
|
||||
primaryDns.textFieldText = SettingsController.primaryDns
|
||||
primaryDns.textField.text = SettingsController.primaryDns
|
||||
SettingsController.secondaryDns = "1.0.0.1"
|
||||
secondaryDns.textFieldText = SettingsController.secondaryDns
|
||||
secondaryDns.textField.text = SettingsController.secondaryDns
|
||||
PageController.showNotificationMessage(qsTr("Settings have been reset"))
|
||||
}
|
||||
var noButtonFunction = function() {
|
||||
|
|
@ -125,11 +125,11 @@ PageType {
|
|||
text: qsTr("Save")
|
||||
|
||||
clickedFunc: function() {
|
||||
if (primaryDns.textFieldText !== SettingsController.primaryDns) {
|
||||
SettingsController.primaryDns = primaryDns.textFieldText
|
||||
if (primaryDns.textField.text !== SettingsController.primaryDns) {
|
||||
SettingsController.primaryDns = primaryDns.textField.text
|
||||
}
|
||||
if (secondaryDns.textFieldText !== SettingsController.secondaryDns) {
|
||||
SettingsController.secondaryDns = secondaryDns.textFieldText
|
||||
if (secondaryDns.textField.text !== SettingsController.secondaryDns) {
|
||||
SettingsController.secondaryDns = secondaryDns.textField.text
|
||||
}
|
||||
PageController.showNotificationMessage(qsTr("Settings saved"))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,6 +137,8 @@ PageType {
|
|||
Layout.topMargin: -8
|
||||
Layout.bottomMargin: -8
|
||||
|
||||
visible: !GC.isMobile()
|
||||
|
||||
text: qsTr("Open logs folder")
|
||||
leftImageSource: "qrc:/images/controls/folder-open.svg"
|
||||
isSmallLeftImage: true
|
||||
|
|
|
|||
|
|
@ -36,16 +36,6 @@ PageType {
|
|||
PageController.showErrorMessage(message)
|
||||
}
|
||||
|
||||
function onRemoveProcessedServerFinished(finishedMessage) {
|
||||
if (!ServersModel.getServersCount()) {
|
||||
PageController.goToPageHome()
|
||||
} else {
|
||||
PageController.goToStartPage()
|
||||
PageController.goToPage(PageEnum.PageSettingsServersList)
|
||||
}
|
||||
PageController.showNotificationMessage(finishedMessage)
|
||||
}
|
||||
|
||||
function onRebootProcessedServerFinished(finishedMessage) {
|
||||
PageController.showNotificationMessage(finishedMessage)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ PageType {
|
|||
readonly property int pageSettingsServerProtocols: 0
|
||||
readonly property int pageSettingsServerServices: 1
|
||||
readonly property int pageSettingsServerData: 2
|
||||
readonly property int pageSettingsApiServerInfo: 3
|
||||
readonly property int pageSettingsApiLanguageList: 4
|
||||
|
||||
property var processedServer
|
||||
|
||||
|
|
@ -71,15 +69,6 @@ PageType {
|
|||
BackButtonType {
|
||||
id: backButton
|
||||
objectName: "backButton"
|
||||
|
||||
backButtonFunction: function() {
|
||||
if (nestedStackView.currentIndex === root.pageSettingsApiServerInfo &&
|
||||
root.processedServer.isCountrySelectionAvailable) {
|
||||
nestedStackView.currentIndex = root.pageSettingsApiLanguageList
|
||||
} else {
|
||||
PageController.closePage()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
|
|
@ -91,18 +80,11 @@ PageType {
|
|||
Layout.rightMargin: 16
|
||||
Layout.bottomMargin: 10
|
||||
|
||||
actionButtonImage: nestedStackView.currentIndex === root.pageSettingsApiLanguageList ? "qrc:/images/controls/settings.svg"
|
||||
: "qrc:/images/controls/edit-3.svg"
|
||||
actionButtonImage: "qrc:/images/controls/edit-3.svg"
|
||||
|
||||
headerText: root.processedServer.name
|
||||
descriptionText: {
|
||||
if (root.processedServer.isServerFromGatewayApi) {
|
||||
if (nestedStackView.currentIndex === root.pageSettingsApiLanguageList) {
|
||||
return qsTr("Subscription is valid until ") + ApiServicesModel.getSelectedServiceData("endDate")
|
||||
} else {
|
||||
return ApiServicesModel.getSelectedServiceData("serviceDescription")
|
||||
}
|
||||
} else if (root.processedServer.isServerFromTelegramApi) {
|
||||
if (root.processedServer.isServerFromTelegramApi) {
|
||||
return root.processedServer.serverDescription
|
||||
} else if (root.processedServer.hasWriteAccess) {
|
||||
return root.processedServer.credentialsLogin + " · " + root.processedServer.hostName
|
||||
|
|
@ -112,60 +94,19 @@ PageType {
|
|||
}
|
||||
|
||||
actionButtonFunction: function() {
|
||||
if (nestedStackView.currentIndex === root.pageSettingsApiLanguageList) {
|
||||
nestedStackView.currentIndex = root.pageSettingsApiServerInfo
|
||||
} else {
|
||||
serverNameEditDrawer.openTriggered()
|
||||
}
|
||||
serverNameEditDrawer.openTriggered()
|
||||
}
|
||||
}
|
||||
|
||||
DrawerType2 {
|
||||
RenameServerDrawer {
|
||||
id: serverNameEditDrawer
|
||||
objectName: "serverNameEditDrawer"
|
||||
|
||||
parent: root
|
||||
|
||||
anchors.fill: parent
|
||||
expandedHeight: root.height * 0.35
|
||||
|
||||
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")
|
||||
textFieldText: root.processedServer.name
|
||||
textField.maximumLength: 30
|
||||
checkEmptyText: true
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
id: saveButton
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Save")
|
||||
|
||||
clickedFunc: function() {
|
||||
if (serverName.textFieldText === "") {
|
||||
return
|
||||
}
|
||||
|
||||
if (serverName.textFieldText !== root.processedServer.name) {
|
||||
ServersModel.setProcessedServerData("name", serverName.textFieldText);
|
||||
}
|
||||
serverNameEditDrawer.closeTriggered()
|
||||
}
|
||||
}
|
||||
}
|
||||
serverNameText: root.processedServer.name
|
||||
}
|
||||
|
||||
TabBar {
|
||||
|
|
@ -181,8 +122,6 @@ PageType {
|
|||
color: AmneziaStyle.color.transparent
|
||||
}
|
||||
|
||||
visible: !ServersModel.getProcessedServerData("isServerFromGatewayApi")
|
||||
|
||||
|
||||
TabButtonType {
|
||||
id: protocolsTab
|
||||
|
|
@ -221,9 +160,7 @@ PageType {
|
|||
|
||||
Layout.fillWidth: true
|
||||
|
||||
currentIndex: ServersModel.getProcessedServerData("isServerFromGatewayApi") ?
|
||||
(ServersModel.getProcessedServerData("isCountrySelectionAvailable") ?
|
||||
root.pageSettingsApiLanguageList : root.pageSettingsApiServerInfo) : tabBar.currentIndex
|
||||
currentIndex: tabBar.currentIndex
|
||||
|
||||
PageSettingsServerProtocols {
|
||||
id: protocolsPage
|
||||
|
|
@ -239,16 +176,6 @@ PageType {
|
|||
id: dataPage
|
||||
stackView: root.stackView
|
||||
}
|
||||
|
||||
PageSettingsApiServerInfo {
|
||||
id: apiInfoPage
|
||||
stackView: root.stackView
|
||||
}
|
||||
|
||||
PageSettingsApiLanguageList {
|
||||
id: apiLanguageListPage
|
||||
stackView: root.stackView
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,19 @@ PageType {
|
|||
|
||||
clickedFunction: function() {
|
||||
ServersModel.processedIndex = index
|
||||
PageController.goToPage(PageEnum.PageSettingsServerInfo)
|
||||
|
||||
if (ServersModel.getProcessedServerData("isServerFromGatewayApi")) {
|
||||
PageController.showBusyIndicator(true)
|
||||
let result = ApiSettingsController.getAccountInfo(false)
|
||||
PageController.showBusyIndicator(false)
|
||||
if (!result) {
|
||||
return
|
||||
}
|
||||
|
||||
PageController.goToPage(PageEnum.PageSettingsApiServerInfo)
|
||||
} else {
|
||||
PageController.goToPage(PageEnum.PageSettingsServerInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -274,13 +274,13 @@ PageType {
|
|||
Layout.fillWidth: true
|
||||
rightButtonClickedOnEnter: true
|
||||
|
||||
textFieldPlaceholderText: qsTr("website or IP")
|
||||
textField.placeholderText: qsTr("website or IP")
|
||||
buttonImageSource: "qrc:/images/controls/plus.svg"
|
||||
|
||||
clickedFunc: function() {
|
||||
PageController.showBusyIndicator(true)
|
||||
SitesController.addSite(textFieldText)
|
||||
textFieldText = ""
|
||||
SitesController.addSite(textField.text)
|
||||
textField.text = ""
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
}
|
||||
|
|
@ -338,7 +338,6 @@ PageType {
|
|||
|
||||
LabelWithButtonType {
|
||||
id: exportSitesButton
|
||||
enabled: !SettingsController.isOnTv()
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Save site list")
|
||||
|
||||
|
|
@ -362,9 +361,7 @@ PageType {
|
|||
}
|
||||
}
|
||||
|
||||
DividerType {
|
||||
enabled: !SettingsController.isOnTv()
|
||||
}
|
||||
DividerType {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ PageType {
|
|||
PageController.closePage()
|
||||
} else {
|
||||
PageController.showBusyIndicator(true)
|
||||
InstallController.installServiceFromApi()
|
||||
ApiConfigsController.importServiceFromGateway()
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,12 +163,12 @@ PageType {
|
|||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
|
||||
visible: textKey.textFieldText !== ""
|
||||
visible: textKey.textField.text !== ""
|
||||
|
||||
text: qsTr("Continue")
|
||||
|
||||
clickedFunc: function() {
|
||||
if (ImportController.extractConfigFromData(textKey.textFieldText)) {
|
||||
if (ImportController.extractConfigFromData(textKey.textField.text)) {
|
||||
PageController.goToPage(PageEnum.PageSetupWizardViewConfig)
|
||||
}
|
||||
}
|
||||
|
|
@ -217,6 +217,8 @@ PageType {
|
|||
Layout.alignment: Qt.AlignHCenter
|
||||
implicitHeight: 32
|
||||
|
||||
visible: Qt.platform.os !== "ios"
|
||||
|
||||
defaultColor: AmneziaStyle.color.transparent
|
||||
hoveredColor: AmneziaStyle.color.translucentWhite
|
||||
pressedColor: AmneziaStyle.color.sheerWhite
|
||||
|
|
@ -252,7 +254,7 @@ PageType {
|
|||
property bool isVisible: true
|
||||
property var handler: function() {
|
||||
PageController.showBusyIndicator(true)
|
||||
var result = InstallController.fillAvailableServices()
|
||||
var result = ApiConfigsController.fillAvailableServices()
|
||||
PageController.showBusyIndicator(false)
|
||||
if (result) {
|
||||
PageController.goToPage(PageEnum.PageSetupWizardApiServicesList)
|
||||
|
|
@ -330,7 +332,7 @@ PageType {
|
|||
property string title: qsTr("I have nothing")
|
||||
property string description: qsTr("")
|
||||
property string imageSource: "qrc:/images/controls/help-circle.svg"
|
||||
property bool isVisible: PageController.isStartPageVisible()
|
||||
property bool isVisible: PageController.isStartPageVisible() && Qt.platform.os !== "ios"
|
||||
property var handler: function() {
|
||||
Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,24 +82,19 @@ PageType {
|
|||
reuseItems: true
|
||||
|
||||
delegate: ColumnLayout {
|
||||
property alias textField: _textField.textField
|
||||
|
||||
width: listView.width
|
||||
|
||||
TextFieldWithHeaderType {
|
||||
id: _textField
|
||||
id: delegate
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
property bool hidePassword: hideText
|
||||
|
||||
headerText: title
|
||||
textField.echoMode: hideText ? TextInput.Password : TextInput.Normal
|
||||
buttonImageSource: imageSource
|
||||
textFieldPlaceholderText: placeholderText
|
||||
textField.text: textFieldText
|
||||
textField.echoMode: hideContent ? TextInput.Password : TextInput.Normal
|
||||
textField.placeholderText: placeholderContent
|
||||
textField.text: textField.text
|
||||
|
||||
rightButtonClickedOnEnter: true
|
||||
|
||||
|
|
@ -108,17 +103,12 @@ PageType {
|
|||
}
|
||||
|
||||
textField.onFocusChanged: {
|
||||
var _currentIndex = listView.currentIndex
|
||||
var _currentItem = listView.itemAtIndex(_currentIndex).children[0]
|
||||
listView.model[_currentIndex].textFieldText = _currentItem.textFieldText.replace(/^\s+|\s+$/g, '')
|
||||
textField.text = textField.text.replace(/^\s+|\s+$/g, '')
|
||||
}
|
||||
|
||||
textField.onTextChanged: {
|
||||
var _currentIndex = listView.currentIndex
|
||||
textFieldText = textField.text
|
||||
|
||||
if (_currentIndex === vars.secretDataIndex) {
|
||||
buttonImageSource = textFieldText !== "" ? (hideText ? "qrc:/images/controls/eye.svg" : "qrc:/images/controls/eye-off.svg") : ""
|
||||
if (hideContent) {
|
||||
buttonImageSource = textField.text !== "" ? (hideContent ? "qrc:/images/controls/eye.svg" : "qrc:/images/controls/eye-off.svg") : ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -143,9 +133,9 @@ PageType {
|
|||
}
|
||||
|
||||
InstallController.setShouldCreateServer(true)
|
||||
var _hostname = listView.itemAtIndex(vars.hostnameIndex).children[0].textFieldText
|
||||
var _username = listView.itemAtIndex(vars.usernameIndex).children[0].textFieldText
|
||||
var _secretData = listView.itemAtIndex(vars.secretDataIndex).children[0].textFieldText
|
||||
var _hostname = listView.itemAtIndex(vars.hostnameIndex).children[0].textField.text
|
||||
var _username = listView.itemAtIndex(vars.usernameIndex).children[0].textField.text
|
||||
var _secretData = listView.itemAtIndex(vars.secretDataIndex).children[0].textField.text
|
||||
|
||||
InstallController.setProcessedServerCredentials(_hostname, _username, _secretData)
|
||||
|
||||
|
|
@ -194,23 +184,23 @@ PageType {
|
|||
function isCredentialsFilled() {
|
||||
var hasEmptyField = false
|
||||
|
||||
var _hostname = listView.itemAtIndex(vars.hostnameIndex).children[0]
|
||||
if (_hostname.textFieldText === "") {
|
||||
_hostname.errorText = qsTr("Ip address cannot be empty")
|
||||
var hostnameItem = listView.itemAtIndex(vars.hostnameIndex).children[0]
|
||||
if (hostnameItem.textField.text === "") {
|
||||
hostnameItem.errorText = qsTr("Ip address cannot be empty")
|
||||
hasEmptyField = true
|
||||
} else if (!_hostname.textField.acceptableInput) {
|
||||
_hostname.errorText = qsTr("Enter the address in the format 255.255.255.255:88")
|
||||
} else if (!hostnameItem.textField.acceptableInput) {
|
||||
hostnameItem.errorText = qsTr("Enter the address in the format 255.255.255.255:88")
|
||||
}
|
||||
|
||||
var _username = listView.itemAtIndex(vars.usernameIndex).children[0]
|
||||
if (_username.textFieldText === "") {
|
||||
_username.errorText = qsTr("Login cannot be empty")
|
||||
var usernameItem = listView.itemAtIndex(vars.usernameIndex).children[0]
|
||||
if (usernameItem.textField.text === "") {
|
||||
usernameItem.errorText = qsTr("Login cannot be empty")
|
||||
hasEmptyField = true
|
||||
}
|
||||
|
||||
var _secretData = listView.itemAtIndex(vars.secretDataIndex).children[0]
|
||||
if (_secretData.textFieldText === "") {
|
||||
_secretData.errorText = qsTr("Password/private key cannot be empty")
|
||||
var secretDataItem = listView.itemAtIndex(vars.secretDataIndex).children[0]
|
||||
if (secretDataItem.textField.text === "") {
|
||||
secretDataItem.errorText = qsTr("Password/private key cannot be empty")
|
||||
hasEmptyField = true
|
||||
}
|
||||
|
||||
|
|
@ -218,46 +208,37 @@ PageType {
|
|||
}
|
||||
|
||||
property list<QtObject> inputFields: [
|
||||
hostname,
|
||||
username,
|
||||
secretData
|
||||
hostnameObject,
|
||||
usernameObject,
|
||||
secretDataObject
|
||||
]
|
||||
|
||||
QtObject {
|
||||
id: hostname
|
||||
id: hostnameObject
|
||||
|
||||
property string title: qsTr("Server IP address [:port]")
|
||||
readonly property string placeholderText: qsTr("255.255.255.255:22")
|
||||
property string textFieldText: ""
|
||||
property bool hideText: false
|
||||
property string imageSource: ""
|
||||
readonly property var clickedHandler: function() {
|
||||
console.debug(">>> Server IP address text field was clicked!!!")
|
||||
clicked()
|
||||
}
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: username
|
||||
|
||||
property string title: qsTr("SSH Username")
|
||||
readonly property string placeholderText: "root"
|
||||
property string textFieldText: ""
|
||||
property bool hideText: false
|
||||
property string imageSource: ""
|
||||
readonly property string placeholderContent: qsTr("255.255.255.255:22")
|
||||
property bool hideContent: false
|
||||
readonly property var clickedHandler: undefined
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: secretData
|
||||
id: usernameObject
|
||||
|
||||
property string title: qsTr("SSH Username")
|
||||
readonly property string placeholderContent: "root"
|
||||
property bool hideContent: false
|
||||
readonly property var clickedHandler: undefined
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: secretDataObject
|
||||
|
||||
property string title: qsTr("Password or SSH private key")
|
||||
readonly property string placeholderText: ""
|
||||
property string textFieldText: ""
|
||||
property bool hideText: true
|
||||
property string imageSource: textFieldText !== "" ? (hideText ? "qrc:/images/controls/eye.svg" : "qrc:/images/controls/eye-off.svg") : ""
|
||||
readonly property string placeholderContent: ""
|
||||
property bool hideContent: true
|
||||
readonly property var clickedHandler: function() {
|
||||
hideText = !hideText
|
||||
hideContent = !hideContent
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ PageType {
|
|||
implicitWidth: parent.width
|
||||
headerTextMaximumLineCount: 10
|
||||
|
||||
headerText: qsTr("What is the level of internet control in your region?")
|
||||
headerText: qsTr("Choose Installation Type")
|
||||
}
|
||||
|
||||
ButtonGroup {
|
||||
|
|
@ -139,7 +139,8 @@ PageType {
|
|||
CardType {
|
||||
implicitWidth: parent.width
|
||||
|
||||
headerText: qsTr("Choose a VPN protocol")
|
||||
headerText: qsTr("Manual")
|
||||
bodyText: qsTr("Choose a VPN protocol")
|
||||
|
||||
ButtonGroup.group: buttonGroup
|
||||
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ PageType {
|
|||
}
|
||||
|
||||
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
|
||||
InstallController.install(dockerContainer, port.textFieldText, transportProtoSelector.currentIndex)
|
||||
InstallController.install(dockerContainer, port.textField.text, transportProtoSelector.currentIndex)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -267,7 +267,7 @@ PageType {
|
|||
if (ProtocolProps.defaultPort(defaultContainerProto) < 0) {
|
||||
port.visible = false
|
||||
} else {
|
||||
port.textFieldText = ProtocolProps.getPortForInstall(defaultContainerProto)
|
||||
port.textField.text = ProtocolProps.getPortForInstall(defaultContainerProto)
|
||||
}
|
||||
transportProtoSelector.currentIndex = ProtocolProps.defaultTransportProto(defaultContainerProto)
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ PageType {
|
|||
Layout.leftMargin: 16
|
||||
|
||||
headerText: qsTr("Key")
|
||||
textFieldPlaceholderText: "vpn://"
|
||||
textField.placeholderText: "vpn://"
|
||||
buttonText: qsTr("Insert")
|
||||
|
||||
clickedFunc: function() {
|
||||
|
|
@ -75,7 +75,7 @@ PageType {
|
|||
text: qsTr("Continue")
|
||||
|
||||
clickedFunc: function() {
|
||||
if (ImportController.extractConfigFromData(textKey.textFieldText)) {
|
||||
if (ImportController.extractConfigFromData(textKey.textField.text)) {
|
||||
PageController.goToPage(PageEnum.PageSetupWizardViewConfig)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,30 +46,29 @@ PageType {
|
|||
shareConnectionDrawer.configContentHeaderText = qsTr("File with connection settings to ") + serverSelector.text
|
||||
|
||||
shareConnectionDrawer.openTriggered()
|
||||
shareConnectionDrawer.contentVisible = false
|
||||
PageController.showBusyIndicator(true)
|
||||
|
||||
switch (type) {
|
||||
case PageShare.ConfigType.AmneziaConnection: {
|
||||
ExportController.generateConnectionConfig(clientNameTextField.textFieldText);
|
||||
ExportController.generateConnectionConfig(clientNameTextField.textField.text);
|
||||
break;
|
||||
}
|
||||
case PageShare.ConfigType.OpenVpn: {
|
||||
ExportController.generateOpenVpnConfig(clientNameTextField.textFieldText)
|
||||
ExportController.generateOpenVpnConfig(clientNameTextField.textField.text)
|
||||
shareConnectionDrawer.configCaption = qsTr("Save OpenVPN config")
|
||||
shareConnectionDrawer.configExtension = ".ovpn"
|
||||
shareConnectionDrawer.configFileName = "amnezia_for_openvpn"
|
||||
break
|
||||
}
|
||||
case PageShare.ConfigType.WireGuard: {
|
||||
ExportController.generateWireGuardConfig(clientNameTextField.textFieldText)
|
||||
ExportController.generateWireGuardConfig(clientNameTextField.textField.text)
|
||||
shareConnectionDrawer.configCaption = qsTr("Save WireGuard config")
|
||||
shareConnectionDrawer.configExtension = ".conf"
|
||||
shareConnectionDrawer.configFileName = "amnezia_for_wireguard"
|
||||
break
|
||||
}
|
||||
case PageShare.ConfigType.Awg: {
|
||||
ExportController.generateAwgConfig(clientNameTextField.textFieldText)
|
||||
ExportController.generateAwgConfig(clientNameTextField.textField.text)
|
||||
shareConnectionDrawer.configCaption = qsTr("Save AmneziaWG config")
|
||||
shareConnectionDrawer.configExtension = ".conf"
|
||||
shareConnectionDrawer.configFileName = "amnezia_for_awg"
|
||||
|
|
@ -90,7 +89,7 @@ PageType {
|
|||
break
|
||||
}
|
||||
case PageShare.ConfigType.Xray: {
|
||||
ExportController.generateXrayConfig(clientNameTextField.textFieldText)
|
||||
ExportController.generateXrayConfig(clientNameTextField.textField.text)
|
||||
shareConnectionDrawer.configCaption = qsTr("Save XRay config")
|
||||
shareConnectionDrawer.configExtension = ".json"
|
||||
shareConnectionDrawer.configFileName = "amnezia_for_xray"
|
||||
|
|
@ -296,7 +295,7 @@ PageType {
|
|||
visible: accessTypeSelector.currentIndex === 0
|
||||
|
||||
headerText: qsTr("User name")
|
||||
textFieldText: "New client"
|
||||
textField.text: "New client"
|
||||
textField.maximumLength: 20
|
||||
|
||||
checkEmptyText: true
|
||||
|
|
@ -525,7 +524,7 @@ PageType {
|
|||
parentFlickable: a
|
||||
|
||||
clickedFunc: function(){
|
||||
if (clientNameTextField.textFieldText !== "") {
|
||||
if (clientNameTextField.textField.text !== "") {
|
||||
ExportController.generateConfig(root.connectionTypesModel[exportTypeSelector.currentIndex].type)
|
||||
}
|
||||
}
|
||||
|
|
@ -555,14 +554,14 @@ PageType {
|
|||
id: searchTextField
|
||||
Layout.fillWidth: true
|
||||
|
||||
textFieldPlaceholderText: qsTr("Search")
|
||||
textField.placeholderText: qsTr("Search")
|
||||
|
||||
Keys.onEscapePressed: {
|
||||
root.isSearchBarVisible = false
|
||||
}
|
||||
|
||||
function navigateTo() {
|
||||
if (searchTextField.textFieldText === "") {
|
||||
if (searchTextField.textField.text === "") {
|
||||
root.isSearchBarVisible = false
|
||||
}
|
||||
}
|
||||
|
|
@ -601,7 +600,7 @@ PageType {
|
|||
sourceModel: ClientManagementModel
|
||||
filters: RegExpFilter {
|
||||
roleName: "clientName"
|
||||
pattern: ".*" + searchTextField.textFieldText + ".*"
|
||||
pattern: ".*" + searchTextField.textField.text + ".*"
|
||||
caseSensitivity: Qt.CaseInsensitive
|
||||
}
|
||||
}
|
||||
|
|
@ -765,7 +764,7 @@ PageType {
|
|||
id: clientNameEditor
|
||||
Layout.fillWidth: true
|
||||
headerText: qsTr("Client name")
|
||||
textFieldText: clientName
|
||||
textField.text: clientName
|
||||
textField.maximumLength: 20
|
||||
checkEmptyText: true
|
||||
}
|
||||
|
|
@ -778,14 +777,14 @@ PageType {
|
|||
text: qsTr("Save")
|
||||
|
||||
clickedFunc: function() {
|
||||
if (clientNameEditor.textFieldText === "") {
|
||||
if (clientNameEditor.textField.text === "") {
|
||||
return
|
||||
}
|
||||
|
||||
if (clientNameEditor.textFieldText !== clientName) {
|
||||
if (clientNameEditor.textField.text !== clientName) {
|
||||
PageController.showBusyIndicator(true)
|
||||
ExportController.renameClient(index,
|
||||
clientNameEditor.textFieldText,
|
||||
clientNameEditor.textField.text,
|
||||
ContainersModel.getProcessedContainerIndex(),
|
||||
ServersModel.getProcessedServerCredentials())
|
||||
PageController.showBusyIndicator(false)
|
||||
|
|
|
|||
|
|
@ -141,7 +141,6 @@ PageType {
|
|||
shareConnectionDrawer.configContentHeaderText = qsTr("File with connection settings to ") + serverSelector.text
|
||||
|
||||
shareConnectionDrawer.openTriggered()
|
||||
shareConnectionDrawer.contentVisible = true
|
||||
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,27 +132,22 @@ PageType {
|
|||
PageController.showNotificationMessage(message)
|
||||
}
|
||||
|
||||
function onInstallServerFromApiFinished(message) {
|
||||
PageController.showBusyIndicator(false)
|
||||
if (!ConnectionController.isConnected) {
|
||||
ServersModel.setDefaultServerIndex(ServersModel.getServersCount() - 1);
|
||||
ServersModel.processedIndex = ServersModel.defaultIndex
|
||||
function onRemoveProcessedServerFinished(finishedMessage) {
|
||||
if (!ServersModel.getServersCount()) {
|
||||
PageController.goToPageHome()
|
||||
} else {
|
||||
PageController.goToStartPage()
|
||||
PageController.goToPage(PageEnum.PageSettingsServersList)
|
||||
}
|
||||
|
||||
PageController.goToPageHome()
|
||||
PageController.showNotificationMessage(message)
|
||||
PageController.showNotificationMessage(finishedMessage)
|
||||
}
|
||||
|
||||
function onChangeApiCountryFinished(message) {
|
||||
PageController.showBusyIndicator(false)
|
||||
function onNoInstalledContainers() {
|
||||
PageController.setTriggeredByConnectButton(true)
|
||||
|
||||
PageController.goToPageHome()
|
||||
PageController.showNotificationMessage(message)
|
||||
}
|
||||
|
||||
function onReloadServerFromApiFinished(message) {
|
||||
PageController.goToPageHome()
|
||||
PageController.showNotificationMessage(message)
|
||||
ServersModel.processedIndex = ServersModel.getDefaultServerIndex()
|
||||
InstallController.setShouldCreateServer(false)
|
||||
PageController.goToPage(PageEnum.PageSetupWizardEasy)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -165,14 +160,6 @@ PageType {
|
|||
PageController.showNotificationMessage(message)
|
||||
PageController.closePage()
|
||||
}
|
||||
|
||||
function onNoInstalledContainers() {
|
||||
PageController.setTriggeredByConnectButton(true)
|
||||
|
||||
ServersModel.processedIndex = ServersModel.getDefaultServerIndex()
|
||||
InstallController.setShouldCreateServer(false)
|
||||
PageController.goToPage(PageEnum.PageSetupWizardEasy)
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
|
@ -214,6 +201,38 @@ PageType {
|
|||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ApiSettingsController
|
||||
|
||||
function onErrorOccurred(error) {
|
||||
PageController.showErrorMessage(error)
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ApiConfigsController
|
||||
|
||||
function onInstallServerFromApiFinished(message) {
|
||||
if (!ConnectionController.isConnected) {
|
||||
ServersModel.setDefaultServerIndex(ServersModel.getServersCount() - 1);
|
||||
ServersModel.processedIndex = ServersModel.defaultIndex
|
||||
}
|
||||
|
||||
PageController.goToPageHome()
|
||||
PageController.showNotificationMessage(message)
|
||||
}
|
||||
|
||||
function onChangeApiCountryFinished(message) {
|
||||
PageController.goToPageHome()
|
||||
PageController.showNotificationMessage(message)
|
||||
}
|
||||
|
||||
function onReloadServerFromApiFinished(message) {
|
||||
PageController.goToPageHome()
|
||||
PageController.showNotificationMessage(message)
|
||||
}
|
||||
}
|
||||
|
||||
StackViewType {
|
||||
id: tabBarStackView
|
||||
objectName: "tabBarStackView"
|
||||
|
|
|
|||
|
|
@ -176,12 +176,12 @@ Window {
|
|||
Connections {
|
||||
target: privateKeyPassphraseDrawer
|
||||
function onOpened() {
|
||||
passphrase.textFieldText = ""
|
||||
passphrase.textField.text = ""
|
||||
passphrase.textField.forceActiveFocus()
|
||||
}
|
||||
|
||||
function onAboutToHide() {
|
||||
if (passphrase.textFieldText !== "") {
|
||||
if (passphrase.textField.text !== "") {
|
||||
PageController.showBusyIndicator(true)
|
||||
}
|
||||
}
|
||||
|
|
@ -222,7 +222,7 @@ Window {
|
|||
|
||||
clickedFunc: function() {
|
||||
privateKeyPassphraseDrawer.closeTriggered()
|
||||
PageController.passphraseRequestDrawerClosed(passphrase.textFieldText)
|
||||
PageController.passphraseRequestDrawerClosed(passphrase.textField.text)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue