Commit 9d191183 authored by Chris Hines's avatar Chris Hines
Browse files

add features to open externally

parent 335bcf2b
Pipeline #16426 passed with stages
in 9 minutes and 9 seconds
......@@ -71,6 +71,7 @@ import { OurServicesComponent } from './ourservices/ourservices.component';
import { ContactUsComponent } from './contactus/contactus.component';
import { NoaccountComponent } from './noaccount/noaccount.component';
import { WarndialogComponent } from './warndialog/warndialog.component';
import { ExterndialogComponent } from './externdialog/externdialog.component';
// import { FileExplorerModule } from './file-explorer/file-explorer.module';
......@@ -104,6 +105,7 @@ import { WarndialogComponent } from './warndialog/warndialog.component';
ContactUsComponent,
NoaccountComponent,
WarndialogComponent,
ExterndialogComponent,
],
imports: [
BrowserModule,
......
......@@ -13,6 +13,8 @@ import {BackendSelectionService} from './backend-selection.service';
import {repeat, take, takeUntil, filter, catchError, map, tap} from 'rxjs/operators';
import {timer, interval, Subject, BehaviorSubject, of} from 'rxjs';
import { ModaldialogComponent } from './modaldialog/modaldialog.component';
import { ExterndialogComponent } from './externdialog/externdialog.component';
import { WarndialogComponent } from './warndialog/warndialog.component';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
import {NotificationsService } from './notifications.service';
......@@ -65,7 +67,14 @@ export class BrowserWindowService {
let windowloc = url.replace(/\{twsproxy\}/g,this.twsproxy).replace(/twshost/g,twshost);
var authwindow = null;
if (action.client.extern !== undefined) {
console.log('windowloc', windowloc);
let dialogRef = this.dialog.open(ExterndialogComponent, {
width: '800px',
data: {'action': action, 'url': windowloc},
});
return
}
if (basicAuth) {
let authwindowloc = windowloc.replace(/^https:\/\//,'https://'+appinst.username+':'+appinst.password+'@');
authwindow = window.open(authwindowloc);
......
<h2>Open Externally</h2>
You can now open
<div><a style="white-space: nowrap" href="{{ data.url }}">{{ data.url }}</a> </div>
in {{ data.action.client.extern.app }}.
For information on opening externally please read <a href="{{ data.action.client.extern.info }}">This</a>
<div fxLayout="row" fxLayoutAlign="space-between stretch" style="width: 100%">
<button mat-button (click)="close(null)">OK</button>
</div>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ExterndialogComponent } from './externdialog.component';
describe('ExterndialogComponent', () => {
let component: ExterndialogComponent;
let fixture: ComponentFixture<ExterndialogComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ExterndialogComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(ExterndialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit, Inject } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
@Component({
selector: 'app-externdialog',
templateUrl: './externdialog.component.html',
styleUrls: ['./externdialog.component.css']
})
export class ExterndialogComponent implements OnInit {
constructor(public dialogRef: MatDialogRef<ExterndialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,) { }
ngOnInit(): void {
}
close(rv) {
this.dialogRef.close(rv);
}
}
......@@ -2,7 +2,7 @@ export class AppAction {
name: string;
paramscmd: string;
notunnel: boolean = false;
client: {cmd: string[], redir: string, usebasicauth: boolean};
client: {cmd: string[], redir: string, usebasicauth: boolean, extern: string};
states: string[]; // list of stats such as 'RUNNING' in which the action is valid. null||undefined if its always valid
postData: any; // if you need to post to the url to authenticate use this
}
......
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