Option to open file explorer added

This commit is contained in:
piotrpekala7
2020-01-21 12:06:26 +01:00
parent 235483dba5
commit f49cc1960c
4 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,4 @@
<button mat-menu-item (click)="open()">
<mat-icon>tab</mat-icon>
<span>Open file explorer</span>
</button>

View File

@ -0,0 +1,24 @@
import { Component, OnInit, Input } from '@angular/core';
import { Node } from '../../../../../cartography/models/node';
import { Server } from '../../../../../models/server';
import { ElectronService } from 'ngx-electron';
@Component({
selector: 'app-open-file-explorer-action',
templateUrl: './open-file-explorer-action.component.html'
})
export class OpenFileExplorerActionComponent implements OnInit {
@Input() server: Server;
@Input() node: Node;
constructor(
private electronService: ElectronService
) {}
ngOnInit() {}
open() {
this.electronService.shell.openItem(this.node.node_directory);
}
}

View File

@ -25,6 +25,11 @@
[server]="server"
[node]="nodes[0]"
></app-console-device-action-browser>
<app-open-file-explorer-action
*ngIf="!projectService.isReadOnly(project) && nodes.length===1 && isElectronApp"
[server]="server"
[node]="nodes[0]"
></app-open-file-explorer-action>
<app-change-symbol-action
*ngIf="!projectService.isReadOnly(project) && nodes.length===1"
[server]="server"