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

@ -264,6 +264,7 @@ import { SystemStatusComponent } from './components/system-status/system-status.
import { StatusInfoComponent } from './components/system-status/status-info/status-info.component';
import { StatusChartComponent } from './components/system-status/status-chart/status-chart.component';
import { NgCircleProgressModule } from 'ng-circle-progress';
import { OpenFileExplorerActionComponent } from './components/project-map/context-menu/actions/open-file-explorer/open-file-explorer-action.component';
if (environment.production) {
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
@ -444,7 +445,8 @@ if (environment.production) {
DirectLinkComponent,
SystemStatusComponent,
StatusInfoComponent,
StatusChartComponent
StatusChartComponent,
OpenFileExplorerActionComponent
],
imports: [
BrowserModule,

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"