Skip to content

Commit

Permalink
Fix remote settings and websocket buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
zapek committed Jan 4, 2025
1 parent e63531a commit 1462dc8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package io.xeres.app.configuration;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
Expand All @@ -31,10 +31,9 @@

@Configuration
@EnableWebSocket
@ConditionalOnProperty(value = "spring.main.web-application-type", havingValue = "servlet")
@ConditionalOnExpression("'${spring.main.web-application-type}' != 'none'")
public class WebSocketConfiguration implements WebSocketConfigurer
{
// See https://stackoverflow.com/questions/21730566/how-to-increase-output-buffer-for-spring-sockjs-websocket-server-implementation
@Bean
public ServletServerContainerFactoryBean createServletServerContainerFactoryBean()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 by David Gerber - https://zapek.com
* Copyright (c) 2024-2025 by David Gerber - https://zapek.com
*
* This file is part of Xeres.
*
Expand Down Expand Up @@ -102,7 +102,7 @@ public void onLoad(Settings settings)
noUpnp = !settings.isUpnpEnabled();

remoteEnabled.setSelected(settings.isRemoteEnabled());
remoteUpnpEnabled.setSelected(settings.isRemoteUpnpEnabled());
remoteUpnpEnabled.setSelected(settings.isUpnpRemoteEnabled());
checkDisabled();
password.setText(settings.getRemotePassword());
port.setText(String.valueOf(StartupProperties.getInteger(CONTROL_PORT)));
Expand All @@ -118,7 +118,7 @@ public Settings onSave()

settings.setRemotePassword(isBlank(password.getPassword()) ? null : password.getPassword());
settings.setRemoteEnabled(remoteEnabled.isSelected());
settings.setRemoteUpnpEnabled(remoteUpnpEnabled.isSelected());
settings.setUpnpRemoteEnabled(remoteUpnpEnabled.isSelected());
if (!port.getText().isEmpty())
{
var portValue = Integer.parseInt(port.getText());
Expand Down
12 changes: 6 additions & 6 deletions ui/src/main/java/io/xeres/ui/model/settings/Settings.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2023 by David Gerber - https://zapek.com
* Copyright (c) 2019-2025 by David Gerber - https://zapek.com
*
* This file is part of Xeres.
*
Expand Down Expand Up @@ -43,7 +43,7 @@ public class Settings implements Cloneable

private boolean remoteEnabled;

private boolean isRemoteUpnpEnabled;
private boolean isUpnpRemoteEnabled;

private int remotePort;

Expand Down Expand Up @@ -162,14 +162,14 @@ public void setRemoteEnabled(boolean enabled)
remoteEnabled = enabled;
}

public boolean isRemoteUpnpEnabled()
public boolean isUpnpRemoteEnabled()
{
return isRemoteUpnpEnabled;
return isUpnpRemoteEnabled;
}

public void setRemoteUpnpEnabled(boolean remoteUpnpEnabled)
public void setUpnpRemoteEnabled(boolean upnpRemoteEnabled)
{
isRemoteUpnpEnabled = remoteUpnpEnabled;
isUpnpRemoteEnabled = upnpRemoteEnabled;
}

public int getRemotePort()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2023 by David Gerber - https://zapek.com
* Copyright (c) 2019-2025 by David Gerber - https://zapek.com
*
* This file is part of Xeres.
*
Expand Down Expand Up @@ -48,7 +48,7 @@ public static Settings fromDTO(SettingsDTO dto)
settings.setIncomingDirectory(dto.incomingDirectory());
settings.setRemotePassword(dto.remotePassword());
settings.setRemoteEnabled(dto.remoteEnabled());
settings.setRemoteUpnpEnabled(dto.upnpRemoteEnabled());
settings.setUpnpRemoteEnabled(dto.upnpRemoteEnabled());
settings.setRemotePort(dto.remotePort());
return settings;
}
Expand All @@ -72,7 +72,7 @@ public static SettingsDTO toDTO(Settings settings)
settings.getIncomingDirectory(),
settings.getRemotePassword(),
settings.isRemoteEnabled(),
settings.isRemoteUpnpEnabled(),
settings.isUpnpRemoteEnabled(),
settings.getRemotePort()
);
}
Expand Down

0 comments on commit 1462dc8

Please sign in to comment.