diff --git a/interface/src/api/system.ts b/interface/src/api/system.ts index beabe0125..ff9007b31 100644 --- a/interface/src/api/system.ts +++ b/interface/src/api/system.ts @@ -13,6 +13,7 @@ export const readSystemStatus = () => // commands export const restart = () => alovaInstance.Post('/rest/restart'); export const partition = () => alovaInstance.Post('/rest/partition'); +export const factoryPartition = () => alovaInstance.Post('/rest/factoryPartition'); export const factoryReset = () => alovaInstance.Post('/rest/factoryReset'); // SystemLog diff --git a/interface/src/app/status/Status.tsx b/interface/src/app/status/Status.tsx index c1af25414..7b3503790 100644 --- a/interface/src/app/status/Status.tsx +++ b/interface/src/app/status/Status.tsx @@ -63,6 +63,10 @@ const SystemStatus = () => { immediate: false }); + const { send: factoryPartitionCommand } = useRequest(SystemApi.factoryPartition(), { + immediate: false + }); + const { data: data, send: loadData, @@ -230,6 +234,21 @@ const SystemStatus = () => { }); }; + const factoryPartition = async () => { + setProcessing(true); + await factoryPartitionCommand() + .then(() => { + setRestarting(true); + }) + .catch((error: Error) => { + toast.error(error.message); + }) + .finally(() => { + setConfirmRestart(false); + setProcessing(false); + }); + }; + const renderRestartDialog = () => ( { > {LL.CANCEL()} - + {data.has_loader && ( + + )} + {data.has_partition && ( + + )}