6 Commits

Author SHA1 Message Date
Maarten van Heusden
7888f373af refactor: cleanup main.ts styling 2026-02-01 17:37:32 +01:00
Maarten
43a9d159df docs: update README with new interface 2026-02-01 17:17:28 +01:00
Maarten
30b19761d6 feat: block app when downloading 2026-02-01 15:44:33 +01:00
Maarten van Heusden
753f22da5e chore: make compatible for windows 2026-02-01 14:35:05 +01:00
Maarten van Heusden
95812768ef fix: settings modal 2026-02-01 13:03:39 +01:00
Maarten van Heusden
7204302ed4 feat: integrated terminal 2026-01-31 20:59:02 +01:00
7 changed files with 21 additions and 41 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "vectum",
"private": true,
"version": "3.1.0",
"version": "3.0.1",
"type": "module",
"license": "GPL-3.0-only",
"scripts": {

2
src-tauri/Cargo.lock generated
View File

@@ -4984,7 +4984,7 @@ dependencies = [
[[package]]
name = "vectum"
version = "3.1.0"
version = "3.0.1"
dependencies = [
"derive-getters",
"fix-path-env",

View File

@@ -1,6 +1,6 @@
[package]
name = "vectum"
version = "3.1.0"
version = "3.0.1"
description = "Download older versions of Steam games with DepotDownloader"
authors = ["mmvanheusden"]
edition = "2021"

View File

@@ -5,8 +5,6 @@ use tauri::State;
use crate::AppState;
use crate::steam::SteamDownload;
/* Parts of this file are derived from https://github.com/cablehead/tauri-xtermjs-nushell/blob/0bdd4a27ee2874de12e99bccd6c91d6ec5d28fbc/src-tauri/src/main.rs */
#[tauri::command]
pub async fn async_write_to_pty(data: &str, state: State<'_, AppState>) -> Result<(), ()> {
write!(state.writer.lock().await, "{}", data).map_err(|_| ())
@@ -20,7 +18,7 @@ pub async fn async_read_from_pty(state: State<'_, AppState>) -> Result<Option<St
let data = reader.fill_buf().map_err(|_| ())?;
// Send the data to the webview if necessary
if !data.is_empty() {
if data.len() > 0 {
std::str::from_utf8(data)
.map(|v| Some(v.to_string()))
.map_err(|_| ())?
@@ -66,14 +64,14 @@ pub fn create_depotdownloader_command(steam_download: &SteamDownload, cwd: &Path
command.cwd(cwd);
if !steam_download.is_anonymous() {
command.args(["-username", &steam_download.username().clone().unwrap()]);
command.args(["-password", &steam_download.password().clone().unwrap()]);
command.args(["-username", &*steam_download.username().clone().unwrap()]);
command.args(["-password", &*steam_download.password().clone().unwrap()]);
}
command.args(["-app", steam_download.app_id()]);
command.args(["-depot", steam_download.depot_id()]);
command.args(["-manifest", steam_download.manifest_id()]);
command.args(["-dir", &steam_download.output_path()]);
command.args(["-app", &*steam_download.app_id()]);
command.args(["-depot", &*steam_download.depot_id()]);
command.args(["-manifest", &*steam_download.manifest_id()]);
command.args(["-dir", &*steam_download.output_path()]);
command
}

View File

@@ -1,6 +1,6 @@
{
"productName": "SteamDepotDownloaderGUI",
"version": "3.1.0",
"version": "3.0.1",
"identifier": "net.oopium.depotdownloader",
"build": {
"beforeDevCommand": "pnpm dev",
@@ -15,8 +15,7 @@
"title": "SteamDepotDownloaderGUI",
"width": 890,
"height": 650,
"resizable": false,
"maximizable": false
"resizable": false
}
],
"security": {

View File

@@ -17,7 +17,7 @@
<body class="select-none">
<div class="f1-light text-center mb-1">Steam Depot Downloader</div>
<div class="flex justify-between gap-2 w-svw flex-row">
<div class="w-1/2 h-full" id="left-side">
<div class="w-1/2 h-full">
<div class="mx-auto">
<form id="theform">
<div class="form-group mx-3 mt-1">
@@ -159,15 +159,10 @@
</div>
</div>
</div>
<div class="w-1/2 h-full px-2" id="right-side">
<div class="w-1/2 h-full px-2">
<div class="mt-2 h-full w-full mx-auto">
<div class="border border-gray-300 rounded-md bg-gray-900 text-white shadow shadow-blue-200">
<div class="text-md font-semibold w-full inline-flex my-px items-center">
<span class="text-center w-full">Download output</span>
<button id="clear-terminal" class="disabled:pointer-events-none disabled:line-through disabled:text-gray-300 ml-auto py-px px-2 border-2 rounded-xs border-red-500/75 font-normal enabled:hover:bg-red-200/30 enabled:active:bg-red-200/50">
Clear
</button>
</div>
<span class="text-md font-semibold block text-center">Download output</span>
<div class="max-h-[70vh]" id="xtermjs"></div>
</div>
<div class="mt-3 justify-between flex flex-row gap-3">

View File

@@ -7,10 +7,8 @@ import {Terminal} from "@xterm/xterm";
import { FitAddon } from "@xterm/addon-fit";
import { listen } from "@tauri-apps/api/event";
/* Parts of this file are derived from https://github.com/cablehead/tauri-xtermjs-nushell/blob/0bdd4a27ee2874de12e99bccd6c91d6ec5d28fbc/src/main.ts */
function blockTerminalClearButton(state: boolean) {
$("#clear-terminal").prop( "disabled", state );
function setLoader(state: boolean) {
$("#busy").prop("hidden", !state);
}
@@ -18,9 +16,8 @@ function setLoadingState(state: boolean) {
$("#busy").prop("hidden", !state);
// loop through all buttons and input fields and disable them
for (const element of document.querySelectorAll("button, input, div[role='button']")) {
for (const element of document.querySelectorAll("button, input")) {
if (element.closest("#settings-content")) continue;
if (element.closest("#right-side")) continue;
(element as any).disabled = state;
}
@@ -52,7 +49,7 @@ const invalidFields = () => {
return invalidFields;
};
const registerTerminal: (terminalElement: HTMLElement) => Promise<Terminal> = async (terminalElement: HTMLElement) => {
const registerTerminal = async (terminalElement: HTMLElement) => {
const fitAddon = new FitAddon();
const term = new Terminal({
fontSize: 10,
@@ -60,7 +57,7 @@ const registerTerminal: (terminalElement: HTMLElement) => Promise<Terminal> = as
rows: 100,
cols: 100,
theme: {
background: "rgb(33, 33, 33)",
background: "rgb(47, 47, 47)",
},
});
term.loadAddon(fitAddon);
@@ -100,13 +97,11 @@ const registerTerminal: (terminalElement: HTMLElement) => Promise<Terminal> = as
}
window.requestAnimationFrame(readFromPty);
return term;
};
$(async () => {
let terminal = await registerTerminal($("#xtermjs")[0]);
await registerTerminal($("#xtermjs")[0]);
let downloadDirectory: string | null;
// Startup logic
@@ -114,9 +109,6 @@ $(async () => {
await invoke("preload_vectum");
setLoadingState(false);
$("#clear-terminal").on("click", async () => {
terminal.reset()
})
$("#pickpath").on("click", async () => {
// Open a dialog
@@ -204,9 +196,6 @@ $(async () => {
setLoadingState(true);
await invoke("start_download", {steamDownload: steamDownload});
// Block clear terminal button (to avoid clearing ongoing download logs)
blockTerminalClearButton(true);
console.log("Send frontend data over to backend. Ready for next download.");
});
@@ -241,5 +230,4 @@ $(async () => {
listen<string>("command-exited", () => {
setLoadingState(false);
blockTerminalClearButton(false);
});