diff --git a/main/http_server/axe-os/src/app/components/swarm/swarm.component.ts b/main/http_server/axe-os/src/app/components/swarm/swarm.component.ts index 44d5bfb27..697f53f7b 100644 --- a/main/http_server/axe-os/src/app/components/swarm/swarm.component.ts +++ b/main/http_server/axe-os/src/app/components/swarm/swarm.component.ts @@ -371,6 +371,9 @@ private isIpAddress(value: string): boolean { } public postAction(device: any, action: string) { + if (action === 'restart' && !confirm('Are you sure you want to restart the device?')) { + return; + } this.httpClient.post(`http://${device.connectionAddress}/api/system/${action}`, {}, { responseType: 'text' }).pipe( timeout(800), catchError(error => { diff --git a/main/http_server/axe-os/src/app/layout/app.topbar.component.ts b/main/http_server/axe-os/src/app/layout/app.topbar.component.ts index 5215d5b33..3d4133bb4 100644 --- a/main/http_server/axe-os/src/app/layout/app.topbar.component.ts +++ b/main/http_server/axe-os/src/app/layout/app.topbar.component.ts @@ -74,9 +74,11 @@ export class AppTopBarComponent implements OnInit, OnDestroy { } public restart() { - this.systemService.restart().subscribe({ - next: () => this.toastr.success('Device restarted'), - error: () => this.toastr.error('Restart failed') - }); + if (confirm('Are you sure you want to restart the device?')) { + this.systemService.restart().subscribe({ + next: () => this.toastr.success('Device restarted'), + error: () => this.toastr.error('Restart failed') + }); + } } }