mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
formatting
This commit is contained in:
@@ -8,10 +8,12 @@ import type { ESPSystemStatus, LogSettings, OTASettings, SystemStatus } from 'ty
|
||||
import { alovaInstance, alovaInstanceGH } from './endpoints';
|
||||
|
||||
// ESPSystemStatus - also used to ping in Restart monitor for pinging
|
||||
export const readESPSystemStatus = () => alovaInstance.Get<ESPSystemStatus>('/rest/ESPSystemStatus');
|
||||
export const readESPSystemStatus = () =>
|
||||
alovaInstance.Get<ESPSystemStatus>('/rest/ESPSystemStatus');
|
||||
|
||||
// SystemStatus
|
||||
export const readSystemStatus = () => alovaInstance.Get<SystemStatus>('/rest/systemStatus');
|
||||
export const readSystemStatus = () =>
|
||||
alovaInstance.Get<SystemStatus>('/rest/systemStatus');
|
||||
|
||||
// commands
|
||||
export const restart = () => alovaInstance.Post('/rest/restart');
|
||||
@@ -19,12 +21,16 @@ export const partition = () => alovaInstance.Post('/rest/partition');
|
||||
export const factoryReset = () => alovaInstance.Post('/rest/factoryReset');
|
||||
|
||||
// OTA
|
||||
export const readOTASettings = () => alovaInstance.Get<OTASettings>(`/rest/otaSettings`);
|
||||
export const updateOTASettings = (data: OTASettings) => alovaInstance.Post('/rest/otaSettings', data);
|
||||
export const readOTASettings = () =>
|
||||
alovaInstance.Get<OTASettings>(`/rest/otaSettings`);
|
||||
export const updateOTASettings = (data: OTASettings) =>
|
||||
alovaInstance.Post('/rest/otaSettings', data);
|
||||
|
||||
// SystemLog
|
||||
export const readLogSettings = () => alovaInstance.Get<LogSettings>(`/rest/logSettings`);
|
||||
export const updateLogSettings = (data: LogSettings) => alovaInstance.Post('/rest/logSettings', data);
|
||||
export const readLogSettings = () =>
|
||||
alovaInstance.Get<LogSettings>(`/rest/logSettings`);
|
||||
export const updateLogSettings = (data: LogSettings) =>
|
||||
alovaInstance.Post('/rest/logSettings', data);
|
||||
export const fetchLog = () => alovaInstance.Post('/rest/fetchLog');
|
||||
export const fetchLogES = () => alovaInstance.Get('/es/log');
|
||||
|
||||
@@ -47,6 +53,6 @@ export const uploadFile = (file: File) => {
|
||||
formData.append('file', file);
|
||||
return alovaInstance.Post('/rest/uploadFile', formData, {
|
||||
timeout: 60000, // override timeout for uploading firmware - 1 minute
|
||||
enableUpload: true
|
||||
enableUpload: true // can be removed with Alova 2.20+
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user