From 0eec985a6288512f349774be866d507728093710 Mon Sep 17 00:00:00 2001
From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com>
Date: Thu, 19 Dec 2024 15:38:09 +0900
Subject: [PATCH 1/2] [bugfix/Refactor] Checkbox Component. Fix to disabled
when it's loading(it was clickable continuously)
---
.../_components/checkbox/Checkbox.jsx | 24 --------
.../_components/checkbox/Checkbox.module.scss | 60 -------------------
.../setting_box/_components/index.js | 1 -
.../setting_box/_templates/Templates.jsx | 2 +-
.../setting_box/others/Others.jsx | 2 +-
.../common_components/checkbox/Checkbox.jsx | 11 ++--
.../checkbox/Checkbox.module.scss | 6 ++
7 files changed, 15 insertions(+), 91 deletions(-)
delete mode 100644 src-ui/app/config_page/setting_section/setting_box/_components/checkbox/Checkbox.jsx
delete mode 100644 src-ui/app/config_page/setting_section/setting_box/_components/checkbox/Checkbox.module.scss
diff --git a/src-ui/app/config_page/setting_section/setting_box/_components/checkbox/Checkbox.jsx b/src-ui/app/config_page/setting_section/setting_box/_components/checkbox/Checkbox.jsx
deleted file mode 100644
index 752597f5..00000000
--- a/src-ui/app/config_page/setting_section/setting_box/_components/checkbox/Checkbox.jsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import styles from "./Checkbox.module.scss";
-
-export const Checkbox = (props) => {
- return (
-
diff --git a/src-ui/app/config_page/setting_section/setting_box/others/Others.jsx b/src-ui/app/config_page/setting_section/setting_box/others/Others.jsx
index ed3e88fd..f1e9a251 100644
--- a/src-ui/app/config_page/setting_section/setting_box/others/Others.jsx
+++ b/src-ui/app/config_page/setting_section/setting_box/others/Others.jsx
@@ -17,10 +17,10 @@ import {
import {
LabelComponent,
- Checkbox,
ActionButton,
SectionLabelComponent,
} from "../_components/";
+import { Checkbox } from "@common_components";
import OpenFolderSvg from "@images/open_folder.svg?react";
diff --git a/src-ui/common_components/checkbox/Checkbox.jsx b/src-ui/common_components/checkbox/Checkbox.jsx
index ac291f65..b9cdd7d3 100644
--- a/src-ui/common_components/checkbox/Checkbox.jsx
+++ b/src-ui/common_components/checkbox/Checkbox.jsx
@@ -1,20 +1,23 @@
+import { clsx } from "clsx";
import styles from "./Checkbox.module.scss";
-
export const Checkbox = ({
checkboxId,
variable,
toggleFunction,
- state = "idle",
size = "2.8rem",
color = "var(--primary_600_color)",
borderWidth = "0.2rem",
padding = "2rem",
}) => {
+ const wrapper_class_names = clsx(styles.checkbox_wrapper, {
+ [styles.is_disabled]: variable.state === "pending",
+ });
+
return (
-
{t("main_page.confirmation_message.updating")}
+
{t("main_page.updating")}
);
};
\ No newline at end of file
diff --git a/src-ui/logics/common/useUpdateSoftware.js b/src-ui/logics/common/useUpdateSoftware.js
index c033b878..f3d2f1cf 100644
--- a/src-ui/logics/common/useUpdateSoftware.js
+++ b/src-ui/logics/common/useUpdateSoftware.js
@@ -6,7 +6,12 @@ export const useUpdateSoftware = () => {
asyncStdoutToPython("/run/update_software");
};
+ const updateSoftware_CUDA = () => {
+ asyncStdoutToPython("/run/update_cuda_software");
+ };
+
return {
updateSoftware,
+ updateSoftware_CUDA,
};
};
\ No newline at end of file