From 5ee3d8b1d3b7ae33380a6559759dc9a7f5898ae5 Mon Sep 17 00:00:00 2001 From: lakhoune Date: Sun, 4 Feb 2024 12:28:52 +0100 Subject: [PATCH] use post --- src/statistics/bot-statistics.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/statistics/bot-statistics.js b/src/statistics/bot-statistics.js index d9b4fc6..1b112ee 100644 --- a/src/statistics/bot-statistics.js +++ b/src/statistics/bot-statistics.js @@ -441,6 +441,8 @@ class BotStats extends LitElement { .get("event-log-endpoint") .toString(); + const botModel = this.y.getMap("data").get('model') + if ( !botManagerEndpointInput || !pm4botsEndpointInput || @@ -457,13 +459,17 @@ class BotStats extends LitElement { 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 { const body = await response.json(); @@ -528,6 +534,8 @@ class BotStats extends LitElement { .get("event-log-endpoint") .toString(); + const botModel = this.y.getMap("data").get('model') + if ( !botManagerEndpointInput || !pm4botsEndpointInput || @@ -549,11 +557,17 @@ class BotStats extends LitElement { 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) {