fix demo index

This commit is contained in:
Eugenio Romano
2016-08-25 11:47:49 +01:00
parent bec481e81e
commit 4406024330
6 changed files with 77 additions and 74 deletions

View File

@@ -32,12 +32,12 @@ import {
@Component({
selector: 'alfresco-search-demo',
template: `<label for="token"><b>Insert a valid access token / ticket:</b></label><br>
<input id="token" type="text" size="48" (change)="updateToken()" [(ngModel)]="token"><br>
<label for="token"><b>Insert the ip of your Alfresco instance:</b></label><br>
<input id="token" type="text" size="48" (change)="updateHost()" [(ngModel)]="host"><br><br>
template: `<label for="ticket"><b>Insert a valid access ticket / ticket:</b></label><br>
<input id="ticket" type="text" size="48" (change)="updateticket()" [(ngModel)]="ticket"><br>
<label for="host"><b>Insert the ip of your Alfresco instance:</b></label><br>
<input id="host" type="text" size="48" (change)="updateHost()" [(ngModel)]="ecmHost"><br><br>
<div *ngIf="!authenticated" style="color:#FF2323">
Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid token to perform
Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid ticket to perform
operations.
</div>
<hr>
@@ -60,13 +60,14 @@ class SearchDemo implements OnInit {
public ecmHost: string = 'http://devproducts-platform.alfresco.me';
token: string;
ticket: string;
constructor(private authService: AlfrescoAuthenticationService,
private settingsService: AlfrescoSettingsService,
translation: AlfrescoTranslationService) {
settingsService.ecmHost = this.ecmHost;
settingsService.setProviders('ECM');
translation.addTranslationFolder();
}
@@ -82,9 +83,9 @@ class SearchDemo implements OnInit {
login() {
this.authService.login('admin', 'admin').subscribe(
token => {
console.log(token);
this.token = token;
ticket => {
console.log(ticket);
this.ticket = this.authService.getTicketEcm();
this.authenticated = true;
},
error => {