Skip to content

Commit

Permalink
fix restart button
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-wilson committed Mar 12, 2024
1 parent e23e23d commit 90da2cd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
3 changes: 2 additions & 1 deletion main/http_server/axe-os/src/app/layout/app.layout.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ import { AppTopBarComponent } from './app.topbar.component';
InputSwitchModule,
RippleModule,
RouterModule,
PrimeNGModule
PrimeNGModule,

],
exports: [AppLayoutComponent]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
</ng-container>


<p-button id="restart" label="Restart" severity="danger"></p-button>
<p-button (click)="restart()" id="restart" label="Restart" severity="danger"></p-button>

</ul>
17 changes: 16 additions & 1 deletion main/http_server/axe-os/src/app/layout/app.menu.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';

import { SystemService } from '../services/system.service';
import { LayoutService } from './service/app.layout.service';

@Component({
Expand All @@ -10,7 +12,10 @@ export class AppMenuComponent implements OnInit {

model: any[] = [];

constructor(public layoutService: LayoutService) { }
constructor(public layoutService: LayoutService,
private systemService: SystemService,
private toastr: ToastrService
) { }

ngOnInit() {
this.model = [
Expand All @@ -27,4 +32,14 @@ export class AppMenuComponent implements OnInit {

];
}



public restart() {
this.systemService.restart().subscribe(res => {

});
this.toastr.success('Success!', 'Bitaxe restarted');
}

}
12 changes: 0 additions & 12 deletions main/http_server/axe-os/src/app/layout/app.topbar.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Component, ElementRef, ViewChild } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { MenuItem } from 'primeng/api';

import { SystemService } from '../services/system.service';
import { LayoutService } from './service/app.layout.service';

@Component({
Expand All @@ -20,17 +18,7 @@ export class AppTopBarComponent {
@ViewChild('topbarmenu') menu!: ElementRef;

constructor(public layoutService: LayoutService,
private systemService: SystemService,
private toastr: ToastrService
) { }



public restart() {
this.systemService.restart().subscribe(res => {

});
this.toastr.success('Success!', 'Bitaxe restarted');
}

}

0 comments on commit 90da2cd

Please sign in to comment.