diff --git a/projects/webchat/src/app/app.component.html b/projects/webchat/src/app/app.component.html index 29342a7..51304c0 100644 --- a/projects/webchat/src/app/app.component.html +++ b/projects/webchat/src/app/app.component.html @@ -1,5 +1,6 @@
{ diff --git a/projects/webchat/src/app/chat-widget/chat-widget.component.html b/projects/webchat/src/app/chat-widget/chat-widget.component.html index 03cc147..5e3567d 100644 --- a/projects/webchat/src/app/chat-widget/chat-widget.component.html +++ b/projects/webchat/src/app/chat-widget/chat-widget.component.html @@ -39,6 +39,7 @@

FenĂȘtre de chat

[isMobileSize]="isMobileSize" [storage]="storage" [socketUrl]="socketUrl" + [chatbotUrl]="chatbotUrl" [socketPath]="socketPath" [initPayload]="initPayload" [delayBetweenMessages]="delayBetweenMessages" diff --git a/projects/webchat/src/app/chat-widget/chat-widget.component.ts b/projects/webchat/src/app/chat-widget/chat-widget.component.ts index 698becb..3f11927 100644 --- a/projects/webchat/src/app/chat-widget/chat-widget.component.ts +++ b/projects/webchat/src/app/chat-widget/chat-widget.component.ts @@ -20,6 +20,7 @@ export class ChatWidgetComponent implements OnInit { @Input() public companyLogo = `https://upload.wikimedia.org/wikipedia/commons/thumb/f/fb/Logo_Minist%C3%A8re_des_Arm%C3%A9es_%282020%29.svg/520px-Logo_Minist%C3%A8re_des_Arm%C3%A9es_%282020%29.svg.png`; @Input() public userAvatar = null; @Input() public socketUrl = 'http://localhost:5500'; + @Input() public chatbotUrl: string; @Input() public socketPath = environment.socketUrl; @Input() public initPayload = '/phrase_presentation'; @Input() public feedbackPayload = '/phrase_feedback'; diff --git a/projects/webchat/src/app/core/services/webchat.service.ts b/projects/webchat/src/app/core/services/webchat.service.ts index 1c87334..c363e71 100644 --- a/projects/webchat/src/app/core/services/webchat.service.ts +++ b/projects/webchat/src/app/core/services/webchat.service.ts @@ -13,6 +13,7 @@ const ACCESSIBILITY_NAME = 'chat_accessibility'; export class WebchatService { private _url; + private _apiUrl; private _initPayload: string; private _socket: any; @@ -28,8 +29,9 @@ export class WebchatService { constructor(private _http: HttpClient) { } - public connect(url: string, path: string, initPayload: string) { + public connect(url: string, path: string, initPayload: string, apiUrl: string) { this._url = url; + this._apiUrl = apiUrl; this._initPayload = initPayload; if (this._socket) { this._socket.disconnect(); @@ -159,7 +161,7 @@ export class WebchatService { params = params.append('getResponses', getResponses.toString()); } - return this._http.get(`${this._url}/api/public/intents`, {params}); + return this._http.get(`${this._apiUrl}/api/public/intents`, {params}); } public getSessionId() {