Skip to content

Commit

Permalink
use post request
Browse files Browse the repository at this point in the history
  • Loading branch information
lakhoune committed Dec 10, 2023
1 parent 16e1688 commit ab84fb8
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/statistics/bot-statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,21 +448,15 @@ class BotStats extends LitElement {

async fetchConversationModel(botName) {
document.getElementById("pm-res").querySelector("svg")?.remove();
const botManagerEndpointInput = this.configMap
.get("sbm-endpoint")
.toString();
const botModel = this.y.getMap("data").get("model");
const pm4botsEndpointInput = this.configMap
.get("pm4bots-endpoint")
.toString();
const eventLogEndpointInput = this.configMap
.get("event-log-endpoint")
.toString();

if (
!botManagerEndpointInput ||
!pm4botsEndpointInput ||
!eventLogEndpointInput
) {
if (!pm4botsEndpointInput || !eventLogEndpointInput) {
this.alertMessage =
"Make sure to configure the endpoints using the button on the top right";
return;
Expand All @@ -473,17 +467,22 @@ class BotStats extends LitElement {
botName,
"petri-net"
);
url += `?bot-manager-url=${botManagerEndpointInput}`;
url += `&event-log-url=${eventLogEndpointInput}`;

url += `?event-log-url=${eventLogEndpointInput}`;
url += `&enhance=${true}`;

try {
const response = await fetch(url, {
method: "POST",
timeout: 10000,
headers: {
"Access-Control-Allow-Origin": "*",
Accept: "text/html",
"Content-Type": "application/json",
},
body: JSON.stringify({
"bot-model": botModel,
}),
});
if (!response.ok) {
try {
Expand Down

0 comments on commit ab84fb8

Please sign in to comment.