mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-01-31 00:23:57 +00:00
Fix install button apperance and prepare for installation support
This commit is contained in:
parent
c1b76d8d4d
commit
e3ea7f323e
@ -1,4 +1,5 @@
|
|||||||
var commandExistsSync = require('command-exists').sync;
|
var commandExistsSync = require('command-exists').sync;
|
||||||
|
var app = require('electron').app;
|
||||||
|
|
||||||
exports.getInstalledSoftware = (softwareList) => {
|
exports.getInstalledSoftware = (softwareList) => {
|
||||||
const installed = {};
|
const installed = {};
|
||||||
@ -18,3 +19,12 @@ exports.getInstalledSoftware = (softwareList) => {
|
|||||||
return installed;
|
return installed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.install = (software) => {
|
||||||
|
var type = software.type;
|
||||||
|
|
||||||
|
if (type == 'web') {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(app.getAppPath());
|
||||||
|
}
|
1
main.js
1
main.js
@ -138,6 +138,7 @@ app.on('activate', function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// In this file you can include the rest of your app's specific main process
|
// 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.
|
// code. You can also put them in separate files and require them here.
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<ng-container matColumnDef="actions">
|
<ng-container matColumnDef="actions">
|
||||||
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row;" style="text-align: right">
|
<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">Installed</ng-container>
|
||||||
<ng-container *ngIf="!row.installed">Install</ng-container>
|
<ng-container *ngIf="!row.installed">Install</ng-container>
|
||||||
</button>
|
</button>
|
||||||
|
@ -20,6 +20,11 @@ export class InstalledSoftwareComponent implements OnInit {
|
|||||||
this.dataSource = new InstalledSoftwareDataSource(this.installedSoftwareService);
|
this.dataSource = new InstalledSoftwareDataSource(this.installedSoftwareService);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install(software) {
|
||||||
|
this.installedSoftwareService.install({
|
||||||
|
type: 'web'
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class InstalledSoftwareDataSource extends DataSource<any> {
|
export class InstalledSoftwareDataSource extends DataSource<any> {
|
||||||
|
@ -28,4 +28,10 @@ export class InstalledSoftwareService {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install(software) {
|
||||||
|
const installedSoftware = this.electronService.remote.require('./installed-software.js')
|
||||||
|
.install(software);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user