mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
76 lines
2.7 KiB
QML
76 lines
2.7 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
import PageEnum 1.0
|
|
import ContainerProps 1.0
|
|
|
|
import "../Controls2"
|
|
import "../Controls2/TextTypes"
|
|
|
|
|
|
ListViewType {
|
|
id: root
|
|
|
|
anchors.fill: parent
|
|
|
|
delegate: ColumnLayout {
|
|
width: root.width
|
|
|
|
LabelWithButtonType {
|
|
Layout.fillWidth: true
|
|
|
|
text: name
|
|
descriptionText: description
|
|
rightImageSource: isInstalled ? "qrc:/images/controls/chevron-right.svg" : "qrc:/images/controls/download.svg"
|
|
|
|
clickedFunction: function() {
|
|
if (isInstalled) {
|
|
var containerIndex = root.model.mapToSource(index)
|
|
ServersUiController.processedContainerIndex = containerIndex
|
|
|
|
if (isVpnContainer) {
|
|
// var isThirdPartyConfig = root.model.data(index, ContainersModel.IsThirdPartyConfigRole)
|
|
if (isThirdPartyConfig) {
|
|
InstallController.updateProtocols(ServersUiController.processedIndex, containerIndex)
|
|
PageController.goToPage(PageEnum.PageProtocolRaw)
|
|
return
|
|
}
|
|
}
|
|
|
|
if (isIpsec) {
|
|
InstallController.updateProtocols(ServersUiController.processedIndex, containerIndex)
|
|
PageController.goToPage(PageEnum.PageProtocolRaw)
|
|
} else if (isDns) {
|
|
PageController.goToPage(PageEnum.PageServiceDnsSettings)
|
|
} else if (isMtProxy) {
|
|
MtProxyConfigModel.updateModel(config)
|
|
PageController.goToPage(PageEnum.PageServiceMtProxySettings)
|
|
} else if (isTelemt) {
|
|
TelemtConfigModel.updateModel(config)
|
|
PageController.goToPage(PageEnum.PageServiceTelemtSettings)
|
|
} else {
|
|
InstallController.updateProtocols(ServersUiController.processedIndex, containerIndex)
|
|
PageController.goToPage(PageEnum.PageSettingsServerProtocol)
|
|
}
|
|
|
|
} else {
|
|
var containerIndex = root.model.mapToSource(index)
|
|
ServersUiController.processedContainerIndex = containerIndex
|
|
PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings)
|
|
}
|
|
}
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
cursorShape: Qt.PointingHandCursor
|
|
enabled: false
|
|
}
|
|
}
|
|
|
|
DividerType {}
|
|
}
|
|
}
|