2023-05-27 22:46:41 +08:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
|
|
|
|
|
import PageEnum 1.0
|
2023-07-14 13:14:50 +09:00
|
|
|
import ContainerProps 1.0
|
2023-05-27 22:46:41 +08:00
|
|
|
|
|
|
|
|
import "../Controls2"
|
|
|
|
|
import "../Controls2/TextTypes"
|
|
|
|
|
|
|
|
|
|
|
2025-08-01 05:56:02 +02:00
|
|
|
ListViewType {
|
2023-05-27 22:46:41 +08:00
|
|
|
id: root
|
|
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
anchors.fill: parent
|
2023-05-27 22:46:41 +08:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
delegate: ColumnLayout {
|
|
|
|
|
width: root.width
|
2023-05-27 22:46:41 +08:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
LabelWithButtonType {
|
|
|
|
|
Layout.fillWidth: true
|
2024-04-18 17:54:55 +04:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
text: name
|
|
|
|
|
descriptionText: description
|
|
|
|
|
rightImageSource: isInstalled ? "qrc:/images/controls/chevron-right.svg" : "qrc:/images/controls/download.svg"
|
2023-05-27 22:46:41 +08:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
clickedFunction: function() {
|
|
|
|
|
if (isInstalled) {
|
|
|
|
|
var containerIndex = root.model.mapToSource(index)
|
2026-04-30 14:53:03 +08:00
|
|
|
ServersUiController.processedContainerIndex = containerIndex
|
2023-05-27 22:46:41 +08:00
|
|
|
|
2026-04-30 14:53:03 +08:00
|
|
|
if (isVpnContainer) {
|
|
|
|
|
// var isThirdPartyConfig = root.model.data(index, ContainersModel.IsThirdPartyConfigRole)
|
|
|
|
|
if (isThirdPartyConfig) {
|
2026-05-15 12:33:36 +08:00
|
|
|
InstallController.updateProtocols(ServersUiController.getServerId(ServersUiController.processedServerIndex), containerIndex)
|
2026-04-30 14:53:03 +08:00
|
|
|
PageController.goToPage(PageEnum.PageProtocolRaw)
|
|
|
|
|
return
|
|
|
|
|
}
|
2025-08-06 04:35:51 +02:00
|
|
|
}
|
2023-05-27 22:46:41 +08:00
|
|
|
|
2026-04-30 14:53:03 +08:00
|
|
|
if (isIpsec) {
|
2026-05-15 12:33:36 +08:00
|
|
|
InstallController.updateProtocols(ServersUiController.getServerId(ServersUiController.processedServerIndex), containerIndex)
|
2025-08-06 04:35:51 +02:00
|
|
|
PageController.goToPage(PageEnum.PageProtocolRaw)
|
2026-04-30 14:53:03 +08:00
|
|
|
} else if (isDns) {
|
2025-08-06 04:35:51 +02:00
|
|
|
PageController.goToPage(PageEnum.PageServiceDnsSettings)
|
2026-05-18 14:52:58 +03:00
|
|
|
} else if (isMtProxy) {
|
|
|
|
|
MtProxyConfigModel.updateModel(config)
|
|
|
|
|
PageController.goToPage(PageEnum.PageServiceMtProxySettings)
|
2026-04-30 14:53:03 +08:00
|
|
|
} else {
|
2026-05-15 12:33:36 +08:00
|
|
|
InstallController.updateProtocols(ServersUiController.getServerId(ServersUiController.processedServerIndex), containerIndex)
|
2025-08-06 04:35:51 +02:00
|
|
|
PageController.goToPage(PageEnum.PageSettingsServerProtocol)
|
|
|
|
|
}
|
2023-05-27 22:46:41 +08:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
} else {
|
2026-04-30 14:53:03 +08:00
|
|
|
var containerIndex = root.model.mapToSource(index)
|
|
|
|
|
ServersUiController.processedContainerIndex = containerIndex
|
2025-08-06 04:35:51 +02:00
|
|
|
PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings)
|
2023-05-27 22:46:41 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
MouseArea {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
|
enabled: false
|
|
|
|
|
}
|
2023-05-27 22:46:41 +08:00
|
|
|
}
|
2025-08-06 04:35:51 +02:00
|
|
|
|
|
|
|
|
DividerType {}
|
2023-05-27 22:46:41 +08:00
|
|
|
}
|
|
|
|
|
}
|