mirror of
https://github.com/upscayl/upscayl.git
synced 2025-02-07 15:01:24 +01:00
Refactor device specs retrieval and enhance logging; improve model selection rendering
This commit is contained in:
parent
e627bc4321
commit
514cc5e3c7
@ -52,7 +52,7 @@ export const getDeviceSpecs = async () => {
|
||||
gpuInfo = null;
|
||||
}
|
||||
|
||||
return {
|
||||
const deviceSpecs = {
|
||||
platform: getPlatform(),
|
||||
release: os.release(),
|
||||
arch: getArch(),
|
||||
@ -60,4 +60,6 @@ export const getDeviceSpecs = async () => {
|
||||
cpuCount: os.cpus().length,
|
||||
...(gpuInfo && { gpu: gpuInfo.gpuDevice[0] }),
|
||||
};
|
||||
|
||||
return deviceSpecs;
|
||||
};
|
||||
|
@ -6,9 +6,9 @@ const logit = (...args: any) => {
|
||||
const mainWindow = getMainWindow();
|
||||
if (!mainWindow) return;
|
||||
log.log(...args);
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
return;
|
||||
}
|
||||
// if (process.env.NODE_ENV === "development") {
|
||||
// return;
|
||||
// }
|
||||
mainWindow.webContents.send(ELECTRON_COMMANDS.LOG, args.join(" "));
|
||||
};
|
||||
|
||||
|
@ -48,9 +48,11 @@ const SelectModelDialog = () => {
|
||||
<DialogTrigger asChild>
|
||||
<button className="btn btn-primary justify-start border-border">
|
||||
<SwatchBookIcon className="mr-2 h-5 w-5" />
|
||||
{t(
|
||||
`APP.MODEL_SELECTION.MODELS.${MODELS[selectedModelId].id || selectedModelId}.NAME` as any,
|
||||
) || selectedModelId}
|
||||
{selectedModelId in MODELS
|
||||
? t(
|
||||
`APP.MODEL_SELECTION.MODELS.${MODELS[selectedModelId]?.id}.NAME` as any,
|
||||
)
|
||||
: selectedModelId}
|
||||
</button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="z-50 sm:max-w-lg">
|
||||
|
@ -22,11 +22,13 @@ import { FEATURE_FLAGS } from "@common/feature-flags";
|
||||
import { ImageFormat, VALID_IMAGE_FORMATS } from "@/lib/valid-formats";
|
||||
import { initCustomModels } from "@/components/hooks/use-custom-models";
|
||||
import { OnboardingDialog } from "@/components/main-content/onboarding-dialog";
|
||||
import useSystemInfo from "@/components/hooks/use-system-info";
|
||||
|
||||
const Home = () => {
|
||||
const t = useAtomValue(translationAtom);
|
||||
const logit = useLogger();
|
||||
const { toast } = useToast();
|
||||
const { systemInfo } = useSystemInfo();
|
||||
|
||||
initCustomModels();
|
||||
|
||||
@ -290,6 +292,11 @@ const Home = () => {
|
||||
setIsLoading(false);
|
||||
}, []);
|
||||
|
||||
// SYSTEM INFO
|
||||
useEffect(() => {
|
||||
if (systemInfo) logit("💻 System Info:", JSON.stringify(systemInfo));
|
||||
}, [systemInfo]);
|
||||
|
||||
// HANDLERS
|
||||
const resetImagePaths = () => {
|
||||
logit("🔄 Resetting image paths");
|
||||
|
Loading…
x
Reference in New Issue
Block a user