👍️[Update] Mainl: endpointの命名規則を修正

This commit is contained in:
misyaguziya
2024-09-24 11:51:57 +09:00
parent 80b57612bc
commit e129fd308b
24 changed files with 462 additions and 460 deletions

View File

@@ -67,22 +67,22 @@ export const useReceiveRoutes = () => {
const routes = {
// Main Page
// Main Functions
"/set/enable_translation": updateTranslationStatus,
"/set/disable_translation": updateTranslationStatus,
"/set/enable_transcription_send": updateTranscriptionSendStatus,
"/set/disable_transcription_send": updateTranscriptionSendStatus,
"/set/enable_transcription_receive": updateTranscriptionReceiveStatus,
"/set/disable_transcription_receive": updateTranscriptionReceiveStatus,
"/set/enable/translation": updateTranslationStatus,
"/set/disable/translation": updateTranslationStatus,
"/set/enable/transcription_send": updateTranscriptionSendStatus,
"/set/disable/transcription_send": updateTranscriptionSendStatus,
"/set/enable/transcription_receive": updateTranscriptionReceiveStatus,
"/set/disable/transcription_receive": updateTranscriptionReceiveStatus,
// Language Settings
"/get/selected_tab_no": updateSelectedPresetTabNumber,
"/set/selected_tab_no": updateSelectedPresetTabNumber,
"/get/multi_language_translation": updateEnableMultiTranslation,
"/get/selected_your_languages": updateSelectedYourLanguages,
"/set/selected_your_languages": updateSelectedYourLanguages,
"/get/selected_target_languages": updateSelectedTargetLanguages,
"/set/selected_target_languages": updateSelectedTargetLanguages,
"/get/list_translation_engines": (payload) => {
"/get/data/selected_tab_no": updateSelectedPresetTabNumber,
"/set/data/selected_tab_no": updateSelectedPresetTabNumber,
"/get/data/multi_language_translation": updateEnableMultiTranslation,
"/get/data/selected_your_languages": updateSelectedYourLanguages,
"/set/data/selected_your_languages": updateSelectedYourLanguages,
"/get/data/selected_target_languages": updateSelectedTargetLanguages,
"/set/data/selected_target_languages": updateSelectedTargetLanguages,
"/get/data/translation_engines": (payload) => {
const updateTranslatorAvailability = (keys) => {
return translator_status.map(translator => ({
...translator,
@@ -94,76 +94,76 @@ export const useReceiveRoutes = () => {
updateTranslationEngines(updated_list);
},
"/get/selected_translator_engines": updateSelectedTranslationEngines,
"/set/selected_translator_engines": updateSelectedTranslationEngines,
"/get/data/selected_translation_engines": updateSelectedTranslationEngines,
"/set/data/selected_translator_engines": updateSelectedTranslationEngines,
// Language Selector
"/get/list_languages": updateSelectableLanguageList,
"/get/data/selectable_language_list": updateSelectableLanguageList,
// Message
"/run/send_message_box": updateSentMessageLogById,
"/action/transcription_send_mic_message": addSentMessageLog,
"/action/transcription_receive_speaker_message": addReceivedMessageLog,
"/run/transcription_send_mic_message": addSentMessageLog,
"/run/transcription_receive_speaker_message": addReceivedMessageLog,
// Config Page
// Common
"/get/version": updateSoftwareVersion,
"/get/data/version": updateSoftwareVersion,
// Device Tab
"/get/auto_mic_select": updateEnableAutoMicSelect,
"/set/enable_auto_mic_select": updateEnableAutoMicSelect,
"/set/disable_auto_mic_select": updateEnableAutoMicSelect,
"/get/auto_speaker_select": updateEnableAutoSpeakerSelect,
"/set/enable_auto_speaker_select": updateEnableAutoSpeakerSelect,
"/set/disable_auto_speaker_select": updateEnableAutoSpeakerSelect,
"/get/data/auto_mic_select": updateEnableAutoMicSelect,
"/set/enable/auto_mic_select": updateEnableAutoMicSelect,
"/set/disable/auto_mic_select": updateEnableAutoMicSelect,
"/get/data/auto_speaker_select": updateEnableAutoSpeakerSelect,
"/set/enable/auto_speaker_select": updateEnableAutoSpeakerSelect,
"/set/disable/auto_speaker_select": updateEnableAutoSpeakerSelect,
"/get/list_mic_host": (payload) => updateMicHostList(arrayToObject(payload)),
"/get/selected_mic_host": updateSelectedMicHost,
"/set/selected_mic_host": (payload) => {
"/get/data/mic_host_list": (payload) => updateMicHostList(arrayToObject(payload)),
"/get/data/selected_mic_host": updateSelectedMicHost,
"/set/data/selected_mic_host": (payload) => {
updateSelectedMicHost(payload.host);
updateSelectedMicDevice(payload.device);
},
"/get/list_mic_device": (payload) => updateMicDeviceList(arrayToObject(payload)),
"/get/selected_mic_device": updateSelectedMicDevice,
"/set/selected_mic_device": updateSelectedMicDevice,
"/get/data/mic_device_list": (payload) => updateMicDeviceList(arrayToObject(payload)),
"/get/data/selected_mic_device": updateSelectedMicDevice,
"/set/data/selected_mic_device": updateSelectedMicDevice,
"/get/list_speaker_device": (payload) => updateSpeakerDeviceList(arrayToObject(payload)),
"/get/selected_speaker_device": updateSelectedSpeakerDevice,
"/set/selected_speaker_device": updateSelectedSpeakerDevice,
"/get/data/speaker_device_list": (payload) => updateSpeakerDeviceList(arrayToObject(payload)),
"/get/data/selected_speaker_device": updateSelectedSpeakerDevice,
"/set/data/selected_speaker_device": updateSelectedSpeakerDevice,
"/action/check_mic_threshold_energy": updateVolumeVariable_Mic,
"/action/check_speaker_threshold_energy": updateVolumeVariable_Speaker,
"/set/enable_check_mic_threshold": updateMicThresholdCheckStatus,
"/set/disable_check_mic_threshold": updateMicThresholdCheckStatus,
"/set/enable_check_speaker_threshold": updateSpeakerThresholdCheckStatus,
"/set/disable_check_speaker_threshold": updateSpeakerThresholdCheckStatus,
"/run/check_mic_volume": updateVolumeVariable_Mic,
"/run/check_speaker_volume": updateVolumeVariable_Speaker,
"/set/enable/check_mic_threshold": updateMicThresholdCheckStatus,
"/set/disable/check_mic_threshold": updateMicThresholdCheckStatus,
"/set/enable/check_speaker_threshold": updateSpeakerThresholdCheckStatus,
"/set/disable/check_speaker_threshold": updateSpeakerThresholdCheckStatus,
"/get/mic_energy_threshold": updateMicThreshold,
"/set/mic_energy_threshold": updateMicThreshold,
"/get/speaker_energy_threshold": updateSpeakerThreshold,
"/set/speaker_energy_threshold": updateSpeakerThreshold,
"/get/data/mic_threshold": updateMicThreshold,
"/set/data/mic_threshold": updateMicThreshold,
"/get/data/speaker_energy_threshold": updateSpeakerThreshold,
"/set/data/speaker_energy_threshold": updateSpeakerThreshold,
"/get/mic_dynamic_energy_threshold": updateEnableAutomaticMicThreshold,
"/set/enable_mic_dynamic_energy_threshold": updateEnableAutomaticMicThreshold,
"/set/disable_mic_dynamic_energy_threshold": updateEnableAutomaticMicThreshold,
"/get/speaker_dynamic_energy_threshold": updateEnableAutomaticSpeakerThreshold,
"/set/enable_speaker_dynamic_energy_threshold": updateEnableAutomaticSpeakerThreshold,
"/set/disable_speaker_dynamic_energy_threshold": updateEnableAutomaticSpeakerThreshold,
"/get/data/mic_automatic_threshold": updateEnableAutomaticMicThreshold,
"/set/enable/mic_automatic_threshold": updateEnableAutomaticMicThreshold,
"/set/disable/mic_automatic_threshold": updateEnableAutomaticMicThreshold,
"/get/data/speaker_automatic_threshold": updateEnableAutomaticSpeakerThreshold,
"/set/enable/speaker_automatic_threshold": updateEnableAutomaticSpeakerThreshold,
"/set/disable/speaker_automatic_threshold": updateEnableAutomaticSpeakerThreshold,
// Appearance
"/get/ui_language": updateUiLanguage,
"/set/ui_language": updateUiLanguage,
"/get/data/ui_language": updateUiLanguage,
"/set/data/ui_language": updateUiLanguage,
// Others Tab
"/get/auto_clear_message_box": updateEnableAutoClearMessageBox,
"/set/enable_auto_clear_message_box": updateEnableAutoClearMessageBox,
"/set/disable_auto_clear_message_box": updateEnableAutoClearMessageBox,
"/get/data/auto_clear_message_box": updateEnableAutoClearMessageBox,
"/set/enable/auto_clear_message_box": updateEnableAutoClearMessageBox,
"/set/disable/auto_clear_message_box": updateEnableAutoClearMessageBox,
"/get/send_message_button_type": updateSendMessageButtonType,
"/set/send_message_button_type": updateSendMessageButtonType,
"/get/data/send_message_button_type": updateSendMessageButtonType,
"/set/data/send_message_button_type": updateSendMessageButtonType,
};
const receiveRoutes = (parsed_data) => {