Merge branch 'develop' into plugins_system
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import styles from "./WordFilter.module.scss";
|
||||
import { _Entry } from "../_atoms/_entry/_Entry";
|
||||
import { useState } from "react";
|
||||
@@ -5,6 +6,8 @@ import { useStore_IsOpenedMicWordFilterList } from "@store";
|
||||
import { useMicWordFilterList } from "@logics_configs";
|
||||
|
||||
export const WordFilter = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [input_value, setInputValue] = useState("");
|
||||
const { currentMicWordFilterList, updateMicWordFilterList, setMicWordFilterList } = useMicWordFilterList();
|
||||
const { currentIsOpenedMicWordFilterList, updateIsOpenedMicWordFilterList } = useStore_IsOpenedMicWordFilterList();
|
||||
@@ -82,7 +85,7 @@ export const WordFilter = () => {
|
||||
}
|
||||
<div className={styles.entry_section_wrapper}>
|
||||
<_Entry width="30rem" onChange={onChangeEntry} ui_variable={input_value}/>
|
||||
<button className={styles.add_button} onClick={addWords}>Add</button>
|
||||
<button className={styles.add_button} onClick={addWords}>{t("config_page.transcription.mic_word_filter.add_button_label")}</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -121,8 +124,6 @@ const WordFilterItem = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import ArrowLeftSvg from "@images/arrow_left.svg?react";
|
||||
export const WordFilterListToggleComponent = (props) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -82,7 +82,7 @@ const Mic_Container = () => {
|
||||
<div className={styles.device_contents}>
|
||||
|
||||
<div className={styles.device_auto_select_wrapper}>
|
||||
<p className={styles.device_secondary_label}>{t("config_page.device.mic_host_device.label_auto_select")}</p>
|
||||
<p className={styles.device_secondary_label}>{t("config_page.device.label_auto_select")}</p>
|
||||
<SwitchBox
|
||||
variable={currentEnableAutoMicSelect}
|
||||
toggleFunction={toggleEnableAutoMicSelect}
|
||||
@@ -91,7 +91,7 @@ const Mic_Container = () => {
|
||||
|
||||
<div className={styles.device_dropdown_wrapper}>
|
||||
<div className={styles.device_dropdown}>
|
||||
<p className={styles.device_secondary_label}>{t("config_page.device.mic_host_device.label_host")}</p>
|
||||
<p className={styles.device_secondary_label}>{t("config_page.device.label_host")}</p>
|
||||
<DropdownMenu
|
||||
dropdown_id="mic_host"
|
||||
selected_id={currentSelectedMicHost.data}
|
||||
@@ -104,7 +104,7 @@ const Mic_Container = () => {
|
||||
</div>
|
||||
|
||||
<div className={styles.device_dropdown}>
|
||||
<p className={styles.device_secondary_label}>{t("config_page.device.mic_host_device.label_device")}</p>
|
||||
<p className={styles.device_secondary_label}>{t("config_page.device.label_device")}</p>
|
||||
<DropdownMenu
|
||||
dropdown_id="mic_device"
|
||||
selected_id={currentSelectedMicDevice.data}
|
||||
@@ -178,7 +178,7 @@ const Speaker_Container = () => {
|
||||
<div className={styles.device_contents}>
|
||||
|
||||
<div className={styles.device_auto_select_wrapper}>
|
||||
<p className={styles.device_secondary_label}>{t("config_page.device.speaker_device.label_auto_select")}</p>
|
||||
<p className={styles.device_secondary_label}>{t("config_page.device.label_auto_select")}</p>
|
||||
<SwitchBox
|
||||
variable={currentEnableAutoSpeakerSelect}
|
||||
toggleFunction={toggleEnableAutoSpeakerSelect}
|
||||
@@ -186,7 +186,7 @@ const Speaker_Container = () => {
|
||||
</div>
|
||||
|
||||
<div className={styles.device_dropdown}>
|
||||
<p className={styles.device_secondary_label}>{t("config_page.device.mic_host_device.label_device")}</p>
|
||||
<p className={styles.device_secondary_label}>{t("config_page.device.label_device")}</p>
|
||||
<DropdownMenu
|
||||
dropdown_id="speaker_device"
|
||||
label={t("config_page.device.speaker_device.label")}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import styles from "./Transcription.module.scss";
|
||||
import { updateLabelsById } from "@utils";
|
||||
import { updateLabelsById, genNumObjArray } from "@utils";
|
||||
|
||||
import {
|
||||
useMicRecordTimeout,
|
||||
@@ -21,7 +20,6 @@ import {
|
||||
} from "@logics_configs";
|
||||
|
||||
import {
|
||||
EntryContainer,
|
||||
WordFilterContainer,
|
||||
DownloadModelsContainer,
|
||||
RadioButtonContainer,
|
||||
@@ -59,82 +57,61 @@ const Mic_Container = () => {
|
||||
|
||||
const MicRecordTimeout_Box = () => {
|
||||
const { t } = useTranslation();
|
||||
const [ui_variable, setUiVariable] = useState("");
|
||||
const { currentMicRecordTimeout, setMicRecordTimeout } = useMicRecordTimeout();
|
||||
const onChangeFunction = (e) => {
|
||||
const value = e.currentTarget.value;
|
||||
if (value === "") {
|
||||
setUiVariable("");
|
||||
} else {
|
||||
setUiVariable(value);
|
||||
setMicRecordTimeout(value);
|
||||
}
|
||||
|
||||
const selectFunction = (selected_data) => {
|
||||
setMicRecordTimeout(selected_data.selected_id);
|
||||
};
|
||||
|
||||
useEffect(()=> {
|
||||
setUiVariable(currentMicRecordTimeout.data);
|
||||
}, [currentMicRecordTimeout]);
|
||||
|
||||
return (
|
||||
<EntryContainer
|
||||
<DropdownMenuContainer
|
||||
dropdown_id="mic_record_timeout"
|
||||
label={t("config_page.transcription.mic_record_timeout.label")}
|
||||
desc={t("config_page.transcription.mic_record_timeout.desc")}
|
||||
ui_variable={ui_variable}
|
||||
onChange={onChangeFunction}
|
||||
selected_id={currentMicRecordTimeout.data}
|
||||
list={genNumObjArray(31)}
|
||||
selectFunction={selectFunction}
|
||||
state={currentMicRecordTimeout.state}
|
||||
/>
|
||||
);
|
||||
};
|
||||
const MicPhraseTimeout_Box = () => {
|
||||
const { t } = useTranslation();
|
||||
const [ui_variable, setUiVariable] = useState("");
|
||||
const { currentMicPhraseTimeout, setMicPhraseTimeout } = useMicPhraseTimeout();
|
||||
const onChangeFunction = (e) => {
|
||||
const value = e.currentTarget.value;
|
||||
if (value === "") {
|
||||
setUiVariable("");
|
||||
} else {
|
||||
setUiVariable(value);
|
||||
setMicPhraseTimeout(value);
|
||||
}
|
||||
|
||||
const selectFunction = (selected_data) => {
|
||||
setMicPhraseTimeout(selected_data.selected_id);
|
||||
};
|
||||
|
||||
useEffect(()=> {
|
||||
setUiVariable(currentMicPhraseTimeout.data);
|
||||
}, [currentMicPhraseTimeout]);
|
||||
|
||||
return (
|
||||
<EntryContainer
|
||||
<DropdownMenuContainer
|
||||
dropdown_id="mic_phrase_timeout"
|
||||
label={t("config_page.transcription.mic_phrase_timeout.label")}
|
||||
desc={t("config_page.transcription.mic_phrase_timeout.desc")}
|
||||
ui_variable={ui_variable}
|
||||
onChange={onChangeFunction}
|
||||
selected_id={currentMicPhraseTimeout.data}
|
||||
list={genNumObjArray(31)}
|
||||
selectFunction={selectFunction}
|
||||
state={currentMicPhraseTimeout.state}
|
||||
/>
|
||||
);
|
||||
};
|
||||
const MicMaxWords_Box = () => {
|
||||
const { t } = useTranslation();
|
||||
const [ui_variable, setUiVariable] = useState("");
|
||||
const { currentMicMaxWords, setMicMaxWords } = useMicMaxWords();
|
||||
const onChangeFunction = (e) => {
|
||||
const value = e.currentTarget.value;
|
||||
if (value === "") {
|
||||
setUiVariable("");
|
||||
} else {
|
||||
setUiVariable(value);
|
||||
setMicMaxWords(value);
|
||||
}
|
||||
|
||||
const selectFunction = (selected_data) => {
|
||||
setMicMaxWords(selected_data.selected_id);
|
||||
};
|
||||
|
||||
useEffect(()=> {
|
||||
setUiVariable(currentMicMaxWords.data);
|
||||
}, [currentMicMaxWords]);
|
||||
|
||||
return (
|
||||
<EntryContainer
|
||||
<DropdownMenuContainer
|
||||
dropdown_id="mic_max_phrase"
|
||||
label={t("config_page.transcription.mic_max_phrase.label")}
|
||||
desc={t("config_page.transcription.mic_max_phrase.desc")}
|
||||
ui_variable={ui_variable}
|
||||
onChange={onChangeFunction}
|
||||
selected_id={currentMicMaxWords.data}
|
||||
list={genNumObjArray(31)}
|
||||
selectFunction={selectFunction}
|
||||
state={currentMicMaxWords.state}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -167,82 +144,60 @@ const Speaker_Container = () => {
|
||||
|
||||
const SpeakerRecordTimeout_Box = () => {
|
||||
const { t } = useTranslation();
|
||||
const [ui_variable, setUiVariable] = useState("");
|
||||
const { currentSpeakerRecordTimeout, setSpeakerRecordTimeout } = useSpeakerRecordTimeout();
|
||||
const onChangeFunction = (e) => {
|
||||
const value = e.currentTarget.value;
|
||||
if (value === "") {
|
||||
setUiVariable("");
|
||||
} else {
|
||||
setUiVariable(value);
|
||||
setSpeakerRecordTimeout(value);
|
||||
}
|
||||
|
||||
const selectFunction = (selected_data) => {
|
||||
setSpeakerRecordTimeout(selected_data.selected_id);
|
||||
};
|
||||
|
||||
useEffect(()=> {
|
||||
setUiVariable(currentSpeakerRecordTimeout.data);
|
||||
}, [currentSpeakerRecordTimeout]);
|
||||
|
||||
return (
|
||||
<EntryContainer
|
||||
label={t("config_page.transcription.speaker_record_timeout.label")}
|
||||
<DropdownMenuContainer
|
||||
dropdown_id="speaker_record_timeout"
|
||||
desc={t("config_page.transcription.speaker_record_timeout.desc")}
|
||||
ui_variable={ui_variable}
|
||||
onChange={onChangeFunction}
|
||||
label={t("config_page.transcription.speaker_record_timeout.label")}
|
||||
selected_id={currentSpeakerRecordTimeout.data}
|
||||
list={genNumObjArray(31)}
|
||||
selectFunction={selectFunction}
|
||||
state={currentSpeakerRecordTimeout.state}
|
||||
/>
|
||||
);
|
||||
};
|
||||
const SpeakerPhraseTimeout_Box = () => {
|
||||
const { t } = useTranslation();
|
||||
const [ui_variable, setUiVariable] = useState("");
|
||||
const { currentSpeakerPhraseTimeout, setSpeakerPhraseTimeout } = useSpeakerPhraseTimeout();
|
||||
const onChangeFunction = (e) => {
|
||||
const value = e.currentTarget.value;
|
||||
if (value === "") {
|
||||
setUiVariable("");
|
||||
} else {
|
||||
setUiVariable(value);
|
||||
setSpeakerPhraseTimeout(value);
|
||||
}
|
||||
|
||||
const selectFunction = (selected_data) => {
|
||||
setSpeakerPhraseTimeout(selected_data.selected_id);
|
||||
};
|
||||
|
||||
useEffect(()=> {
|
||||
setUiVariable(currentSpeakerPhraseTimeout.data);
|
||||
}, [currentSpeakerPhraseTimeout]);
|
||||
|
||||
return (
|
||||
<EntryContainer
|
||||
<DropdownMenuContainer
|
||||
dropdown_id="speaker_phrase_timeout"
|
||||
label={t("config_page.transcription.speaker_phrase_timeout.label")}
|
||||
desc={t("config_page.transcription.speaker_phrase_timeout.desc")}
|
||||
ui_variable={ui_variable}
|
||||
onChange={onChangeFunction}
|
||||
selected_id={currentSpeakerPhraseTimeout.data}
|
||||
list={genNumObjArray(31)}
|
||||
selectFunction={selectFunction}
|
||||
state={currentSpeakerPhraseTimeout.state}
|
||||
/>
|
||||
);
|
||||
};
|
||||
const SpeakerMaxWords_Box = () => {
|
||||
const { t } = useTranslation();
|
||||
const [ui_variable, setUiVariable] = useState("");
|
||||
const { currentSpeakerMaxWords, setSpeakerMaxWords } = useSpeakerMaxWords();
|
||||
const onChangeFunction = (e) => {
|
||||
const value = e.currentTarget.value;
|
||||
if (value === "") {
|
||||
setUiVariable("");
|
||||
} else {
|
||||
setUiVariable(value);
|
||||
setSpeakerMaxWords(value);
|
||||
}
|
||||
|
||||
const selectFunction = (selected_data) => {
|
||||
setSpeakerMaxWords(selected_data.selected_id);
|
||||
};
|
||||
|
||||
useEffect(()=> {
|
||||
setUiVariable(currentSpeakerMaxWords.data);
|
||||
}, [currentSpeakerMaxWords]);
|
||||
|
||||
return (
|
||||
<EntryContainer
|
||||
<DropdownMenuContainer
|
||||
dropdown_id="speaker_max_phrase"
|
||||
label={t("config_page.transcription.speaker_max_phrase.label")}
|
||||
desc={t("config_page.transcription.speaker_max_phrase.desc")}
|
||||
ui_variable={ui_variable}
|
||||
onChange={onChangeFunction}
|
||||
selected_id={currentSpeakerMaxWords.data}
|
||||
list={genNumObjArray(61)}
|
||||
selectFunction={selectFunction}
|
||||
state={currentSpeakerMaxWords.state}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -56,7 +56,10 @@ const CTranslate2WeightType_Box = () => {
|
||||
return (
|
||||
<>
|
||||
<DownloadModelsContainer
|
||||
label={t("config_page.translation.ctranslate2_weight_type.label")}
|
||||
label={t(
|
||||
"config_page.translation.ctranslate2_weight_type.label",
|
||||
{ctranslate2: "CTranslate2"}
|
||||
)}
|
||||
desc={t(
|
||||
"config_page.translation.ctranslate2_weight_type.desc",
|
||||
{translator: t("main_page.translator")}
|
||||
@@ -89,10 +92,13 @@ const CTranslation2ComputeDevice_Box = () => {
|
||||
|
||||
|
||||
const { currentComputeMode } = useComputeMode();
|
||||
const ctranslate2_compute_device_label = t("config_page.translation.ctranslate2_compute_device.label", {
|
||||
ctranslate2: "Ctranslate2"
|
||||
});
|
||||
if (currentComputeMode.data === "cpu") {
|
||||
return (
|
||||
<ComputeDeviceContainer
|
||||
label={t("config_page.translation.ctranslate2_compute_device.label")}
|
||||
label={ctranslate2_compute_device_label}
|
||||
selected_id={target_index}
|
||||
list={list_for_ui}
|
||||
selectFunction={selectFunction}
|
||||
@@ -104,8 +110,7 @@ const CTranslation2ComputeDevice_Box = () => {
|
||||
return (
|
||||
<DropdownMenuContainer
|
||||
dropdown_id="ctranslate2_compute_device"
|
||||
label={t("config_page.translation.ctranslate2_compute_device.label")}
|
||||
// desc={t("config_page.translation.ctranslate2_compute_device.label")}
|
||||
label={ctranslate2_compute_device_label}
|
||||
selected_id={target_index}
|
||||
list={list_for_ui}
|
||||
selectFunction={selectFunction}
|
||||
|
||||
Reference in New Issue
Block a user