Added option to change the Java exec to the settings UI.
This commit is contained in:
@@ -17,6 +17,9 @@ const settingsMaxRAMLabel = document.getElementById('settingsMaxRAMLabel')
|
||||
const settingsMinRAMLabel = document.getElementById('settingsMinRAMLabel')
|
||||
const settingsMemoryTotal = document.getElementById('settingsMemoryTotal')
|
||||
const settingsMemoryAvail = document.getElementById('settingsMemoryAvail')
|
||||
const settingsJavaExecDetails = document.getElementById('settingsJavaExecDetails')
|
||||
const settingsJavaExecVal = document.getElementById('settingsJavaExecVal')
|
||||
const settingsJavaExecSel = document.getElementById('settingsJavaExecSel')
|
||||
|
||||
const settingsState = {
|
||||
invalid: new Set()
|
||||
@@ -74,6 +77,12 @@ function initSettingsValues(){
|
||||
if(v.tagName === 'INPUT'){
|
||||
if(v.type === 'number' || v.type === 'text'){
|
||||
v.value = gFn()
|
||||
|
||||
// Special Conditions
|
||||
const cVal = v.getAttribute('cValue')
|
||||
if(cVal === 'JavaExecutable'){
|
||||
populateJavaExecDetails(v.value)
|
||||
}
|
||||
} else if(v.type === 'checkbox'){
|
||||
v.checked = gFn()
|
||||
}
|
||||
@@ -414,6 +423,21 @@ settingsMaxRAMRange.onchange = (e) => {
|
||||
settingsMaxRAMLabel.innerHTML = sMaxV.toFixed(1) + 'G'
|
||||
}
|
||||
|
||||
settingsJavaExecSel.onchange = (e) => {
|
||||
settingsJavaExecVal.value = settingsJavaExecSel.files[0].path
|
||||
populateJavaExecDetails(settingsJavaExecVal.value)
|
||||
}
|
||||
|
||||
function populateJavaExecDetails(execPath){
|
||||
AssetGuard._validateJavaBinary(execPath).then(v => {
|
||||
if(v.valid){
|
||||
settingsJavaExecDetails.innerHTML = `Selected: Java ${v.version.major} Update ${v.version.update} (x${v.arch})`
|
||||
} else {
|
||||
settingsJavaExecDetails.innerHTML = 'Invalid Selection'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function calculateRangeSliderMeta(v){
|
||||
const val = {
|
||||
max: Number(v.getAttribute('max')),
|
||||
|
||||
Reference in New Issue
Block a user