Skip to content

Commit dd9eae9

Browse files
committed
fixed xray save
1 parent 79065e1 commit dd9eae9

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

client/core/controllers/selfhosted/installController.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <QtConcurrent>
1212

1313
#include "core/configurators/configuratorBase.h"
14+
#include "core/configurators/xrayConfigurator.h"
1415
#include "core/utils/containerEnum.h"
1516
#include "core/utils/containers/containerUtils.h"
1617
#include "core/utils/protocolEnum.h"
@@ -209,6 +210,14 @@ ErrorCode InstallController::updateServerConfig(const QString &serverId, DockerC
209210
}
210211
}
211212

213+
if (errorCode == ErrorCode::NoError
214+
&& (container == DockerContainer::Xray || container == DockerContainer::SSXray)) {
215+
DnsSettings dnsSettings = { m_appSettingsRepository->primaryDns(), m_appSettingsRepository->secondaryDns() };
216+
XrayConfigurator xrayConfigurator(&sshSession);
217+
errorCode = xrayConfigurator.applyServerSettingsToRemote(credentials, container, newConfig, dnsSettings,
218+
/*appendNewClient*/ false);
219+
}
220+
212221
if (errorCode == ErrorCode::NoError) {
213222
if (container == DockerContainer::MtProxy) {
214223
MtProxyInstaller::uploadClientSettingsSnapshot(sshSession, credentials, container, newConfig);

client/ui/qml/Pages2/PageProtocolXraySettings.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ PageType {
247247
visible: listView.enabled
248248
clickedFunction: function() {
249249
var yesButtonFunction = function() {
250-
XrayConfigModel.resetToDefaults()
251250
PageController.showNotificationMessage(
252251
qsTr("Settings were reset to defaults. Tap Save to apply them on the server."))
252+
XrayConfigModel.resetToDefaults()
253253
}
254254
showQuestionDrawer(qsTr("Reset settings?"), qsTr("All XRay settings will be restored to defaults."),
255255
qsTr("Reset"), qsTr("Cancel"), yesButtonFunction, function() {

0 commit comments

Comments
 (0)