diff --git a/smp-angular/proxy-config.json b/smp-angular/proxy-config.json index 5917edca58f63eb5e070bbd941c8d332b902b4ac..f5b9dfdb458593a93e9dfd9d961e32d2b0d0d5c8 100644 --- a/smp-angular/proxy-config.json +++ b/smp-angular/proxy-config.json @@ -1,6 +1,6 @@ { "/ui/**": { - "target": "http://localhost:8080/smp/", + "target": "http://192.168.99.101:7001/smp/", "changeOrigin": true, "secure": false, "logLevel": "debug" diff --git a/smp-angular/src/app/alerts/alerts.component.ts b/smp-angular/src/app/alerts/alerts.component.ts index 16fa5adf43663e8b3c196421adf51ce97c70290e..6419540a8e10bcfadf7e026f63279236e46781a0 100644 --- a/smp-angular/src/app/alerts/alerts.component.ts +++ b/smp-angular/src/app/alerts/alerts.component.ts @@ -60,8 +60,7 @@ export class AlertsComponent { timestampReportingToMinDate: Date = null; timestampReportingToMaxDate: Date = new Date(); - constructor(private http: Http, private alertService: AlertService, public dialog: MdDialog) { - + constructor(private http: Http, private alertService: AlertService, public dialog: MdDialog, private downloadService: DownloadService) { } ngOnInit() { @@ -267,7 +266,6 @@ export class AlertsComponent { this.timestampReportingFromMaxDate = event.value; } - // datatable methods onActivate(event) { @@ -311,7 +309,7 @@ export class AlertsComponent { if(!this.buttonsDisabled) { this.save(true); } else { - DownloadService.downloadNative(AlertsComponent.ALERTS_URL + "/csv" + this.getFilterPath()); + this.downloadService.downloadNative(AlertsComponent.ALERTS_URL + "/csv" + this.getFilterPath()); } } @@ -351,7 +349,6 @@ export class AlertsComponent { } return result; - } public isAlertTypeDefined(): boolean { @@ -377,7 +374,7 @@ export class AlertsComponent { this.alertService.success("The operation 'update alerts' completed successfully.", false); this.page(this.offset, this.rowLimiter.pageSize, this.orderBy, this.asc); if(withDownloadCSV) { - DownloadService.downloadNative(AlertsComponent.ALERTS_URL + "/csv"); + this.downloadService.downloadNative(AlertsComponent.ALERTS_URL + "/csv"); } }, err => { this.alertService.error("The operation 'update alerts' not completed successfully.", false); @@ -385,7 +382,7 @@ export class AlertsComponent { }); } else { if(withDownloadCSV) { - DownloadService.downloadNative(AlertsComponent.ALERTS_URL + "/csv"); + this.downloadService.downloadNative(AlertsComponent.ALERTS_URL + "/csv"); } } }); @@ -396,5 +393,4 @@ export class AlertsComponent { row.processed = !row.processed; this.rows[row.$$index] = row; } - } diff --git a/smp-angular/src/app/app.module.ts b/smp-angular/src/app/app.module.ts index 4da1f77da81ada9297c702f1896482e47fb20272..66e1ac195877aa27f74e1f80726176c78eb4d8fa 100644 --- a/smp-angular/src/app/app.module.ts +++ b/smp-angular/src/app/app.module.ts @@ -23,8 +23,6 @@ import {AppComponent} from "./app.component"; import {LoginComponent} from "./login/login.component"; import {HomeComponent} from "./home/home.component"; - - import {AuthenticatedGuard} from "./guards/authenticated.guard"; import {AuthorizedGuard} from "./guards/authorized.guard"; import {routing} from "./app.routes"; @@ -36,6 +34,7 @@ import {SecurityEventService} from "./security/security.event.service"; import {DomainService} from "./security/domain.service"; import {AlertComponent} from "./alert/alert.component"; import {AlertService} from "./alert/alert.service"; + import {ErrorLogComponent} from "./errorlog/errorlog.component"; import {FooterComponent} from "./footer/footer.component"; import {DomibusInfoService} from "./appinfo/domibusinfo.service"; @@ -61,7 +60,7 @@ import {TruststoreDialogComponent} from "./truststore/truststore-dialog/truststo import {TrustStoreUploadComponent} from "./truststore/truststore-upload/truststore-upload.component"; import {ColumnPickerComponent} from "./common/column-picker/column-picker.component"; import {PageHelperComponent} from "./common/page-helper/page-helper.component"; -import {SharedModule} from "./common/module/SharedModule";; +import {SharedModule} from "./common/module/SharedModule"; import {ClearInvalidDirective} from "./customDate/clearInvalid.directive"; import {PageHeaderComponent} from "./common/page-header/page-header.component"; import {DomainSelectorComponent} from "./common/domain-selector/domain-selector.component"; @@ -72,7 +71,7 @@ import {ServiceGroupExtensionDialogComponent} from "./servicegroup/servicegroup- import {ServicegroupMetadataDialogComponent} from "./servicegroup/servicegroup-metadata-dialog/servicegroup-metadata-dialog.component"; import {DomainDetailsDialogComponent} from "./domain/domain-details-dialog/domain-details-dialog.component"; import {UserDetailsDialogComponent} from "./user/user-details-dialog/user-details-dialog.component"; - +import {DownloadService} from "./download/download.service"; export function extendedHttpClientFactory(xhrBackend: XHRBackend, requestOptions: RequestOptions, httpEventService: HttpEventService) { return new ExtendedHttpClient(xhrBackend, requestOptions, httpEventService); @@ -166,6 +165,7 @@ export function extendedHttpClientFactory(xhrBackend: XHRBackend, requestOptions DomainService, DomibusInfoService, AlertService, + DownloadService, { provide: Http, useFactory: extendedHttpClientFactory, diff --git a/smp-angular/src/app/download/download.service.ts b/smp-angular/src/app/download/download.service.ts index 00f1159c7fad99a91ade097025650158be38921d..f81215adf26bbf8d3b2762cd1a3de0c25b981bca 100644 --- a/smp-angular/src/app/download/download.service.ts +++ b/smp-angular/src/app/download/download.service.ts @@ -1,7 +1,9 @@ +import {Injectable} from "@angular/core"; +@Injectable() export class DownloadService { - public static downloadNative(content) { + downloadNative(content) { let element = document.createElement('a'); element.setAttribute('href', content); element.style.display = 'none'; diff --git a/smp-angular/src/app/errorlog/errorlog.component.ts b/smp-angular/src/app/errorlog/errorlog.component.ts index b3ea278071c6fa497336896ef56bc677e3784c96..2e39a9cc6cc8f299a7a1820f6866f35921091493 100644 --- a/smp-angular/src/app/errorlog/errorlog.component.ts +++ b/smp-angular/src/app/errorlog/errorlog.component.ts @@ -51,7 +51,7 @@ export class ErrorLogComponent implements AfterViewInit { static readonly ERROR_LOG_URL : string = 'rest/errorlogs'; static readonly ERROR_LOG_CSV_URL : string = ErrorLogComponent.ERROR_LOG_URL + '/csv'; - constructor(private elementRef: ElementRef, private http: Http, private alertService: AlertService, public dialog: MdDialog, private renderer: Renderer2) { + constructor(private elementRef: ElementRef, private http: Http, private alertService: AlertService, public dialog: MdDialog, private renderer: Renderer2, private downloadService: DownloadService) { } ngOnInit() { @@ -316,7 +316,7 @@ export class ErrorLogComponent implements AfterViewInit { } saveAsCSV() { - DownloadService.downloadNative(ErrorLogComponent.ERROR_LOG_CSV_URL + this.getFilterPath()); + this.downloadService.downloadNative(ErrorLogComponent.ERROR_LOG_CSV_URL + this.getFilterPath()); } ngAfterViewInit() { diff --git a/smp-angular/src/app/messagefilter/messagefilter.component.ts b/smp-angular/src/app/messagefilter/messagefilter.component.ts index e274c4355d6ee80100b91854d3bf4d2194b4107d..6a9545d372d9584e9aebf0d421cccfe8682f20d2 100644 --- a/smp-angular/src/app/messagefilter/messagefilter.component.ts +++ b/smp-angular/src/app/messagefilter/messagefilter.component.ts @@ -42,7 +42,7 @@ export class MessageFilterComponent implements DirtyOperations { static readonly MESSAGE_FILTER_URL: string = 'rest/messagefilters'; - constructor(private http: Http, private alertService: AlertService, public dialog: MdDialog) { + constructor(private http: Http, private alertService: AlertService, public dialog: MdDialog, private downloadService: DownloadService) { } @@ -314,7 +314,7 @@ export class MessageFilterComponent implements DirtyOperations { if(this.isDirty()) { this.saveDialog(true); } else { - DownloadService.downloadNative(MessageFilterComponent.MESSAGE_FILTER_URL + "/csv"); + this.downloadService.downloadNative(MessageFilterComponent.MESSAGE_FILTER_URL + "/csv"); } } @@ -338,14 +338,14 @@ export class MessageFilterComponent implements DirtyOperations { this.alertService.success("The operation 'update message filters' completed successfully.", false); this.getBackendFiltersInfo(); if(withDownloadCSV) { - DownloadService.downloadNative(MessageFilterComponent.MESSAGE_FILTER_URL + "/csv"); + this.downloadService.downloadNative(MessageFilterComponent.MESSAGE_FILTER_URL + "/csv"); } }, err => { this.alertService.error("The operation 'update message filters' not completed successfully.", false); }); } else { if(withDownloadCSV) { - DownloadService.downloadNative(MessageFilterComponent.MESSAGE_FILTER_URL + "/csv"); + this.downloadService.downloadNative(MessageFilterComponent.MESSAGE_FILTER_URL + "/csv"); } } }); diff --git a/smp-angular/src/app/truststore/truststore.component.ts b/smp-angular/src/app/truststore/truststore.component.ts index 1ab7f94f61bb57a6a0487fc972a388a2d124d702..8f0e94f394a477e7ebd13b3fcadc4b9fe5ac2339 100644 --- a/smp-angular/src/app/truststore/truststore.component.ts +++ b/smp-angular/src/app/truststore/truststore.component.ts @@ -35,7 +35,7 @@ export class TruststoreComponent implements OnInit { static readonly TRUSTSTORE_URL: string = "rest/truststore"; static readonly TRUSTSTORE_CSV_URL: string = TruststoreComponent.TRUSTSTORE_URL + "/csv"; - constructor(private trustStoreService: TrustStoreService, public dialog: MdDialog, public alertService: AlertService) { + constructor(private trustStoreService: TrustStoreService, public dialog: MdDialog, public alertService: AlertService, private downloadService: DownloadService) { } ngOnInit(): void { @@ -125,6 +125,6 @@ export class TruststoreComponent implements OnInit { * Saves the content of the datatable into a CSV file */ saveAsCSV() { - DownloadService.downloadNative(TruststoreComponent.TRUSTSTORE_CSV_URL); + this.downloadService.downloadNative(TruststoreComponent.TRUSTSTORE_CSV_URL); } }