Revert back to 'Do not override' as default

This commit is contained in:
Zedifus 2022-06-21 19:53:23 +01:00
parent 7379545186
commit 28e313ee1d
3 changed files with 10 additions and 28 deletions

View File

@ -634,22 +634,14 @@ class PanelHandler(BaseHandler):
return
page_data["java_versions"] = Helpers.find_java_installs()
server_obj: Servers = self.controller.servers.get_server_obj(server_id)
current_java = shlex.split(server_obj.execution_command)[0]
page_java = []
page_data["java_versions"].append("java")
page_data["current_java"] = current_java
for version in page_data["java_versions"]:
temp_version = version + "/bin/java"
if os.name == "nt":
if version == "java" and current_java != version:
page_java.append(version)
else:
if temp_version != current_java and version != "java":
page_java.append(version)
page_java.append(version)
else:
if len(version) > 0:
if version != current_java:
page_java.append(version)
page_java.append(version)
page_data["java_versions"] = page_java
@ -1413,12 +1405,8 @@ class PanelHandler(BaseHandler):
self.get_remote_ip(),
)
if java_selection != "java":
if (
self.helper.is_os_windows()
and not "/bin/java" in java_selection
):
if not "/bin/java" in java_selection:
execution_list[0] = '"' + java_selection + '/bin/java"'
if self.helper.is_os_windows():
execution_list[0] = '"' + java_selection + '/bin/java"'
else:
execution_list[0] = '"' + java_selection + '"'
else:

View File

@ -81,21 +81,15 @@
{% end %}
{% if data['server_stats']['server_type'] == "minecraft-java" %}
<div class="form-group">
<label for="java_selection">{{ translate('serverConfig', 'javaVersion', data['lang']) }} <small
class="text-muted ml-1"> - EXPERIMENTAL -- PLEASE REPORT ANY BUGS &nbsp; {{
translate('serverConfig', 'javaVersionDesc', data['lang'])
}}</small> </label>
<label for="java_selection">{{ translate('serverConfig', 'javaVersion', data['lang']) }}
<small class="text-muted ml-1">{{ translate('serverConfig', 'javaVersionDesc', data['lang']) }}</small>
</label>
<select class="form-select form-control form-control-lg select-css" id="java_selection"
name="java_selection" form="config_form">
{% if data['current_java'] %}
<option value="{{data['current_java']}}">{{data['current_java']}}</option>
<option value="">{{ translate('serverConfig', 'javaNoChange', data['lang'])}}</option>
{% else %}
<option value="">{{ translate('serverConfig',
'javaNoChange', data['lang'])}}</option>
{% end %}
{% for path in data['java_versions'] %}
<option value="{{path}}">{{path}}</option>
<option value="{{path}}">{{path}}</option>
{% end %}
</select>
</div>

View File

@ -302,7 +302,7 @@
"serverExecutable": "Server Executable",
"serverExecutableDesc": "The server's executable file",
"javaVersion": "Override current Java Version",
"javaVersionDesc": "If we've been able to find local java installs. (Windows 'Oracle' only)",
"javaVersionDesc": "If you're going to override java. Make sure your current java path in 'execution command' is wrapped in quotes (default 'java' variable excluded)",
"javaNoChange": "Do Not Override",
"serverExecutionCommand": "Server Execution Command",
"serverExecutionCommandDesc": "What will be launched in a hidden terminal",
@ -534,4 +534,4 @@
"userSettings": "User Settings",
"uses": "Number of uses allowed (-1==No Limit)"
}
}
}