mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-19 02:00:45 +07:00
fix: various fixes (#2662)
* fix: fixed dns processing * fix: fixed proceesed index/id selection * refactor: stop using the server index as state * fix: fixed autostart and start minimized * fix: fixed typo * fix: add socks5 extractConfigFromContainer * fix: remove unused currentContainerUpdated * fix: fixed clear cached profile order
This commit is contained in:
@@ -100,7 +100,7 @@ PageType {
|
||||
function mtProxyScheduleUpdate(closePage) {
|
||||
var cp = closePage === undefined ? false : closePage
|
||||
Qt.callLater(function () {
|
||||
InstallController.updateContainer(ServersUiController.getServerId(ServersUiController.processedServerIndex), ServersUiController.processedContainerIndex, ProtocolEnum.MtProxy, cp)
|
||||
InstallController.updateContainer(ServersUiController.processedServerId, ServersUiController.processedContainerIndex, ProtocolEnum.MtProxy, cp)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ PageType {
|
||||
return
|
||||
}
|
||||
isCheckingStatus = true
|
||||
InstallController.refreshContainerStatus(ServersUiController.getServerId(ServersUiController.processedServerIndex), ServersUiController.processedContainerIndex)
|
||||
InstallController.refreshContainerStatus(ServersUiController.processedServerId, ServersUiController.processedContainerIndex)
|
||||
}
|
||||
|
||||
// Block back navigation and Escape (via PageStart.isControlsDisabled) while SSH/update or diagnostics refresh runs.
|
||||
@@ -200,7 +200,7 @@ PageType {
|
||||
}
|
||||
if (NetworkReachabilityController.hasInternetAccess) {
|
||||
isCheckingStatus = true
|
||||
InstallController.refreshContainerStatus(ServersUiController.getServerId(ServersUiController.processedServerIndex), ServersUiController.processedContainerIndex)
|
||||
InstallController.refreshContainerStatus(ServersUiController.processedServerId, ServersUiController.processedContainerIndex)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -276,7 +276,7 @@ PageType {
|
||||
root.savedPublicHost = MtProxyConfigModel.getPublicHost()
|
||||
if (status === 1) {
|
||||
MtProxyConfigModel.setEnabled(true)
|
||||
InstallController.fetchContainerSecret(ServersUiController.getServerId(ServersUiController.processedServerIndex), ServersUiController.processedContainerIndex)
|
||||
InstallController.fetchContainerSecret(ServersUiController.processedServerId, ServersUiController.processedContainerIndex)
|
||||
} else if (status === 2) {
|
||||
MtProxyConfigModel.setEnabled(false)
|
||||
}
|
||||
@@ -418,7 +418,7 @@ PageType {
|
||||
}
|
||||
|
||||
function effectiveHost() {
|
||||
return root.savedPublicHost !== "" ? root.savedPublicHost : ServersModel.getProcessedServerData("hostName")
|
||||
return root.savedPublicHost !== "" ? root.savedPublicHost : ServersUiController.serverHostName(ServersUiController.processedServerId)
|
||||
}
|
||||
|
||||
function tmeLink() {
|
||||
@@ -720,7 +720,7 @@ PageType {
|
||||
Layout.bottomMargin: 24
|
||||
Layout.leftMargin: 0
|
||||
Layout.rightMargin: 16
|
||||
visible: ServersModel.isProcessedServerHasWriteAccess()
|
||||
visible: ServersUiController.isProcessedServerHasWriteAccess()
|
||||
text: qsTr("Delete MTProxy")
|
||||
textColor: AmneziaStyle.color.vibrantRed
|
||||
clickedFunction: function () {
|
||||
@@ -730,7 +730,7 @@ PageType {
|
||||
var noButtonText = qsTr("Cancel")
|
||||
var yesButtonFunction = function () {
|
||||
PageController.goToPage(PageEnum.PageDeinstalling)
|
||||
InstallController.removeContainer(ServersUiController.getServerId(ServersUiController.processedServerIndex), ServersUiController.processedContainerIndex)
|
||||
InstallController.removeContainer(ServersUiController.processedServerId, ServersUiController.processedContainerIndex)
|
||||
}
|
||||
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, function () {
|
||||
})
|
||||
@@ -784,7 +784,7 @@ PageType {
|
||||
}
|
||||
|
||||
function mtProxyEffectiveHostForLinks() {
|
||||
return root.savedPublicHost !== "" ? root.savedPublicHost : ServersModel.getProcessedServerData("hostName")
|
||||
return root.savedPublicHost !== "" ? root.savedPublicHost : ServersUiController.serverHostName(ServersUiController.processedServerId)
|
||||
}
|
||||
|
||||
function mtProxyTmeLinkForAdditional(baseHex) {
|
||||
@@ -815,9 +815,9 @@ PageType {
|
||||
isUpdating = true
|
||||
if (checked) {
|
||||
root.pendingUpdateAfterEnable = true
|
||||
InstallController.setContainerEnabled(ServersUiController.getServerId(ServersUiController.processedServerIndex), ServersUiController.processedContainerIndex, true)
|
||||
InstallController.setContainerEnabled(ServersUiController.processedServerId, ServersUiController.processedContainerIndex, true)
|
||||
} else {
|
||||
InstallController.setContainerEnabled(ServersUiController.getServerId(ServersUiController.processedServerIndex), ServersUiController.processedContainerIndex, false)
|
||||
InstallController.setContainerEnabled(ServersUiController.processedServerId, ServersUiController.processedContainerIndex, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -855,7 +855,7 @@ PageType {
|
||||
hoverEnabled: true
|
||||
image: "qrc:/images/controls/refresh-cw.svg"
|
||||
imageColor: AmneziaStyle.color.paleGray
|
||||
visible: ServersModel.isProcessedServerHasWriteAccess()
|
||||
visible: ServersUiController.isProcessedServerHasWriteAccess()
|
||||
onClicked: {
|
||||
var secretSnapshot = secret
|
||||
showQuestionDrawer(
|
||||
@@ -889,7 +889,7 @@ PageType {
|
||||
Layout.rightMargin: 16
|
||||
Layout.bottomMargin: 4
|
||||
headerText: qsTr("Public host / IP")
|
||||
textField.placeholderText: ServersModel.getProcessedServerData("hostName")
|
||||
textField.placeholderText: ServersUiController.serverHostName(ServersUiController.processedServerId)
|
||||
textField.text: publicHost
|
||||
textField.maximumLength: 253
|
||||
textField.validator: PublicHostInputValidator {
|
||||
@@ -936,7 +936,7 @@ PageType {
|
||||
Layout.rightMargin: 16
|
||||
Layout.bottomMargin: 12
|
||||
visible: publicHostTextField.textField.text !== "" &&
|
||||
publicHostTextField.textField.text !== ServersModel.getProcessedServerData("hostName")
|
||||
publicHostTextField.textField.text !== ServersUiController.serverHostName(ServersUiController.processedServerId)
|
||||
text: qsTr("⚠ This overrides the server IP in connection links. Make sure this host/domain points to your server.")
|
||||
color: AmneziaStyle.color.goldenApricot
|
||||
font.pixelSize: 12
|
||||
@@ -1281,7 +1281,7 @@ PageType {
|
||||
implicitWidth: 32
|
||||
implicitHeight: 32
|
||||
hoverEnabled: true
|
||||
visible: ServersModel.isProcessedServerHasWriteAccess()
|
||||
visible: ServersUiController.isProcessedServerHasWriteAccess()
|
||||
image: "qrc:/images/controls/trash.svg"
|
||||
imageColor: AmneziaStyle.color.vibrantRed
|
||||
onClicked: {
|
||||
@@ -1628,7 +1628,7 @@ PageType {
|
||||
enabled: !diagLoading
|
||||
onClicked: {
|
||||
diagLoading = true
|
||||
InstallController.refreshContainerDiagnostics(ServersUiController.getServerId(ServersUiController.processedServerIndex), ServersUiController.processedContainerIndex, parseInt(port))
|
||||
InstallController.refreshContainerDiagnostics(ServersUiController.processedServerId, ServersUiController.processedContainerIndex, parseInt(port))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1754,7 +1754,7 @@ PageType {
|
||||
Layout.bottomMargin: 32
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
visible: ServersModel.isProcessedServerHasWriteAccess()
|
||||
visible: ServersUiController.isProcessedServerHasWriteAccess()
|
||||
enabled: !root.mtProxyNetworkBlocked
|
||||
text: qsTr("Save")
|
||||
clickedFunc: function () {
|
||||
|
||||
Reference in New Issue
Block a user