Add rebootComputers function to initiate remote reboot via API

This commit is contained in:
MayaTheShy
2026-03-22 03:15:42 -04:00
parent 2ac11350e6
commit 01ca8ca127

View File

@@ -297,6 +297,20 @@ export const useInventoryStore = create((set, get) => ({
}
},
rebootComputers: async (target = 'all') => {
try {
const response = await fetch(`${API_URL}/reboot`, {
method: 'POST',
headers: authHeaders(),
body: JSON.stringify({ target, commandId: newCommandId() }),
});
return await response.json();
} catch (error) {
console.error('❌ Error sending reboot:', error);
return { success: false, error: error.message };
}
},
sortBarrel: async (barrelName) => {
try {
const response = await fetch(`${API_URL}/sort-barrel`, {