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

@ -1,4 +1,5 @@
var commandExistsSync = require('command-exists').sync;
var app = require('electron').app;
exports.getInstalledSoftware = (softwareList) => {
const installed = {};
@ -18,3 +19,12 @@ exports.getInstalledSoftware = (softwareList) => {
return installed;
}
exports.install = (software) => {
var type = software.type;
if (type == 'web') {
}
console.log(app.getAppPath());
}

View File

@ -138,6 +138,7 @@ app.on('activate', function () {
}
});
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

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);
}
}