[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);
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
@@ -17,6 +17,8 @@ export const useReceiveRoutes = () => {
|
||||
|
||||
const {
|
||||
updateSoftwareVersion,
|
||||
updateMicHostList,
|
||||
updateSelectedMicHost,
|
||||
} = useConfig();
|
||||
|
||||
const routes = {
|
||||
@@ -28,6 +30,9 @@ export const useReceiveRoutes = () => {
|
||||
"/controller/callback_disable_transcription_receive": updateTranscriptionReceiveStatus,
|
||||
|
||||
"/config/version": updateSoftwareVersion,
|
||||
"/controller/list_mic_host": updateMicHostList,
|
||||
"/config/choice_mic_host": updateSelectedMicHost,
|
||||
|
||||
|
||||
"/controller/callback_messagebox_send": updateSentMessageLog,
|
||||
"/action/transcription_send_mic_message": addSentMessageLog,
|
||||
|
||||
Reference in New Issue
Block a user