[Update] Config Page: Add Translation Tab. DeeplAuthKey section.
Allow null value to Entry component's input element.
This commit is contained in:
@@ -31,6 +31,8 @@ export { useSpeakerRecordTimeout } from "./transcription/useSpeakerRecordTimeout
|
||||
export { useSpeakerPhraseTimeout } from "./transcription/useSpeakerPhraseTimeout";
|
||||
export { useSpeakerMaxWords } from "./transcription/useSpeakerMaxWords";
|
||||
|
||||
export { useDeepLAuthKey } from "./translation/useDeepLAuthKey";
|
||||
|
||||
export { useIsEnabledOverlaySmallLog } from "./vr/useIsEnabledOverlaySmallLog";
|
||||
export { useOverlaySettings } from "./vr/useOverlaySettings";
|
||||
export { useOverlaySmallLogSettings } from "./vr/useOverlaySmallLogSettings";
|
||||
|
||||
30
src-ui/logics/configs/translation/useDeepLAuthKey.js
Normal file
30
src-ui/logics/configs/translation/useDeepLAuthKey.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import { useStore_DeepLAuthKey } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useDeepLAuthKey = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentDeepLAuthKey, updateDeepLAuthKey, pendingDeepLAuthKey } = useStore_DeepLAuthKey();
|
||||
|
||||
const getDeepLAuthKey = () => {
|
||||
pendingDeepLAuthKey();
|
||||
asyncStdoutToPython("/get/data/deepl_auth_key");
|
||||
};
|
||||
|
||||
const setDeepLAuthKey = (selected_deepl_auth_key) => {
|
||||
pendingDeepLAuthKey();
|
||||
asyncStdoutToPython("/set/data/deepl_auth_key", selected_deepl_auth_key);
|
||||
};
|
||||
|
||||
const deleteDeepLAuthKey = () => {
|
||||
pendingDeepLAuthKey();
|
||||
asyncStdoutToPython("/delete/data/deepl_auth_key");
|
||||
};
|
||||
|
||||
return {
|
||||
currentDeepLAuthKey,
|
||||
getDeepLAuthKey,
|
||||
updateDeepLAuthKey,
|
||||
setDeepLAuthKey,
|
||||
deleteDeepLAuthKey,
|
||||
};
|
||||
};
|
||||
@@ -45,6 +45,7 @@ import {
|
||||
useSpeakerRecordTimeout,
|
||||
useSpeakerPhraseTimeout,
|
||||
useSpeakerMaxWords,
|
||||
useDeepLAuthKey,
|
||||
useOverlaySettings,
|
||||
useIsEnabledOverlaySmallLog,
|
||||
useOverlaySmallLogSettings,
|
||||
@@ -116,6 +117,8 @@ export const useReceiveRoutes = () => {
|
||||
const { updateSpeakerPhraseTimeout } = useSpeakerPhraseTimeout();
|
||||
const { updateSpeakerMaxWords } = useSpeakerMaxWords();
|
||||
|
||||
const { updateDeepLAuthKey } = useDeepLAuthKey();
|
||||
|
||||
const { updateOverlaySettings } = useOverlaySettings();
|
||||
const { updateOverlaySmallLogSettings } = useOverlaySmallLogSettings();
|
||||
const { updateIsEnabledOverlaySmallLog } = useIsEnabledOverlaySmallLog();
|
||||
@@ -270,6 +273,11 @@ export const useReceiveRoutes = () => {
|
||||
"/get/data/transparency": updateTransparency,
|
||||
"/set/data/transparency": updateTransparency,
|
||||
|
||||
// Translation
|
||||
"/get/data/deepl_auth_key": updateDeepLAuthKey,
|
||||
"/set/data/deepl_auth_key": updateDeepLAuthKey,
|
||||
"/delete/data/deepl_auth_key": () => updateDeepLAuthKey(""),
|
||||
|
||||
// Transcription
|
||||
"/get/data/mic_record_timeout": updateMicRecordTimeout,
|
||||
"/set/data/mic_record_timeout": updateMicRecordTimeout,
|
||||
@@ -366,6 +374,8 @@ export const useReceiveRoutes = () => {
|
||||
"/set/data/speaker_record_timeout": updateSpeakerRecordTimeout,
|
||||
"/set/data/speaker_phrase_timeout": updateSpeakerPhraseTimeout,
|
||||
"/set/data/speaker_max_phrases": updateSpeakerMaxWords,
|
||||
|
||||
"/set/data/deepl_auth_key": updateDeepLAuthKey,
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user