[Update] Config Page: Add Device tab. add mic host list.(not selectable yet.)
This commit is contained in:
@@ -1,22 +1,34 @@
|
||||
import {
|
||||
useSoftwareVersion,
|
||||
useMicHostList,
|
||||
useSelectedMicHost,
|
||||
} from "@store";
|
||||
|
||||
import { useStdoutToPython } from "./useStdoutToPython";
|
||||
|
||||
export const useConfig = () => {
|
||||
const {
|
||||
updateSoftwareVersion,
|
||||
} = useSoftwareVersion();
|
||||
import { arrayToObject } from "@utils/arrayToObject";
|
||||
|
||||
export const useConfig = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
const { updateSoftwareVersion } = useSoftwareVersion();
|
||||
const { updateMicHostList } = useMicHostList();
|
||||
const { updateSelectedMicHost } = useSelectedMicHost();
|
||||
|
||||
|
||||
return {
|
||||
getSoftwareVersion: () => {
|
||||
asyncStdoutToPython("/config/version");
|
||||
getSoftwareVersion: () => asyncStdoutToPython("/config/version"),
|
||||
updateSoftwareVersion: (payload) => updateSoftwareVersion(payload.data),
|
||||
|
||||
getMicHostList: () => asyncStdoutToPython("/controller/list_mic_host"),
|
||||
updateMicHostList: (payload) => {
|
||||
updateMicHostList(arrayToObject(payload.data));
|
||||
},
|
||||
updateSoftwareVersion: (payload) => {
|
||||
updateSoftwareVersion(payload.data);
|
||||
getSelectedMicHost: () => asyncStdoutToPython("/config/choice_mic_host"),
|
||||
updateSelectedMicHost: (payload) => {
|
||||
updateSelectedMicHost(payload.data);
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user