Config Page: Device Tab. threshold component. fix problem that the input component focused out when input something each time. Set threshold data when started python.
14 lines
577 B
JavaScript
14 lines
577 B
JavaScript
import { useSoftwareVersion as useStoreSoftwareVersion } from "@store";
|
|
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
|
|
|
export const useSoftwareVersion = () => {
|
|
const { asyncStdoutToPython } = useStdoutToPython();
|
|
const { currentSoftwareVersion, updateSoftwareVersion } = useStoreSoftwareVersion();
|
|
|
|
const getSoftwareVersion = () => {
|
|
updateSoftwareVersion(() => new Promise(() => {}));
|
|
asyncStdoutToPython("/config/version");
|
|
};
|
|
|
|
return { currentSoftwareVersion, getSoftwareVersion, updateSoftwareVersion };
|
|
}; |