List the enabled bots on the go-neb page

This commit is contained in:
Travis Ralston 2018-03-23 20:15:51 -06:00
parent 51ea270fba
commit 42315de8df
2 changed files with 11 additions and 1 deletions

View File

@ -13,6 +13,7 @@
<thead>
<tr>
<th>Name</th>
<th>Enabled Bots</th>
<th class="text-center" style="width: 120px;">Actions</th>
</tr>
</thead>
@ -25,6 +26,9 @@
{{ neb.upstreamId ? "matrix.org's go-neb" : "Self-hosted go-neb" }}
<span class="text-muted" style="display: inline-block;" *ngIf="!neb.upstreamId">({{ neb.adminUrl }})</span>
</td>
<td>
{{ getEnabledBotsString(neb) }}
</td>
<td class="text-center">
<span class="appsvcConfigButton" (click)="showAppserviceConfig(neb)"
*ngIf="!neb.upstreamId">

View File

@ -24,7 +24,7 @@ export class AdminNebComponent {
private appserviceApi: AdminAppserviceApiService,
private toaster: ToasterService,
private router: Router,
private activatedRoute:ActivatedRoute) {
private activatedRoute: ActivatedRoute) {
this.reload().then(() => this.isLoading = false).catch(error => {
console.error(error);
@ -71,6 +71,12 @@ export class AdminNebComponent {
console.log(neb);
}
public getEnabledBotsString(neb: FE_NebConfiguration): string {
const result = neb.integrations.filter(i => i.isEnabled).map(i => i.displayName).join(", ");
if (!result) return "None";
return result;
}
public addSelfHostedNeb() {
this.router.navigate(["new", "selfhosted"], {relativeTo: this.activatedRoute});
}