-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1667 from proddy/dev
changes to web layout (status and settings)
- Loading branch information
Showing
104 changed files
with
2,511 additions
and
10,983 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{ | ||
"search.exclude": { | ||
"**/.yarn": true, | ||
"**/.pnp.*": true | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": "explicit" | ||
}, | ||
"eslint.nodePath": "interface/.yarn/sdks", | ||
"eslint.workingDirectories": ["interface"], | ||
"prettier.prettierPath": "", | ||
"typescript.enablePromptUseWorkspaceTsdk": true, | ||
"files.associations": { | ||
"*.tsx": "typescriptreact", | ||
"*.tcc": "cpp", | ||
"optional": "cpp", | ||
"istream": "cpp", | ||
"ostream": "cpp", | ||
"ratio": "cpp", | ||
"system_error": "cpp", | ||
"array": "cpp", | ||
"functional": "cpp", | ||
"regex": "cpp", | ||
"tuple": "cpp", | ||
"type_traits": "cpp", | ||
"utility": "cpp", | ||
"string": "cpp", | ||
"string_view": "cpp", | ||
"atomic": "cpp", | ||
"bitset": "cpp", | ||
"cctype": "cpp", | ||
"chrono": "cpp", | ||
"clocale": "cpp", | ||
"cmath": "cpp", | ||
"condition_variable": "cpp", | ||
"cstdarg": "cpp", | ||
"cstddef": "cpp", | ||
"cstdint": "cpp", | ||
"cstdio": "cpp", | ||
"cstdlib": "cpp", | ||
"cstring": "cpp", | ||
"ctime": "cpp", | ||
"cwchar": "cpp", | ||
"cwctype": "cpp", | ||
"deque": "cpp", | ||
"list": "cpp", | ||
"unordered_map": "cpp", | ||
"unordered_set": "cpp", | ||
"vector": "cpp", | ||
"exception": "cpp", | ||
"algorithm": "cpp", | ||
"iterator": "cpp", | ||
"map": "cpp", | ||
"memory": "cpp", | ||
"memory_resource": "cpp", | ||
"numeric": "cpp", | ||
"random": "cpp", | ||
"set": "cpp", | ||
"fstream": "cpp", | ||
"initializer_list": "cpp", | ||
"iomanip": "cpp", | ||
"iosfwd": "cpp", | ||
"iostream": "cpp", | ||
"limits": "cpp", | ||
"mutex": "cpp", | ||
"new": "cpp", | ||
"sstream": "cpp", | ||
"stdexcept": "cpp", | ||
"streambuf": "cpp", | ||
"thread": "cpp", | ||
"cinttypes": "cpp", | ||
"typeinfo": "cpp" | ||
}, | ||
"todo-tree.filtering.excludeGlobs": [ | ||
"**/vendor/**", | ||
"**/node_modules/**", | ||
"**/dist/**", | ||
"**/bower_components/**", | ||
"**/build/**", | ||
"**/.vscode/**", | ||
"**/.github/**", | ||
"**/_output/**", | ||
"**/*.min.*", | ||
"**/*.map", | ||
"**/ArduinoJson/**" | ||
], | ||
"cSpell.enableFiletypes": [ | ||
"!cpp", | ||
"!typescript" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,55 @@ | ||
import { useContext, type FC } from 'react'; | ||
import { Navigate, Routes, Route } from 'react-router-dom'; | ||
import Dashboard from './project/Dashboard'; | ||
import Help from './project/Help'; | ||
import Settings from './project/Settings'; | ||
import type { FC } from 'react'; | ||
|
||
import { Layout, RequireAdmin } from 'components'; | ||
import { Layout } from 'components'; | ||
import { AuthenticatedContext } from 'contexts/authentication'; | ||
import Settings from 'framework/Settings'; | ||
import AccessPoint from 'framework/ap/AccessPoint'; | ||
import Mqtt from 'framework/mqtt/Mqtt'; | ||
import NetworkConnection from 'framework/network/NetworkConnection'; | ||
import Network from 'framework/network/Network'; | ||
import NetworkTime from 'framework/ntp/NetworkTime'; | ||
import OTASettings from 'framework/ota/OTASettings'; | ||
import Security from 'framework/security/Security'; | ||
import ESPSystemStatus from 'framework/system/ESPSystemStatus'; | ||
import System from 'framework/system/System'; | ||
import UploadDownload from 'framework/system/UploadDownload'; | ||
import ApplicationSettings from 'project/ApplicationSettings'; | ||
import CustomEntities from 'project/CustomEntities'; | ||
import Customization from 'project/Customization'; | ||
import Devices from 'project/Devices'; | ||
import Scheduler from 'project/Scheduler'; | ||
import Sensors from 'project/Sensors'; | ||
|
||
const AuthenticatedRouting: FC = () => ( | ||
// const location = useLocation(); | ||
// const navigate = useNavigate(); | ||
// const handleApiResponseError = useCallback( | ||
// (error: AxiosError) => { | ||
// if (error.response && error.response.status === 401) { | ||
// AuthenticationApi.storeLoginRedirect(location); | ||
// navigate('/unauthorized'); | ||
// } | ||
// return Promise.reject(error); | ||
// }, | ||
// [location, navigate] | ||
// ); | ||
// useEffect(() => { | ||
// const axiosHandlerId = AXIOS.interceptors.response.use((response) => response, handleApiResponseError); | ||
// return () => AXIOS.interceptors.response.eject(axiosHandlerId); | ||
// }, [handleApiResponseError]); | ||
|
||
<Layout> | ||
<Routes> | ||
<Route path="/dashboard/*" element={<Dashboard />} /> | ||
<Route | ||
path="/settings/*" | ||
element={ | ||
<RequireAdmin> | ||
<Settings /> | ||
</RequireAdmin> | ||
} | ||
/> | ||
<Route path="/help/*" element={<Help />} /> | ||
|
||
<Route path="/network/*" element={<NetworkConnection />} /> | ||
<Route path="/ap/*" element={<AccessPoint />} /> | ||
<Route path="/ntp/*" element={<NetworkTime />} /> | ||
<Route path="/mqtt/*" element={<Mqtt />} /> | ||
<Route | ||
path="/security/*" | ||
element={ | ||
<RequireAdmin> | ||
<Security /> | ||
</RequireAdmin> | ||
} | ||
/> | ||
<Route path="/system/*" element={<System />} /> | ||
<Route path="/*" element={<Navigate to="/" />} /> | ||
</Routes> | ||
</Layout> | ||
); | ||
const AuthenticatedRouting: FC = () => { | ||
const { me } = useContext(AuthenticatedContext); | ||
return ( | ||
<Layout> | ||
<Routes> | ||
<Route path="/devices/*" element={<Devices />} /> | ||
<Route path="/sensors/*" element={<Sensors />} /> | ||
<Route path="/system/*" element={<System />} /> | ||
<Route path="/help/*" element={<Help />} /> | ||
<Route path="/*" element={<Navigate to="/" />} /> | ||
{me.admin && ( | ||
<> | ||
<Route path="/customizations/*" element={<Customization />} /> | ||
<Route path="/scheduler/*" element={<Scheduler />} /> | ||
<Route path="/customentities/*" element={<CustomEntities />} /> | ||
<Route path="/settings/*" element={<Settings />} /> | ||
<Route path="/settings/network/*" element={<Network />} /> | ||
<Route path="/settings/ems-esp/*" element={<ApplicationSettings />} /> | ||
<Route path="/settings/ap/*" element={<AccessPoint />} /> | ||
<Route path="/settings/ntp/*" element={<NetworkTime />} /> | ||
<Route path="/settings/mqtt/*" element={<Mqtt />} /> | ||
<Route path="/settings/ota/*" element={<OTASettings />} /> | ||
<Route path="/settings/security/*" element={<Security />} /> | ||
<Route path="/settings/espsystemstatus/*" element={<ESPSystemStatus />} /> | ||
<Route path="/settings/upload/*" element={<UploadDownload />} /> | ||
</> | ||
)} | ||
</Routes> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default AuthenticatedRouting; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { alovaInstance } from './endpoints'; | ||
import type { MqttSettings, MqttStatus } from 'types'; | ||
import type { MqttSettingsType, MqttStatusType } from 'types'; | ||
|
||
export const readMqttStatus = () => alovaInstance.Get<MqttStatus>('/rest/mqttStatus'); | ||
export const readMqttSettings = () => alovaInstance.Get<MqttSettings>('/rest/mqttSettings'); | ||
export const updateMqttSettings = (data: MqttSettings) => alovaInstance.Post<MqttSettings>('/rest/mqttSettings', data); | ||
export const readMqttStatus = () => alovaInstance.Get<MqttStatusType>('/rest/mqttStatus'); | ||
export const readMqttSettings = () => alovaInstance.Get<MqttSettingsType>('/rest/mqttSettings'); | ||
export const updateMqttSettings = (data: MqttSettingsType) => | ||
alovaInstance.Post<MqttSettingsType>('/rest/mqttSettings', data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.