Merge branch 'dev'
This commit is contained in:
commit
af29637163
201 changed files with 2229 additions and 1503287 deletions
62
client/ui/qml/Controls/PopupWithTextField.qml
Normal file
62
client/ui/qml/Controls/PopupWithTextField.qml
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
Popup {
|
||||
id: root
|
||||
|
||||
property alias text: textField.text
|
||||
property alias placeholderText: textField.placeholderText
|
||||
property string yesText: "yes"
|
||||
property string noText: "no"
|
||||
property var yesFunc
|
||||
property var noFunc
|
||||
|
||||
signal editingFinished()
|
||||
|
||||
anchors.centerIn: Overlay.overlay
|
||||
modal: true
|
||||
closePolicy: Popup.NoAutoClose
|
||||
|
||||
width: parent.width - 20
|
||||
|
||||
ColumnLayout {
|
||||
width: parent.width
|
||||
|
||||
TextField {
|
||||
id: textField
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
font.pixelSize: 16
|
||||
echoMode: TextInput.Password
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
BlueButtonType {
|
||||
id: yesButton
|
||||
Layout.preferredWidth: parent.width / 2
|
||||
Layout.fillWidth: true
|
||||
text: yesText
|
||||
onClicked: {
|
||||
root.enabled = false
|
||||
if (yesFunc && typeof yesFunc === "function") {
|
||||
yesFunc()
|
||||
}
|
||||
root.enabled = true
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
id: noButton
|
||||
Layout.preferredWidth: parent.width / 2
|
||||
Layout.fillWidth: true
|
||||
text: noText
|
||||
onClicked: {
|
||||
if (noFunc && typeof noFunc === "function") {
|
||||
noFunc()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
15
client/ui/qml/Pages/ClientInfo/PageClientInfoBase.qml
Normal file
15
client/ui/qml/Pages/ClientInfo/PageClientInfoBase.qml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import PageEnum 1.0
|
||||
import ProtocolEnum 1.0
|
||||
import "../"
|
||||
import "../../Controls"
|
||||
import "../../Config"
|
||||
|
||||
PageBase {
|
||||
id: root
|
||||
property var protocol: ProtocolEnum.Any
|
||||
page: PageEnum.ClientInfo
|
||||
logic: ClientInfoLogic
|
||||
}
|
||||
115
client/ui/qml/Pages/ClientInfo/PageClientInfoOpenVPN.qml
Normal file
115
client/ui/qml/Pages/ClientInfo/PageClientInfoOpenVPN.qml
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import ProtocolEnum 1.0
|
||||
import "../"
|
||||
import "../../Controls"
|
||||
import "../../Config"
|
||||
|
||||
PageClientInfoBase {
|
||||
id: root
|
||||
protocol: ProtocolEnum.OpenVpn
|
||||
|
||||
BackButton {
|
||||
id: back
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
}
|
||||
|
||||
Caption {
|
||||
id: caption
|
||||
text: qsTr("Client Info")
|
||||
}
|
||||
|
||||
BusyIndicator {
|
||||
z: 99
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: ClientInfoLogic.busyIndicatorIsRunning
|
||||
running: ClientInfoLogic.busyIndicatorIsRunning
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
anchors.top: caption.bottom
|
||||
contentHeight: content.height
|
||||
visible: ClientInfoLogic.pageContentVisible
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: GC.defaultMargin
|
||||
|
||||
LabelType {
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
Layout.fillWidth: true
|
||||
font.pixelSize: 20
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: ClientInfoLogic.labelCurrentVpnProtocolText
|
||||
}
|
||||
|
||||
LabelType {
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
height: 21
|
||||
text: qsTr("Client name")
|
||||
}
|
||||
|
||||
TextFieldType {
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 31
|
||||
text: ClientInfoLogic.lineEditNameAliasText
|
||||
onEditingFinished: {
|
||||
if (text !== ClientInfoLogic.lineEditNameAliasText) {
|
||||
ClientInfoLogic.lineEditNameAliasText = text
|
||||
ClientInfoLogic.onLineEditNameAliasEditingFinished()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LabelType {
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
Layout.topMargin: 20
|
||||
height: 21
|
||||
text: qsTr("Certificate id")
|
||||
}
|
||||
|
||||
LabelType {
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: ClientInfoLogic.labelOpenVpnCertId
|
||||
}
|
||||
|
||||
LabelType {
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
Layout.topMargin: 20
|
||||
height: 21
|
||||
text: qsTr("Certificate")
|
||||
}
|
||||
|
||||
TextAreaType {
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
Layout.preferredHeight: 200
|
||||
Layout.fillWidth: true
|
||||
|
||||
textArea.readOnly: true
|
||||
textArea.wrapMode: TextEdit.WrapAnywhere
|
||||
textArea.verticalAlignment: Text.AlignTop
|
||||
textArea.text: ClientInfoLogic.textAreaOpenVpnCertData
|
||||
}
|
||||
|
||||
BlueButtonType {
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 41
|
||||
text: qsTr("Revoke Certificate")
|
||||
onClicked: {
|
||||
ClientInfoLogic.onRevokeOpenVpnCertificateClicked()
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
100
client/ui/qml/Pages/ClientInfo/PageClientInfoWireGuard.qml
Normal file
100
client/ui/qml/Pages/ClientInfo/PageClientInfoWireGuard.qml
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import ProtocolEnum 1.0
|
||||
import "../"
|
||||
import "../../Controls"
|
||||
import "../../Config"
|
||||
|
||||
PageClientInfoBase {
|
||||
id: root
|
||||
protocol: ProtocolEnum.WireGuard
|
||||
|
||||
BackButton {
|
||||
id: back
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
}
|
||||
|
||||
Caption {
|
||||
id: caption
|
||||
text: qsTr("Client Info")
|
||||
}
|
||||
|
||||
BusyIndicator {
|
||||
z: 99
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: ClientInfoLogic.busyIndicatorIsRunning
|
||||
running: ClientInfoLogic.busyIndicatorIsRunning
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
anchors.top: caption.bottom
|
||||
contentHeight: content.height
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: GC.defaultMargin
|
||||
|
||||
LabelType {
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
Layout.fillWidth: true
|
||||
font.pixelSize: 20
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: ClientInfoLogic.labelCurrentVpnProtocolText
|
||||
}
|
||||
|
||||
LabelType {
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
height: 21
|
||||
text: qsTr("Client name")
|
||||
}
|
||||
|
||||
TextFieldType {
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 31
|
||||
text: ClientInfoLogic.lineEditNameAliasText
|
||||
onEditingFinished: {
|
||||
if (text !== ClientInfoLogic.lineEditNameAliasText) {
|
||||
ClientInfoLogic.lineEditNameAliasText = text
|
||||
ClientInfoLogic.onLineEditNameAliasEditingFinished()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LabelType {
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
Layout.topMargin: 20
|
||||
height: 21
|
||||
text: qsTr("Public Key")
|
||||
}
|
||||
|
||||
TextAreaType {
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
Layout.preferredHeight: 200
|
||||
Layout.fillWidth: true
|
||||
|
||||
textArea.readOnly: true
|
||||
textArea.wrapMode: TextEdit.WrapAnywhere
|
||||
textArea.verticalAlignment: Text.AlignTop
|
||||
textArea.text: ClientInfoLogic.textAreaWireGuardKeyData
|
||||
}
|
||||
|
||||
BlueButtonType {
|
||||
enabled: !ClientInfoLogic.busyIndicatorIsRunning
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 41
|
||||
text: qsTr("Revoke Key")
|
||||
onClicked: {
|
||||
ClientInfoLogic.onRevokeWireGuardKeyClicked()
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
client/ui/qml/Pages/PageClientManagement.qml
Normal file
120
client/ui/qml/Pages/PageClientManagement.qml
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Shapes 1.4
|
||||
import SortFilterProxyModel 0.2
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
PageBase {
|
||||
id: root
|
||||
page: PageEnum.ClientManagement
|
||||
logic: ClientManagementLogic
|
||||
enabled: !ClientManagementLogic.busyIndicatorIsRunning
|
||||
|
||||
BackButton {
|
||||
id: back
|
||||
}
|
||||
|
||||
Caption {
|
||||
id: caption
|
||||
text: qsTr("Clients Management")
|
||||
}
|
||||
|
||||
BusyIndicator {
|
||||
z: 99
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: ClientManagementLogic.busyIndicatorIsRunning
|
||||
running: ClientManagementLogic.busyIndicatorIsRunning
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
anchors.top: caption.bottom
|
||||
contentHeight: content.height
|
||||
|
||||
Column {
|
||||
id: content
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
LabelType {
|
||||
font.pixelSize: 20
|
||||
leftPadding: -20
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: ClientManagementLogic.labelCurrentVpnProtocolText
|
||||
}
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: proxyClientManagementModel
|
||||
sourceModel: UiLogic.clientManagementModel
|
||||
sorters: RoleSorter { roleName: "clientName" }
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: lv_clients
|
||||
width: parent.width
|
||||
implicitHeight: contentHeight + 20
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: 10
|
||||
anchors.rightMargin: 10
|
||||
topMargin: 10
|
||||
spacing: 10
|
||||
clip: true
|
||||
model: proxyClientManagementModel
|
||||
highlightRangeMode: ListView.ApplyRange
|
||||
highlightMoveVelocity: -1
|
||||
delegate: Item {
|
||||
implicitWidth: lv_clients.width
|
||||
implicitHeight: 60
|
||||
|
||||
MouseArea {
|
||||
id: ms
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
ClientManagementLogic.onClientItemClicked(proxyClientManagementModel.mapToSource(index))
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
gradient: ms.containsMouse ? gradient_containsMouse : gradient_notContainsMouse
|
||||
LinearGradient {
|
||||
id: gradient_notContainsMouse
|
||||
x1: 0 ; y1:0
|
||||
x2: 0 ; y2: height
|
||||
stops: [
|
||||
GradientStop { position: 0.0; color: "#FAFBFE" },
|
||||
GradientStop { position: 1.0; color: "#ECEEFF" }
|
||||
]
|
||||
}
|
||||
LinearGradient {
|
||||
id: gradient_containsMouse
|
||||
x1: 0 ; y1:0
|
||||
x2: 0 ; y2: height
|
||||
stops: [
|
||||
GradientStop { position: 0.0; color: "#FAFBFE" },
|
||||
GradientStop { position: 1.0; color: "#DCDEDF" }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
LabelType {
|
||||
x: 20
|
||||
y: 20
|
||||
font.pixelSize: 20
|
||||
text: clientName
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -16,6 +16,7 @@ PageBase {
|
|||
BackButton {
|
||||
id: back
|
||||
}
|
||||
|
||||
Caption {
|
||||
id: caption
|
||||
text: qsTr("Server settings")
|
||||
|
|
@ -96,8 +97,16 @@ PageBase {
|
|||
}
|
||||
|
||||
BlueButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 60
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Clients Management")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.ClientManagement)
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 10
|
||||
text: ServerSettingsLogic.pushButtonClearClientCacheText
|
||||
visible: ServerSettingsLogic.pushButtonClearClientCacheVisible
|
||||
onClicked: {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,14 @@ PageBase {
|
|||
page: PageEnum.Start
|
||||
logic: StartPageLogic
|
||||
|
||||
Connections {
|
||||
target: StartPageLogic
|
||||
|
||||
function onShowPassphraseRequestMessage() {
|
||||
popupWithTextField.open()
|
||||
}
|
||||
}
|
||||
|
||||
BackButton {
|
||||
id: back_from_start
|
||||
visible: pageLoader.depth > 1
|
||||
|
|
@ -325,4 +333,22 @@ PageBase {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
PopupWithTextField {
|
||||
id: popupWithTextField
|
||||
placeholderText: "Enter private key passphrase"
|
||||
yesFunc: function() {
|
||||
editingFinished()
|
||||
close()
|
||||
StartPageLogic.passphraseDialogClosed()
|
||||
text = ""
|
||||
}
|
||||
noFunc: function() {
|
||||
close()
|
||||
StartPageLogic.passphraseDialogClosed()
|
||||
}
|
||||
onEditingFinished: {
|
||||
StartPageLogic.privateKeyPassphrase = text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,12 +12,14 @@ import "Controls"
|
|||
import "Pages"
|
||||
import "Pages/Protocols"
|
||||
import "Pages/Share"
|
||||
import "Pages/ClientInfo"
|
||||
import "Config"
|
||||
|
||||
Window {
|
||||
property var pages: ({})
|
||||
property var protocolPages: ({})
|
||||
property var sharePages: ({})
|
||||
property var clientInfoPages: ({})
|
||||
|
||||
id: root
|
||||
visible: true
|
||||
|
|
@ -38,6 +40,7 @@ Window {
|
|||
if (type === PageType.Basic) p_obj = pages[page]
|
||||
else if (type === PageType.Proto) p_obj = protocolPages[page]
|
||||
else if (type === PageType.ShareProto) p_obj = sharePages[page]
|
||||
else if (type === PageType.ClientInfo) p_obj = clientInfoPages[page]
|
||||
else return
|
||||
|
||||
//console.debug("QML gotoPage " + type + " " + page + " " + p_obj)
|
||||
|
|
@ -154,6 +157,19 @@ Window {
|
|||
}
|
||||
}
|
||||
|
||||
FolderListModel {
|
||||
id: folderModelClientInfo
|
||||
folder: "qrc:/ui/qml/Pages/ClientInfo/"
|
||||
nameFilters: ["*.qml"]
|
||||
showDirs: false
|
||||
|
||||
onStatusChanged: if (status == FolderListModel.Ready) {
|
||||
for (var i=0; i<folderModelClientInfo.count; i++) {
|
||||
createPagesObjects(folderModelClientInfo.get(i, "filePath"), PageType.ClientInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function createPagesObjects(file, type) {
|
||||
if (file.indexOf("Base") !== -1) return; // skip Base Pages
|
||||
//console.debug("Creating component " + file + " for " + type);
|
||||
|
|
@ -177,6 +193,9 @@ Window {
|
|||
else if (type === PageType.ShareProto) {
|
||||
sharePages[obj.protocol] = obj
|
||||
}
|
||||
else if (type === PageType.ClientInfo) {
|
||||
clientInfoPages[obj.protocol] = obj
|
||||
}
|
||||
|
||||
// console.debug("Created component " + component.url + " for " + type);
|
||||
}
|
||||
|
|
@ -206,7 +225,10 @@ Window {
|
|||
//console.debug("Qml Connections onGoToShareProtocolPage " + protocol);
|
||||
root.gotoPage(PageType.ShareProto, protocol, reset, slide)
|
||||
}
|
||||
|
||||
function onGoToClientInfoPage(protocol, reset, slide) {
|
||||
//console.debug("Qml Connections onGoToClientInfoPage " + protocol);
|
||||
root.gotoPage(PageType.ClientInfo, protocol, reset, slide)
|
||||
}
|
||||
|
||||
function onClosePage() {
|
||||
root.close_page()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue