mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Adding disk mount handling to React UI.
This commit is contained in:
parent
1a02a4eb5b
commit
628b9f3096
10 changed files with 600 additions and 51 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue