diff --git a/interface/src/CustomTheme.tsx b/interface/src/CustomTheme.tsx index a482e0b28..1f08afc19 100644 --- a/interface/src/CustomTheme.tsx +++ b/interface/src/CustomTheme.tsx @@ -1,10 +1,19 @@ import { CssBaseline } from '@mui/material'; -import { blueGrey, blue } from '@mui/material/colors'; import { createTheme, responsiveFontSizes, ThemeProvider } from '@mui/material/styles'; import type { FC } from 'react'; import type { RequiredChildrenProps } from 'utils'; +export const dialogStyle = { + '& .MuiDialog-paper': { + borderRadius: '8px', + borderColor: '#565656', + borderStyle: 'solid', + borderWidth: '1px' + }, + backdropFilter: 'blur(1px)' +}; + const theme = responsiveFontSizes( createTheme({ typography: { @@ -13,10 +22,10 @@ const theme = responsiveFontSizes( palette: { mode: 'dark', secondary: { - main: blue[500] + main: '#2196f3' // blue[500] }, info: { - main: blueGrey[500] + main: '#607d8b' // blueGrey[500] } } }) diff --git a/interface/src/components/routing/BlockNavigation.tsx b/interface/src/components/routing/BlockNavigation.tsx index c8986c14a..dd0541075 100644 --- a/interface/src/components/routing/BlockNavigation.tsx +++ b/interface/src/components/routing/BlockNavigation.tsx @@ -3,6 +3,7 @@ import type { FC } from 'react'; import type { unstable_Blocker as Blocker } from 'react-router-dom'; +import { dialogStyle } from 'CustomTheme'; import { useI18nContext } from 'i18n/i18n-react'; interface BlockNavigationProps { @@ -13,7 +14,7 @@ const BlockNavigation: FC = ({ blocker }) => { const { LL } = useI18nContext(); return ( - + {LL.BLOCK_NAVIGATE_1()} {LL.BLOCK_NAVIGATE_2()} diff --git a/interface/src/framework/ntp/NTPStatusForm.tsx b/interface/src/framework/ntp/NTPStatusForm.tsx index 6b47b56e1..c8e73ef74 100644 --- a/interface/src/framework/ntp/NTPStatusForm.tsx +++ b/interface/src/framework/ntp/NTPStatusForm.tsx @@ -28,6 +28,7 @@ import type { Theme } from '@mui/material'; import type { FC } from 'react'; import type { NTPStatus } from 'types'; +import { dialogStyle } from 'CustomTheme'; import * as NTPApi from 'api/ntp'; import { ButtonRow, FormLoader, SectionContent } from 'components'; import { AuthenticatedContext } from 'contexts/authentication'; @@ -108,7 +109,7 @@ const NTPStatusForm: FC = () => { }; const renderSetTimeDialog = () => ( - setSettingTime(false)}> + setSettingTime(false)}> {LL.SET_TIME(1)} diff --git a/interface/src/framework/security/GenerateToken.tsx b/interface/src/framework/security/GenerateToken.tsx index 0a2e8a0ef..f7092829f 100644 --- a/interface/src/framework/security/GenerateToken.tsx +++ b/interface/src/framework/security/GenerateToken.tsx @@ -14,6 +14,7 @@ import { useRequest } from 'alova'; import { useEffect } from 'react'; import type { FC } from 'react'; +import { dialogStyle } from 'CustomTheme'; import * as SecurityApi from 'api/security'; import { MessageBox } from 'components'; @@ -39,8 +40,8 @@ const GenerateToken: FC = ({ username, onClose }) => { }, [open, generateToken]); return ( - - {LL.ACCESS_TOKEN_FOR() + ' ' + username} + + {LL.ACCESS_TOKEN_FOR() + ' ' + username} {token ? ( <> diff --git a/interface/src/framework/security/UserForm.tsx b/interface/src/framework/security/UserForm.tsx index f11343096..3416b5dd4 100644 --- a/interface/src/framework/security/UserForm.tsx +++ b/interface/src/framework/security/UserForm.tsx @@ -9,6 +9,7 @@ import type { ValidateFieldsError } from 'async-validator'; import type { FC } from 'react'; import type { User } from 'types'; +import { dialogStyle } from 'CustomTheme'; import { BlockFormControlLabel, ValidatedPasswordField, ValidatedTextField } from 'components'; import { useI18nContext } from 'i18n/i18n-react'; import { updateValue } from 'utils'; @@ -51,7 +52,7 @@ const UserForm: FC = ({ creating, validator, user, setUser, onDon }; return ( - + {user && ( <> diff --git a/interface/src/framework/system/SystemStatusForm.tsx b/interface/src/framework/system/SystemStatusForm.tsx index dd2416ca1..a6c24c993 100644 --- a/interface/src/framework/system/SystemStatusForm.tsx +++ b/interface/src/framework/system/SystemStatusForm.tsx @@ -34,6 +34,7 @@ import RestartMonitor from './RestartMonitor'; import SystemStatusVersionDialog from './SystemStatusVersionDialog'; import type { FC } from 'react'; +import { dialogStyle } from 'CustomTheme'; import * as SystemApi from 'api/system'; import { ButtonRow, FormLoader, SectionContent } from 'components'; import { AuthenticatedContext } from 'contexts/authentication'; @@ -115,7 +116,7 @@ const SystemStatusForm: FC = () => { }; const renderRestartDialog = () => ( - setConfirmRestart(false)}> + setConfirmRestart(false)}> {LL.RESTART()} {LL.RESTART_CONFIRM()} @@ -153,7 +154,7 @@ const SystemStatusForm: FC = () => { ); const renderFactoryResetDialog = () => ( - setConfirmFactoryReset(false)}> + setConfirmFactoryReset(false)}> {LL.FACTORY_RESET()} {LL.SYSTEM_FACTORY_TEXT_DIALOG()} diff --git a/interface/src/framework/system/SystemStatusVersionDialog.tsx b/interface/src/framework/system/SystemStatusVersionDialog.tsx index fa2851025..1c7ab8876 100644 --- a/interface/src/framework/system/SystemStatusVersionDialog.tsx +++ b/interface/src/framework/system/SystemStatusVersionDialog.tsx @@ -1,6 +1,7 @@ import { Box, Button, Dialog, DialogActions, DialogContent, DialogTitle, Link, Typography } from '@mui/material'; import { useRequest } from 'alova'; import { useCallback, useEffect } from 'react'; +import { dialogStyle } from 'CustomTheme'; import * as SystemApi from 'api/system'; import MessageBox from 'components/MessageBox'; @@ -49,7 +50,7 @@ const SystemStatusVersionDialog = ({ open, onClose, version, platform }: SystemS const getBinURL = (v: string) => 'EMS-ESP-' + v.replaceAll('.', '_') + '-' + platform.replaceAll('-', '_') + '.bin'; return ( - + {LL.VERSION_CHECK(1)} diff --git a/interface/src/project/DashboardDevices.tsx b/interface/src/project/DashboardDevices.tsx index 39c3a65c5..09dd0dfcb 100644 --- a/interface/src/project/DashboardDevices.tsx +++ b/interface/src/project/DashboardDevices.tsx @@ -45,6 +45,7 @@ import { DeviceValueUOM_s, DeviceEntityMask, DeviceType } from './types'; import { deviceValueItemValidation } from './validators'; import type { Device, DeviceValue } from './types'; import type { FC } from 'react'; +import { dialogStyle } from 'CustomTheme'; import { ButtonRow, SectionContent, MessageBox } from 'components'; import { AuthenticatedContext } from 'contexts/authentication'; @@ -361,7 +362,7 @@ const DashboardDevices: FC = () => { } return ( - setShowDeviceInfo(false)}> + setShowDeviceInfo(false)}> {LL.DEVICE_DETAILS()} diff --git a/interface/src/project/DashboardDevicesDialog.tsx b/interface/src/project/DashboardDevicesDialog.tsx index 042fb8eee..c4a291f5e 100644 --- a/interface/src/project/DashboardDevicesDialog.tsx +++ b/interface/src/project/DashboardDevicesDialog.tsx @@ -16,7 +16,6 @@ import { Typography, CircularProgress } from '@mui/material'; -import { green } from '@mui/material/colors'; import { useState, useEffect } from 'react'; import { DeviceValueUOM, DeviceValueUOM_s } from './types'; @@ -24,12 +23,23 @@ import type { DeviceValue } from './types'; import type Schema from 'async-validator'; import type { ValidateFieldsError } from 'async-validator'; +import { dialogStyle } from 'CustomTheme'; import { ValidatedTextField } from 'components'; import { useI18nContext } from 'i18n/i18n-react'; import { updateValue } from 'utils'; import { validate } from 'validators'; +// const dialogStyle = { +// '& .MuiDialog-paper': { +// borderRadius: '8px', +// borderColor: '#565656', +// borderStyle: 'solid', +// borderWidth: '1px' +// }, +// backdropFilter: 'blur(1px)' +// }; + type DashboardDevicesDialogProps = { open: boolean; onClose: () => void; @@ -112,16 +122,7 @@ const DashboardDevicesDialog = ({ }; return ( - + {selectedItem.v === '' && selectedItem.c ? LL.RUN_COMMAND() : writeable ? LL.CHANGE_VALUE() : LL.VALUE(0)} @@ -206,7 +207,7 @@ const DashboardDevicesDialog = ({ + {creating ? LL.ADD(1) + ' ' + LL.NEW(0) : LL.EDIT()} {LL.ANALOG_SENSOR(0)} diff --git a/interface/src/project/DashboardSensorsTemperatureDialog.tsx b/interface/src/project/DashboardSensorsTemperatureDialog.tsx index 78ae78074..3a0ef4dd4 100644 --- a/interface/src/project/DashboardSensorsTemperatureDialog.tsx +++ b/interface/src/project/DashboardSensorsTemperatureDialog.tsx @@ -18,6 +18,7 @@ import { useState, useEffect } from 'react'; import type { TemperatureSensor } from './types'; import type Schema from 'async-validator'; import type { ValidateFieldsError } from 'async-validator'; +import { dialogStyle } from 'CustomTheme'; import { ValidatedTextField } from 'components'; import { useI18nContext } from 'i18n/i18n-react'; @@ -67,7 +68,7 @@ const DashboardSensorsTemperatureDialog = ({ }; return ( - + {LL.EDIT()} {LL.TEMP_SENSOR()} diff --git a/interface/src/project/DashboardStatus.tsx b/interface/src/project/DashboardStatus.tsx index 4c43014b3..9c1e05b33 100644 --- a/interface/src/project/DashboardStatus.tsx +++ b/interface/src/project/DashboardStatus.tsx @@ -30,6 +30,7 @@ import type { Theme } from '@mui/material'; import type { Translation } from 'i18n/i18n-types'; import type { FC } from 'react'; +import { dialogStyle } from 'CustomTheme'; import { ButtonRow, FormLoader, SectionContent } from 'components'; import { AuthenticatedContext } from 'contexts/authentication'; import { useI18nContext } from 'i18n/i18n-react'; @@ -173,7 +174,7 @@ const DashboardStatus: FC = () => { }; const renderScanDialog = () => ( - setConfirmScan(false)}> + setConfirmScan(false)}> {LL.SCAN_DEVICES()} {LL.EMS_SCAN()} diff --git a/interface/src/project/SettingsCustomization.tsx b/interface/src/project/SettingsCustomization.tsx index 8c032ea16..2fb0e47b0 100644 --- a/interface/src/project/SettingsCustomization.tsx +++ b/interface/src/project/SettingsCustomization.tsx @@ -35,6 +35,7 @@ import * as EMSESP from './api'; import { DeviceEntityMask } from './types'; import type { DeviceShort, DeviceEntity } from './types'; import type { FC } from 'react'; +import { dialogStyle } from 'CustomTheme'; import * as SystemApi from 'api/system'; import { ButtonRow, SectionContent, MessageBox, BlockNavigation } from 'components'; @@ -484,7 +485,7 @@ const SettingsCustomization: FC = () => { }; const renderResetDialog = () => ( - setConfirmReset(false)}> + setConfirmReset(false)}> {LL.RESET(1)} {LL.CUSTOMIZATIONS_RESET()} diff --git a/interface/src/project/SettingsCustomizationDialog.tsx b/interface/src/project/SettingsCustomizationDialog.tsx index 50601785d..8476cd501 100644 --- a/interface/src/project/SettingsCustomizationDialog.tsx +++ b/interface/src/project/SettingsCustomizationDialog.tsx @@ -18,6 +18,7 @@ import EntityMaskToggle from './EntityMaskToggle'; import { DeviceEntityMask } from './types'; import type { DeviceEntity } from './types'; +import { dialogStyle } from 'CustomTheme'; import { useI18nContext } from 'i18n/i18n-react'; import { updateValue } from 'utils'; @@ -63,7 +64,7 @@ const SettingsCustomizationDialog = ({ open, onClose, onSave, selectedItem }: Se }; return ( - + {LL.EDIT() + ' ' + LL.ENTITY()} diff --git a/interface/src/project/SettingsEntitiesDialog.tsx b/interface/src/project/SettingsEntitiesDialog.tsx index 6d8d39511..7006e92d6 100644 --- a/interface/src/project/SettingsEntitiesDialog.tsx +++ b/interface/src/project/SettingsEntitiesDialog.tsx @@ -22,6 +22,7 @@ import type { EntityItem } from './types'; import type Schema from 'async-validator'; import type { ValidateFieldsError } from 'async-validator'; +import { dialogStyle } from 'CustomTheme'; import { BlockFormControlLabel, ValidatedTextField } from 'components'; import { useI18nContext } from 'i18n/i18n-react'; @@ -90,7 +91,7 @@ const SettingsEntitiesDialog = ({ }; return ( - + {creating ? LL.ADD(1) + ' ' + LL.NEW(1) : LL.EDIT()} {LL.ENTITY()} diff --git a/interface/src/project/SettingsSchedulerDialog.tsx b/interface/src/project/SettingsSchedulerDialog.tsx index d074848a4..b5a4eb90f 100644 --- a/interface/src/project/SettingsSchedulerDialog.tsx +++ b/interface/src/project/SettingsSchedulerDialog.tsx @@ -25,6 +25,7 @@ import type { ScheduleItem } from './types'; import type Schema from 'async-validator'; import type { ValidateFieldsError } from 'async-validator'; +import { dialogStyle } from 'CustomTheme'; import { BlockFormControlLabel, ValidatedTextField } from 'components'; import { useI18nContext } from 'i18n/i18n-react'; @@ -129,7 +130,7 @@ const SettingsSchedulerDialog = ({ const isTimer = editItem.flags === ScheduleFlag.SCHEDULE_TIMER; return ( - + {creating ? LL.ADD(1) + ' ' + LL.NEW(0) : LL.EDIT()} {LL.SCHEDULE(1)}