Files
amnezia-client/client/ui/qml/Components/HomeSplitTunnelingDrawer.qml
T

98 lines
2.8 KiB
QML
Raw Normal View History

2024-02-21 18:27:27 +07:00
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
DrawerType2 {
id: root
2024-04-01 17:07:33 +05:00
property bool isAppSplitTinnelingEnabled: Qt.platform.os === "windows" || Qt.platform.os === "android"
2024-02-21 18:27:27 +07:00
anchors.fill: parent
expandedHeight: parent.height * 0.9
2024-02-21 18:27:27 +07:00
2024-12-31 04:16:52 +01:00
expandedStateContent: ColumnLayout {
2024-02-21 18:27:27 +07:00
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
spacing: 0
Header2Type {
Layout.fillWidth: true
Layout.topMargin: 24
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 16
headerText: qsTr("Split tunneling")
descriptionText: qsTr("Allows you to connect to some sites or applications through a VPN connection and bypass others")
}
LabelWithButtonType {
2024-04-18 17:54:55 +04:00
id: splitTunnelingSwitch
2024-02-21 18:27:27 +07:00
Layout.fillWidth: true
Layout.topMargin: 16
visible: ServersModel.isDefaultServerDefaultContainerHasSplitTunneling
2024-02-21 18:27:27 +07:00
text: qsTr("Split tunneling on the server")
descriptionText: qsTr("Enabled \nCan't be disabled for current server")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() {
2024-12-31 04:16:52 +01:00
PageController.goToPage(PageEnum.PageSettingsSplitTunneling)
root.closeTriggered()
2024-02-21 18:27:27 +07:00
}
}
DividerType {
visible: ServersModel.isDefaultServerDefaultContainerHasSplitTunneling
2024-02-21 18:27:27 +07:00
}
LabelWithButtonType {
2024-04-18 17:54:55 +04:00
id: siteBasedSplitTunnelingSwitch
2024-02-21 18:27:27 +07:00
Layout.fillWidth: true
Layout.topMargin: 16
text: qsTr("Site-based split tunneling")
descriptionText: enabled && SitesModel.isTunnelingEnabled ? qsTr("Enabled") : qsTr("Disabled")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsSplitTunneling)
2024-12-31 04:16:52 +01:00
root.closeTriggered()
2024-02-21 18:27:27 +07:00
}
}
DividerType {
}
LabelWithButtonType {
2024-04-18 17:54:55 +04:00
id: appSplitTunnelingSwitch
2024-04-01 17:07:33 +05:00
visible: isAppSplitTinnelingEnabled
2024-02-21 18:27:27 +07:00
Layout.fillWidth: true
text: qsTr("App-based split tunneling")
2024-04-01 17:07:33 +05:00
descriptionText: AppSplitTunnelingModel.isTunnelingEnabled ? qsTr("Enabled") : qsTr("Disabled")
2024-02-21 18:27:27 +07:00
rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() {
2024-04-01 18:45:00 +07:00
PageController.goToPage(PageEnum.PageSettingsAppSplitTunneling)
2024-12-31 04:16:52 +01:00
root.closeTriggered()
2024-02-21 18:27:27 +07:00
}
}
DividerType {
2024-04-01 17:07:33 +05:00
visible: isAppSplitTinnelingEnabled
2024-02-21 18:27:27 +07:00
}
}
}