merging to sync - still need to fix system.ts

This commit is contained in:
proddy
2023-06-16 06:44:49 +02:00
parent f58dbf6ec1
commit 2ae45ecd6e
20 changed files with 171 additions and 150 deletions

View File

@@ -1,13 +1,20 @@
import { AXIOS, AXIOS_BIN, startUploadFile } from './endpoints';
import { AXIOS, AXIOS_BIN, alovaInstance, startUploadFile } from './endpoints';
import type { FileUploadConfig } from './endpoints';
import type { AxiosPromise } from 'axios';
import type { OTASettings, SystemStatus, LogSettings, LogEntries } from 'types';
// TODO move to Alova
export function readSystemStatus(timeout?: number): AxiosPromise<SystemStatus> {
return AXIOS.get('/systemStatus', { timeout });
}
// TODO fix this next!
export const readSystemStatus = (timeout?: number) =>
alovaInstance.Get<SystemStatus>('/rest/systemStatus', {
params: { timeout }
});
// export function readSystemStatus(timeout?: number): AxiosPromise<SystemStatus> {
// return AXIOS.get('/systemStatus', { timeout });
// }
export function restart(): AxiosPromise<void> {
return AXIOS.post('/restart');