Adding disk mount handling to React UI.
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Controller Tests / controller-tests (push) Waiting to run
Jest Tests / jest-tests (push) Waiting to run

This commit is contained in:
Roland 2025-12-16 15:06:41 -07:00
parent 1a02a4eb5b
commit 628b9f3096
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
10 changed files with 600 additions and 51 deletions

View file

@ -151,10 +151,10 @@ export async function getMounts() {
return controllerFetch('/disks/mounts');
}
export async function mountDisk(device, mountPoint) {
export async function mountDisk(device, mountPoint, fstype = null, options = 'defaults', persist = false) {
return controllerFetch('/disks/mount', {
method: 'POST',
body: JSON.stringify({device, mount_point: mountPoint}),
body: JSON.stringify({device, mount_point: mountPoint, fstype, options, persist}),
});
}
@ -173,6 +173,24 @@ export async function getSmartStatus() {
return controllerFetch('/disks/smart');
}
// --- Fstab Endpoints ---
export async function getFstabEntries() {
return controllerFetch('/disks/fstab');
}
export async function addFstabEntry(device, mountPoint, fstype, options = 'defaults,nofail,x-systemd.device-timeout=10s') {
return controllerFetch('/disks/fstab', {
method: 'POST',
body: JSON.stringify({device, mount_point: mountPoint, fstype, options}),
});
}
export async function removeFstabEntry(mountPoint) {
const encodedPath = encodeURIComponent(mountPoint.slice(1));
return controllerFetch(`/disks/fstab/${encodedPath}`, {method: 'DELETE'});
}
// --- Health Check ---
export async function healthCheck() {