[Update] Config Page: Add Advanced Settings Tab.
This commit is contained in:
@@ -6,7 +6,12 @@ export const useOpenFolder = () => {
|
||||
asyncStdoutToPython("/run/open_filepath_logs");
|
||||
};
|
||||
|
||||
const openFolder_ConfigFile = () => {
|
||||
asyncStdoutToPython("/run/open_filepath_config_file");
|
||||
};
|
||||
|
||||
return {
|
||||
openFolder_MessageLogs,
|
||||
openFolder_ConfigFile,
|
||||
};
|
||||
};
|
||||
24
src-ui/logics/configs/advanced_settings/useOscIpAddress.js
Normal file
24
src-ui/logics/configs/advanced_settings/useOscIpAddress.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { useStore_OscIpAddress } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useOscIpAddress = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentOscIpAddress, updateOscIpAddress, pendingOscIpAddress } = useStore_OscIpAddress();
|
||||
|
||||
const getOscIpAddress = () => {
|
||||
pendingOscIpAddress();
|
||||
asyncStdoutToPython("/get/data/osc_ip_address");
|
||||
};
|
||||
|
||||
const setOscIpAddress = (osc_ip_address) => {
|
||||
pendingOscIpAddress();
|
||||
asyncStdoutToPython("/set/data/osc_ip_address", osc_ip_address);
|
||||
};
|
||||
|
||||
return {
|
||||
currentOscIpAddress,
|
||||
getOscIpAddress,
|
||||
updateOscIpAddress,
|
||||
setOscIpAddress,
|
||||
};
|
||||
};
|
||||
24
src-ui/logics/configs/advanced_settings/useOscPort.js
Normal file
24
src-ui/logics/configs/advanced_settings/useOscPort.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { useStore_OscPort } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useOscPort = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentOscPort, updateOscPort, pendingOscPort } = useStore_OscPort();
|
||||
|
||||
const getOscPort = () => {
|
||||
pendingOscPort();
|
||||
asyncStdoutToPython("/get/data/osc_port");
|
||||
};
|
||||
|
||||
const setOscPort = (osc_port) => {
|
||||
pendingOscPort();
|
||||
asyncStdoutToPython("/set/data/osc_port", osc_port);
|
||||
};
|
||||
|
||||
return {
|
||||
currentOscPort,
|
||||
getOscPort,
|
||||
updateOscPort,
|
||||
setOscPort,
|
||||
};
|
||||
};
|
||||
@@ -31,4 +31,7 @@ export { useSpeakerRecordTimeout } from "./transcription/useSpeakerRecordTimeout
|
||||
export { useSpeakerPhraseTimeout } from "./transcription/useSpeakerPhraseTimeout";
|
||||
export { useSpeakerMaxWords } from "./transcription/useSpeakerMaxWords";
|
||||
|
||||
export { useOscIpAddress } from "./advanced_settings/useOscIpAddress";
|
||||
export { useOscPort } from "./advanced_settings/useOscPort";
|
||||
|
||||
export { useSoftwareVersion } from "./useSoftwareVersion";
|
||||
@@ -45,6 +45,8 @@ import {
|
||||
useSpeakerRecordTimeout,
|
||||
useSpeakerPhraseTimeout,
|
||||
useSpeakerMaxWords,
|
||||
useOscIpAddress,
|
||||
useOscPort,
|
||||
} from "@logics_configs";
|
||||
|
||||
export const useReceiveRoutes = () => {
|
||||
@@ -111,13 +113,16 @@ export const useReceiveRoutes = () => {
|
||||
const { updateSpeakerPhraseTimeout } = useSpeakerPhraseTimeout();
|
||||
const { updateSpeakerMaxWords } = useSpeakerMaxWords();
|
||||
|
||||
const { updateOscIpAddress } = useOscIpAddress();
|
||||
const { updateOscPort } = useOscPort();
|
||||
|
||||
const routes = {
|
||||
// Common
|
||||
"/run/feed_watchdog": () => {},
|
||||
"/get/data/main_window_geometry": restoreWindowGeometry,
|
||||
"/set/data/main_window_geometry": () => {},
|
||||
"/run/open_filepath_logs": () => {console.log("Opened Directory, Message Logs");
|
||||
},
|
||||
"/run/open_filepath_logs": () => console.log("Opened Directory, Message Logs"),
|
||||
"/run/open_filepath_config_file": () => console.log("Opened Directory, Config File"),
|
||||
|
||||
// Main Page
|
||||
// Page Controls
|
||||
@@ -326,6 +331,13 @@ export const useReceiveRoutes = () => {
|
||||
"/get/data/send_message_to_vrc": updateEnableSendMessageToVrc,
|
||||
"/set/enable/send_message_to_vrc": updateEnableSendMessageToVrc,
|
||||
"/set/disable/send_message_to_vrc": updateEnableSendMessageToVrc,
|
||||
|
||||
// Advanced Settings
|
||||
"/get/data/osc_ip_address": updateOscIpAddress,
|
||||
"/set/data/osc_ip_address": updateOscIpAddress,
|
||||
|
||||
"/get/data/osc_port": updateOscPort,
|
||||
"/set/data/osc_port": updateOscPort,
|
||||
};
|
||||
|
||||
const error_routes = {
|
||||
|
||||
Reference in New Issue
Block a user