patcher update, no more hardcoded urls, launch fixes

This commit is contained in:
2024-04-14 16:36:32 +02:00
parent 1c4a40c495
commit 6f2764a047
11 changed files with 551 additions and 864 deletions

View File

@@ -66,6 +66,10 @@
window.dispatchEvent(new CustomEvent("updateExit"));
});
window.addEventListener("open-settings", (e) => {
currentPage.set(Page.Settings);
});
window.addEventListener("launchStatusUpdate", (e) => {
const status = (e as CustomEvent).detail.status;
launchStatus.set(status);

View File

@@ -26,12 +26,12 @@
green: "bg-green-600 dark:bg-green-500",
yellow: "bg-yellow-400",
purple: "bg-purple-600 dark:bg-purple-500",
indigo: "bg-indigo-600 dark:bg-indigo-500",
indigo: "bg-indigo-600 dark:bg-indigo-500"
};
let _progress = tweened(0, {
duration: tweenDuration,
easing,
easing
});
$: {
@@ -50,8 +50,12 @@
>
<span class="text-sm font-medium text-blue-700 dark:text-white"
>{animate
? $_progress.toFixed(precision)
: progress.toFixed(precision)}%</span
? isNaN($_progress)
? parseInt("100").toFixed(precision)
: $_progress.toFixed(precision)
: isNaN(progress)
? parseInt("100").toFixed(precision)
: progress.toFixed(precision)}%</span
>
</div>
{/if}
@@ -63,7 +67,13 @@
class={twJoin(labelInsideClass, barColors[color])}
style="width: {animate ? $_progress : progress}%"
>
{animate ? $_progress.toFixed(precision) : progress.toFixed(precision)}%
{animate
? isNaN($_progress)
? parseInt("100").toFixed(precision)
: $_progress.toFixed(precision)
: isNaN(progress)
? parseInt("100").toFixed(precision)
: progress.toFixed(precision)}%
</div>
{:else}
<div

View File

@@ -1,11 +1,11 @@
<script lang="ts">
import { Button, Checkbox } from "flowbite-svelte";
import { Button } from "flowbite-svelte";
import Progressbar from "../lib/Progressbar.svelte";
import {
launching,
patch,
launchStatus,
launchPercentage,
launchPercentage
} from "./../storage/localStore";
let progressbarFix = true;

View File

@@ -1,7 +1,6 @@
<script lang="ts">
import { Input, Button, Spinner, Checkbox } from "flowbite-svelte";
import type { User } from "../types/user";
import type { Error } from "../types/error";
import { type User } from "../types/user";
import { currentPage, currentUser, startup } from "../storage/localStore";
import toast from "svelte-french-toast";
import { Page } from "../consts/pages";
@@ -43,14 +42,14 @@
position: "bottom-center",
className:
"dark:!bg-gray-800 border-1 dark:!border-gray-700 dark:!text-gray-100",
duration: 3000,
duration: 3000
});
},
{ once: true }
);
window.dispatchEvent(
new CustomEvent("login-attempt", {
detail: { username, password, saveCredentials },
detail: { username, password, saveCredentials }
})
);
});
@@ -59,13 +58,13 @@
{
loading: "Logging in...",
success: "Successfully logged in!",
error: "Invalid Username or Password!",
error: "Invalid Username or Password!"
},
{
position: "bottom-center",
className:
"dark:!bg-gray-800 border-1 dark:!border-gray-700 dark:!text-gray-100",
duration: 3000,
duration: 3000
}
);
};
@@ -87,7 +86,7 @@
position: "bottom-center",
className:
"dark:!bg-gray-800 border-1 dark:!border-gray-700 dark:!text-gray-100",
duration: 3000,
duration: 3000
});
return;
}
@@ -104,7 +103,7 @@
position: "bottom-center",
className:
"dark:!bg-gray-800 border-1 dark:!border-gray-700 dark:!text-gray-100",
duration: 3000,
duration: 3000
});
loading = false;
},
@@ -117,13 +116,13 @@
{
loading: "Logging in...",
success: "Successfully logged in!",
error: "Failed to login.",
error: "Failed to login."
},
{
position: "bottom-center",
className:
"dark:!bg-gray-800 border-1 dark:!border-gray-700 dark:!text-gray-100",
duration: 3000,
duration: 3000
}
);
};
@@ -135,7 +134,7 @@
position: "bottom-center",
className:
"dark:!bg-gray-800 border-1 dark:!border-gray-700 dark:!text-gray-100",
duration: 3000,
duration: 3000
});
};