Add rebootComputers function to initiate remote reboot via API
This commit is contained in:
@@ -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`, {
|
||||
|
||||
Reference in New Issue
Block a user