Fix install button apperance and prepare for installation support

This commit is contained in:
ziajka
2019-01-09 15:32:19 +01:00
parent c1b76d8d4d
commit e3ea7f323e
5 changed files with 23 additions and 1 deletions

View File

@ -14,7 +14,7 @@
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef></mat-header-cell>
<mat-cell *matCellDef="let row;" style="text-align: right">
<button mat-button color="primary" (click)="install(row)" disabled="row.installed">
<button mat-button color="primary" (click)="install(row)" [disabled]="row.installed">
<ng-container *ngIf="row.installed">Installed</ng-container>
<ng-container *ngIf="!row.installed">Install</ng-container>
</button>

View File

@ -20,6 +20,11 @@ export class InstalledSoftwareComponent implements OnInit {
this.dataSource = new InstalledSoftwareDataSource(this.installedSoftwareService);
}
install(software) {
this.installedSoftwareService.install({
type: 'web'
});
}
}
export class InstalledSoftwareDataSource extends DataSource<any> {

View File

@ -28,4 +28,10 @@ export class InstalledSoftwareService {
}
});
}
install(software) {
const installedSoftware = this.electronService.remote.require('./installed-software.js')
.install(software);
}
}