[Update] Config Page: Add Advanced Settings Tab.

This commit is contained in:
Sakamoto Shiina
2024-10-17 01:58:49 +09:00
parent 2f6a9d4f2b
commit ec64b64535
10 changed files with 204 additions and 2 deletions

View File

@@ -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,
};
};

View 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,
};
};

View 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,
};
};

View File

@@ -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";

View File

@@ -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 = {