Fix volume remount status notification

This commit is contained in:
Girish Ramakrishnan
2025-09-10 10:28:46 +02:00
parent fb1af04b55
commit 3307c0c183

View File

@@ -126,7 +126,7 @@ async function refresh() {
for (const v of volumes.value) {
const status = await volumesModel.getStatus(v.id);
v.state = status.state === 'inactive' ? 'danger' : (status.state === 'active' ? 'success' : '');
v.state = ledState(status.state);
v.message = status.message;
v.busy = false;
}
@@ -215,14 +215,26 @@ async function onRemove(volume) {
await refresh();
}
async function remount(volume) {
function ledState(state) {
switch (state) {
case 'inactive': return 'danger';
case 'active': return 'success';
default: return '';
}
}
async function remount(nonReactiveVolume) {
const volume = volumes.value.find(v => v.id === nonReactiveVolume.id);
volume.busy = true;
await volumesModel.remount(volume.id);
const status = await volumesModel.getStatus(volume.id);
volume.state = status.state;
volume.state = ledState(status.state);
volume.message = status.message;
volume.busy = false;
window.pankow.notify('Remount attempt finished');
window.pankow.notify('Volume remounted');
}
onMounted(async () =>{