1
0
mirror of https://github.com/dkmstr/openuds-gui.git synced 2025-03-12 08:58:21 +03:00

Added error info on login

This commit is contained in:
Adolfo Gómez García 2020-02-20 01:48:19 +01:00
parent e7db622d2f
commit 7682a041bc
2 changed files with 18 additions and 0 deletions

View File

@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core';
import { UDSApiService } from '../../uds-api.service';
import { Authenticator } from '../../types/config';
declare var django: any;
@Component({
selector: 'uds-login',
templateUrl: './login.component.html',
@ -32,6 +34,11 @@ export class LoginComponent implements OnInit {
if (this.auths.length > 0) {
this.auth.value = this.auths[0].id;
}
if (this.api.errors.length > 0) {
this.api.gui.alert(django.gettext('Errors found'), '<div>' + this.api.errors.join('</div><div>') + '</div>' );
}
}
changeAuth(auth) {

View File

@ -47,6 +47,17 @@ export class UDSApiService implements UDSApiServiceType {
return udsData.actors;
}
/**
* Actor errors. Empty array it no errors.
*
* @readonly
* @type {string[]}
* @memberof UDSApiService
*/
get errors(): string[] {
return udsData.errors;
}
/* Client enabler */
enabler(serviceId: string, transportId: string) {
const enabler = this.config.urls.enabler.replace('param1', serviceId).replace('param2', transportId);