Various final backend fixes (#117)

* Various final backend fixes

* Add FS watching

* run lint

* Autodetect installed jars
This commit is contained in:
Geometrically
2023-05-16 15:30:04 -07:00
committed by GitHub
parent 5cb54b44be
commit 3fa0e99de2
26 changed files with 941 additions and 529 deletions

View File

@@ -11,7 +11,7 @@ JavaVersion {
path: Path
version: String
}
*/
/// Get all JREs that exist on the system
@@ -50,20 +50,18 @@ export async function get_jre(path) {
return await invoke('jre_get_jre', { path })
}
// Gets key for the optimal JRE to use, for a given profile path
// The key can be used in the hashmap contained by JavaGlobals in Settings (if it exists)
export async function get_optimal_jre_key_by_path(path) {
return await invoke('jre_get_optimal_jre_key_by_path', { path })
}
// Gets key for the optimal JRE to use, for a given profile
// The key can be used in the hashmap contained by JavaGlobals in Settings (if it exists)
export async function get_optimal_jre_key(path) {
return await invoke('jre_get_optimal_jre_key', { path })
}
// Autodetect Java globals, by searching the users computer.
// Returns a *NEW* JavaGlobals that can be put into Settings
export async function autodetect_java_globals(path) {
return await invoke('jre_autodetect_java_globals', { path })
}
// Automatically installs specified java version
export async function jre_auto_install_java(javaVersion) {
return await invoke('jre_auto_install_java', { javaVersion })
}
// Get max memory in KiB
export async function get_max_memory() {
return await invoke('jre_get_max_memory')
}

View File

@@ -46,11 +46,6 @@ export async function check_installed(path, projectId) {
return await invoke('profile_check_installed', { path, projectId })
}
// Syncs a profile with the disk
export async function sync(path) {
return await invoke('profile_sync', { path })
}
// Installs/Repairs a profile
export async function install(path) {
return await invoke('profile_install', { path })
@@ -66,12 +61,6 @@ export async function update_project(path, projectPath) {
return await invoke('profile_update_project', { path, projectPath })
}
// Replaces a given project with the specified version ID
// Returns a path to the new project file
export async function replace_project(path, projectPath, versionId) {
return await invoke('profile_replace_project', { path, projectPath, versionId })
}
// Add a project to a profile from a version
// Returns a path to the new project file
export async function add_project_from_version(path, versionId) {

View File

@@ -17,7 +17,7 @@ import {
import { BrowseIcon } from '@/assets/icons'
import { useTheming } from '@/store/state'
import { get, set } from '@/helpers/settings'
import { find_jre_8_jres, find_jre_17_jres, get_jre } from '@/helpers/jre'
import { find_jre_8_jres, find_jre_17_jres, get_jre, get_max_memory } from '@/helpers/jre'
import { open } from '@tauri-apps/api/dialog'
const themeStore = useTheming()
@@ -29,6 +29,7 @@ if (!fetchSettings.java_globals?.JAVA_8)
if (!fetchSettings.java_globals?.JAVA_17)
fetchSettings.java_globals.JAVA_17 = { path: '', version: '' }
const settings = ref(fetchSettings)
const maxMemory = ref((await get_max_memory()) / 1024)
const chosenInstallOptions = ref([])
const browsingInstall = ref(0)
@@ -285,11 +286,11 @@ const setJavaInstall = (javaInstall) => {
<div class="sliders">
<span class="slider">
Minimum Memory
<Slider v-model="settings.memory.minimum" :min="1000" :max="8200" :step="10" />
<Slider v-model="settings.memory.minimum" :min="256" :max="maxMemory" :step="10" />
</span>
<span class="slider">
Maximum Memory
<Slider v-model="settings.memory.maximum" :min="1000" :max="8200" :step="10" />
<Slider v-model="settings.memory.maximum" :min="256" :max="maxMemory" :step="10" />
</span>
</div>
</div>