2023-01-09 12:38:01 +03:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import QtQuick.Shapes 1.4
|
2023-01-10 16:21:45 +03:00
|
|
|
import SortFilterProxyModel 0.2
|
2023-01-09 12:38:01 +03:00
|
|
|
import PageEnum 1.0
|
|
|
|
|
import "./"
|
|
|
|
|
import "../Controls"
|
|
|
|
|
import "../Config"
|
|
|
|
|
|
|
|
|
|
PageBase {
|
|
|
|
|
id: root
|
|
|
|
|
page: PageEnum.ClientManagement
|
|
|
|
|
logic: ClientManagementLogic
|
2023-01-11 21:36:18 +03:00
|
|
|
enabled: !ClientManagementLogic.busyIndicatorIsRunning
|
2023-01-09 12:38:01 +03:00
|
|
|
|
|
|
|
|
BackButton {
|
|
|
|
|
id: back
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Caption {
|
|
|
|
|
id: caption
|
|
|
|
|
text: qsTr("Clients Management")
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-12 20:20:24 +03:00
|
|
|
BusyIndicator {
|
|
|
|
|
z: 99
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
visible: ClientManagementLogic.busyIndicatorIsRunning
|
|
|
|
|
running: ClientManagementLogic.busyIndicatorIsRunning
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-16 12:37:14 +03:00
|
|
|
FlickableType {
|
2023-01-09 12:38:01 +03:00
|
|
|
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
|
2023-01-16 12:37:14 +03:00
|
|
|
leftPadding: -20
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2023-01-09 12:38:01 +03:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2023-01-11 21:36:18 +03:00
|
|
|
text: ClientManagementLogic.labelCurrentVpnProtocolText
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-10 16:21:45 +03:00
|
|
|
SortFilterProxyModel {
|
|
|
|
|
id: proxyClientManagementModel
|
|
|
|
|
sourceModel: UiLogic.clientManagementModel
|
|
|
|
|
sorters: RoleSorter { roleName: "clientName" }
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-09 12:38:01 +03:00
|
|
|
ListView {
|
|
|
|
|
id: lv_clients
|
|
|
|
|
width: parent.width
|
|
|
|
|
implicitHeight: contentHeight + 20
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
2023-04-16 07:32:32 +03:00
|
|
|
anchors.rightMargin: 20
|
2023-01-09 12:38:01 +03:00
|
|
|
topMargin: 10
|
|
|
|
|
spacing: 10
|
|
|
|
|
clip: true
|
2023-01-10 16:21:45 +03:00
|
|
|
model: proxyClientManagementModel
|
2023-01-09 12:38:01 +03:00
|
|
|
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: {
|
2023-01-10 16:21:45 +03:00
|
|
|
ClientManagementLogic.onClientItemClicked(proxyClientManagementModel.mapToSource(index))
|
2023-01-09 12:38:01 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
2023-01-10 16:21:45 +03:00
|
|
|
y: 20
|
|
|
|
|
font.pixelSize: 20
|
|
|
|
|
text: clientName
|
2023-01-09 12:38:01 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|