2018-03-30 21:22:15 -04:00
|
|
|
import { Component, OnInit } from "@angular/core";
|
|
|
|
import { ToasterService } from "angular2-toaster";
|
|
|
|
import { FE_Bridge } from "../../shared/models/integration";
|
|
|
|
import { AdminIntegrationsApiService } from "../../shared/services/admin/admin-integrations-api.service";
|
2020-10-23 07:30:20 -04:00
|
|
|
import { TranslateService } from "@ngx-translate/core";
|
2018-03-30 21:22:15 -04:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
templateUrl: "./bridges.component.html",
|
|
|
|
styleUrls: ["./bridges.component.scss"],
|
|
|
|
})
|
|
|
|
export class AdminBridgesComponent implements OnInit {
|
|
|
|
|
|
|
|
public isLoading = true;
|
|
|
|
public bridges: FE_Bridge<any>[];
|
|
|
|
|
|
|
|
constructor(private adminIntegrations: AdminIntegrationsApiService,
|
2021-09-01 19:01:01 -04:00
|
|
|
private toaster: ToasterService, public translate: TranslateService) {
|
2020-10-23 07:30:20 -04:00
|
|
|
this.translate = translate;
|
2018-03-30 21:22:15 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public ngOnInit() {
|
|
|
|
this.adminIntegrations.getAllBridges().then(bridges => {
|
|
|
|
this.bridges = bridges.filter(b => b.isEnabled);
|
|
|
|
this.isLoading = false;
|
|
|
|
}).catch(err => {
|
|
|
|
console.error(err);
|
2021-09-01 19:01:01 -04:00
|
|
|
this.translate.get('Failed to load bridges').subscribe((res: string) => {
|
|
|
|
this.toaster.pop("error", res);
|
|
|
|
});
|
2018-03-30 21:22:15 -04:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|