[Update] Config Page: Add notification ui. show error messages.

This commit is contained in:
Sakamoto Shiina
2024-12-08 17:02:19 +09:00
parent c65bb4578c
commit e7b8dac36d
8 changed files with 117 additions and 1 deletions

View File

@@ -2,6 +2,9 @@ import { translator_status } from "@ui_configs";
import { arrayToObject } from "@utils";
import {
useNotificationStatus,
useComputeMode,
useInitProgress,
useIsBackendReady,
@@ -167,6 +170,10 @@ export const useReceiveRoutes = () => {
const { updateOscIpAddress } = useOscIpAddress();
const { updateOscPort } = useOscPort();
const { showNotification_Success, showNotification_Error } = useNotificationStatus();
const routes = {
// Common
"/run/feed_watchdog": () => {},
@@ -494,6 +501,7 @@ export const useReceiveRoutes = () => {
const error_route = error_routes[parsed_data.endpoint];
(error_route) ? error_route(parsed_data.result.data) : console.error(`Invalid endpoint: ${parsed_data.endpoint}\nresult: ${JSON.stringify(parsed_data.result)}`);
console.error(`status 400: ${JSON.stringify(parsed_data.result)}`);
showNotification_Error(parsed_data.result.message);
break;
case 348: