diff --git a/src/app/app.module.ts b/src/app/app.module.ts index a9dfdd09..07f3c1fb 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -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, diff --git a/src/app/components/project-map/context-menu/actions/open-file-explorer/open-file-explorer-action.component.html b/src/app/components/project-map/context-menu/actions/open-file-explorer/open-file-explorer-action.component.html new file mode 100644 index 00000000..e3f6f301 --- /dev/null +++ b/src/app/components/project-map/context-menu/actions/open-file-explorer/open-file-explorer-action.component.html @@ -0,0 +1,4 @@ + diff --git a/src/app/components/project-map/context-menu/actions/open-file-explorer/open-file-explorer-action.component.ts b/src/app/components/project-map/context-menu/actions/open-file-explorer/open-file-explorer-action.component.ts new file mode 100644 index 00000000..8fb028f4 --- /dev/null +++ b/src/app/components/project-map/context-menu/actions/open-file-explorer/open-file-explorer-action.component.ts @@ -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); + } +} diff --git a/src/app/components/project-map/context-menu/context-menu.component.html b/src/app/components/project-map/context-menu/context-menu.component.html index d696b14d..3bc02127 100644 --- a/src/app/components/project-map/context-menu/context-menu.component.html +++ b/src/app/components/project-map/context-menu/context-menu.component.html @@ -25,6 +25,11 @@ [server]="server" [node]="nodes[0]" > +