mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-03-26 17:51:45 +01:00
fix restart button
This commit is contained in:
parent
e23e23db5f
commit
90da2cdece
@ -40,7 +40,8 @@ import { AppTopBarComponent } from './app.topbar.component';
|
||||
InputSwitchModule,
|
||||
RippleModule,
|
||||
RouterModule,
|
||||
PrimeNGModule
|
||||
PrimeNGModule,
|
||||
|
||||
],
|
||||
exports: [AppLayoutComponent]
|
||||
})
|
||||
|
@ -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>
|
@ -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({
|
||||
@ -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 = [
|
||||
@ -27,4 +32,14 @@ export class AppMenuComponent implements OnInit {
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
public restart() {
|
||||
this.systemService.restart().subscribe(res => {
|
||||
|
||||
});
|
||||
this.toastr.success('Success!', 'Bitaxe restarted');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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({
|
||||
@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user