mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-14 00:31:33 +10:00
feat(library): Added option to change root directory
Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
<input placeholder="GAME ID" v-model="gameId" />
|
||||
<input placeholder="VERSION NAME" v-model="versionName" />
|
||||
<input placeholder="STATUS" v-model="status" />
|
||||
<input placeholder="NEW ROOT DIR" v-model="newRootDir" />
|
||||
|
||||
<button
|
||||
class="w-full rounded-md p-4 bg-blue-600 text-white"
|
||||
@ -36,6 +37,12 @@
|
||||
>
|
||||
Set game download progress
|
||||
</button>
|
||||
<button
|
||||
class="w-full rounded-md p-4 bg-blue-600 text-white"
|
||||
@click="changeRootDirectoryWrapper"
|
||||
>
|
||||
Change root download location
|
||||
</button>
|
||||
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@ -44,6 +51,8 @@ import { invoke } from "@tauri-apps/api/core";
|
||||
const gameId = ref("");
|
||||
const versionName = ref("");
|
||||
const status = ref("");
|
||||
const newRootDir = ref("");
|
||||
|
||||
|
||||
async function queueGame() {
|
||||
await invoke("queue_game_download", {
|
||||
@ -63,7 +72,7 @@ function queueGameWrapper() {
|
||||
}
|
||||
async function startGameDownloads() {
|
||||
console.log("Downloading Games");
|
||||
await invoke("start_game_downloads", { maxThreads: 4 })
|
||||
await invoke("start_game_downloads", { maxThreads: 4 });
|
||||
console.log("Finished downloading games");
|
||||
}
|
||||
function startGameDownloadsWrapper() {
|
||||
@ -83,7 +92,7 @@ function cancelGameDownloadWrapper() {
|
||||
}
|
||||
async function getGameDownloadProgress() {
|
||||
console.log("Getting game download status");
|
||||
await invoke("get_game_download_progress", { gameId: gameId.value })
|
||||
await invoke("get_game_download_progress", { gameId: gameId.value });
|
||||
}
|
||||
function getGameDownloadProgressWrapper() {
|
||||
getGameDownloadProgress()
|
||||
@ -106,7 +115,7 @@ function getGameDownloadProgressWrapper() {
|
||||
|
||||
async function setGameDownloadStatus(status: string) {
|
||||
console.log("Setting game download status");
|
||||
await invoke("set_download_state", { gameId: gameId.value, status: status })
|
||||
await invoke("set_download_state", { gameId: gameId.value, status: status });
|
||||
}
|
||||
function setGameDownloadStatusWrapper() {
|
||||
console.log("Called setGameDownloadWrapper");
|
||||
@ -116,4 +125,15 @@ function setGameDownloadStatusWrapper() {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
async function changeRootDirectory() {
|
||||
console.log("Changing root directory");
|
||||
await invoke("change_root_directory", { newDir: newRootDir.value });
|
||||
}
|
||||
function changeRootDirectoryWrapper() {
|
||||
changeRootDirectory()
|
||||
.then(() => {})
|
||||
.catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user