Add version info

Signed-off-by: YoungSoo Shin <shinys000114@gmail.com>
This commit is contained in:
2025-09-24 11:22:49 +09:00
parent 4bbf1339f1
commit 39ca2d205a
8 changed files with 64 additions and 3 deletions

View File

@@ -110,3 +110,14 @@ export async function postControlCommand(command) {
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
return response;
}
/**
* Fetches the firmware version from the server.
* @returns {Promise<Object>} A promise that resolves to an object containing the version.
* @throws {Error} Throws an error if the network request fails.
*/
export async function fetchVersion() {
const response = await fetch('/api/version');
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
return await response.json();
}