Commit f749fa29 authored by h3remi7's avatar h3remi7

add select install dir

parent b99d8788
......@@ -104,7 +104,7 @@
<div class="input-group">
<input type="text" [(ngModel)]="appsService.installConfig.installDir" name="installDir" class="form-control" placeholder="安装位置">
<span class="input-group-btn">
<button class="btn btn-secondary" type="button">浏览</button>
<button (click)="openDir()" class="btn btn-secondary" type="button">浏览</button>
</span>
</div>
</div>
......
......@@ -14,6 +14,8 @@ declare var $;
export class AppDetailComponent {
platform = process.platform;
electron = window['System']._nodeRequire('electron');
constructor(private appsService: AppsService, private routingService: RoutingService ) {
}
_currentApp;
......@@ -126,8 +128,13 @@ export class AppDetailComponent {
}
$("#install-modal").modal("hide");
}
openDir() {
let dir = this.electron.remote.dialog.showOpenDialog({properties: ['openFile', 'openDirectory']});
console.log(dir);
this.appsService.installConfig.installDir = dir[0];
return dir[0];
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment