mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-05-02 20:16:59 +00:00
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { LogSettings, SystemStatus } from 'types';
|
||||
|
||||
import { DOCS_BASE_URL, alovaInstance } from './endpoints';
|
||||
import { alovaInstance } from './endpoints';
|
||||
|
||||
// systemStatus - also used to ping in System Monitor for pinging
|
||||
export const readSystemStatus = () =>
|
||||
@@ -13,14 +13,6 @@ export const updateLogSettings = (data: LogSettings) =>
|
||||
alovaInstance.Post('/rest/logSettings', data);
|
||||
export const fetchLogES = () => alovaInstance.Get('/es/log');
|
||||
|
||||
// get versions from emsesp.org/versions.json
|
||||
// uses native fetch (no custom headers) to keep this as a "simple" CORS
|
||||
export const getVersions = async <T = unknown>(): Promise<T> => {
|
||||
const res = await fetch(`${DOCS_BASE_URL}/versions.json`);
|
||||
if (!res.ok) throw new Error(res.statusText);
|
||||
return res.json() as Promise<T>;
|
||||
};
|
||||
|
||||
const UPLOAD_TIMEOUT = 60000; // 1 minute
|
||||
|
||||
export const uploadFile = (file: File) => {
|
||||
|
||||
Reference in New Issue
Block a user