mirror of
https://github.com/upscayl/upscayl.git
synced 2025-02-17 11:18:36 +01:00
added some logging
This commit is contained in:
parent
be1eb62a91
commit
1cd1d26441
@ -4,6 +4,7 @@ import commands from "../../electron/commands";
|
|||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { customModelsPathAtom, scaleAtom } from "../atoms/userSettingsAtom";
|
import { customModelsPathAtom, scaleAtom } from "../atoms/userSettingsAtom";
|
||||||
import { modelsListAtom } from "../atoms/modelsListAtom";
|
import { modelsListAtom } from "../atoms/modelsListAtom";
|
||||||
|
import useLog from "./hooks/useLog";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
batchMode: boolean;
|
batchMode: boolean;
|
||||||
@ -42,6 +43,8 @@ function SettingsTab({
|
|||||||
|
|
||||||
const [rememberOutputFolder, setRememberOutputFolder] = useState(false);
|
const [rememberOutputFolder, setRememberOutputFolder] = useState(false);
|
||||||
|
|
||||||
|
const { logit } = useLog();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
themeChange(false);
|
themeChange(false);
|
||||||
|
|
||||||
@ -99,6 +102,7 @@ function SettingsTab({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleGpuIdChange = (e) => {
|
const handleGpuIdChange = (e) => {
|
||||||
|
logit("New GPU ID: ", e.target.value);
|
||||||
setGpuId(e.target.value);
|
setGpuId(e.target.value);
|
||||||
localStorage.setItem("gpuId", e.target.value);
|
localStorage.setItem("gpuId", e.target.value);
|
||||||
};
|
};
|
||||||
|
@ -62,8 +62,11 @@ const Home = () => {
|
|||||||
setLoaded(true);
|
setLoaded(true);
|
||||||
|
|
||||||
setVersion(navigator?.userAgent?.match(/Upscayl\/([\d\.]+\d+)/)[1]);
|
setVersion(navigator?.userAgent?.match(/Upscayl\/([\d\.]+\d+)/)[1]);
|
||||||
|
logit(`version: ${version}`);
|
||||||
|
|
||||||
const handleErrors = (data: string) => {
|
const handleErrors = (data: string) => {
|
||||||
|
logit(`Error: ${data}`);
|
||||||
|
|
||||||
if (data.includes("invalid gpu")) {
|
if (data.includes("invalid gpu")) {
|
||||||
alert(
|
alert(
|
||||||
"Error. Please make sure you have a Vulkan compatible GPU (Most modern GPUs support Vulkan). Upscayl does not work with CPU or iGPU sadly."
|
"Error. Please make sure you have a Vulkan compatible GPU (Most modern GPUs support Vulkan). Upscayl does not work with CPU or iGPU sadly."
|
||||||
@ -142,6 +145,7 @@ const Home = () => {
|
|||||||
window.electron.on(commands.FOLDER_UPSCAYL_DONE, (_, data: string) => {
|
window.electron.on(commands.FOLDER_UPSCAYL_DONE, (_, data: string) => {
|
||||||
setProgress("");
|
setProgress("");
|
||||||
setUpscaledBatchFolderPath(data);
|
setUpscaledBatchFolderPath(data);
|
||||||
|
logit("upscaledBatchFolderPath: ", upscaledBatchFolderPath);
|
||||||
logit(data);
|
logit(data);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -150,6 +154,7 @@ const Home = () => {
|
|||||||
setProgress("");
|
setProgress("");
|
||||||
setDoubleUpscaylCounter(0);
|
setDoubleUpscaylCounter(0);
|
||||||
setUpscaledImagePath(data);
|
setUpscaledImagePath(data);
|
||||||
|
logit("upscaledImagePath: ", upscaledImagePath);
|
||||||
logit(data);
|
logit(data);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -157,6 +162,7 @@ const Home = () => {
|
|||||||
window.electron.on(commands.UPSCAYL_VIDEO_DONE, (_, data: string) => {
|
window.electron.on(commands.UPSCAYL_VIDEO_DONE, (_, data: string) => {
|
||||||
setProgress("");
|
setProgress("");
|
||||||
setUpscaledVideoPath(data);
|
setUpscaledVideoPath(data);
|
||||||
|
logit("upscaledVideoPath: ", upscaledVideoPath);
|
||||||
logit(data);
|
logit(data);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -197,6 +203,9 @@ const Home = () => {
|
|||||||
const rememberOutputFolder = localStorage.getItem("rememberOutputFolder");
|
const rememberOutputFolder = localStorage.getItem("rememberOutputFolder");
|
||||||
const lastOutputFolderPath = localStorage.getItem("lastOutputFolderPath");
|
const lastOutputFolderPath = localStorage.getItem("lastOutputFolderPath");
|
||||||
|
|
||||||
|
logit("localStorage (rememberOutputFolder): ", rememberOutputFolder);
|
||||||
|
logit("localStorage (lastOutputFolderPath): ", lastOutputFolderPath);
|
||||||
|
|
||||||
if (rememberOutputFolder === "true") {
|
if (rememberOutputFolder === "true") {
|
||||||
setOutputPath(lastOutputFolderPath);
|
setOutputPath(lastOutputFolderPath);
|
||||||
} else {
|
} else {
|
||||||
@ -217,11 +226,20 @@ const Home = () => {
|
|||||||
filePath
|
filePath
|
||||||
);
|
);
|
||||||
|
|
||||||
|
logit(
|
||||||
|
"filePath: ",
|
||||||
|
filePath
|
||||||
|
);
|
||||||
|
|
||||||
const extension = imagePath.toLocaleLowerCase().split(".").pop();
|
const extension = imagePath.toLocaleLowerCase().split(".").pop();
|
||||||
console.log(
|
console.log(
|
||||||
"🚀 => file: index.jsx => line 111 => useEffect => extension",
|
"🚀 => file: index.jsx => line 111 => useEffect => extension",
|
||||||
extension
|
extension
|
||||||
);
|
);
|
||||||
|
logit(
|
||||||
|
"extension: ",
|
||||||
|
extension
|
||||||
|
);
|
||||||
|
|
||||||
if (!allowedFileTypes.includes(extension.toLowerCase())) {
|
if (!allowedFileTypes.includes(extension.toLowerCase())) {
|
||||||
alert("Please select an image");
|
alert("Please select an image");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user