From 3e1dd27f032201b8ab2a7f1482ef115fdd1b2aca Mon Sep 17 00:00:00 2001 From: Alexander Myasoedov Date: Mon, 17 Feb 2025 19:47:35 +0200 Subject: [PATCH] fix(add latency param): --- agentic_security/static/main.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/agentic_security/static/main.js b/agentic_security/static/main.js index 95ef509..fa96844 100644 --- a/agentic_security/static/main.js +++ b/agentic_security/static/main.js @@ -4,6 +4,7 @@ var app = new Vue({ progressWidth: '0%', modelSpec: LLM_SPECS[0], budget: 50, + latency: 0, isFocused: false, // Tracks if the textarea is focused showParams: false, showResetConfirmation: false, @@ -121,6 +122,7 @@ var app = new Vue({ const state = { modelSpec: this.modelSpec, budget: this.budget, + selectedConfig: this.selectedConfig, dataConfig: this.dataConfig, optimize: this.optimize, enableChartDiagram: this.enableChartDiagram, @@ -139,6 +141,7 @@ var app = new Vue({ this.optimize = state.optimize; this.enableChartDiagram = state.enableChartDiagram; this.enableMultiStepAttack = state.enableMultiStepAttack; + this.selectedConfig = state.selectedConfig; } }, resetState() { @@ -198,10 +201,11 @@ var app = new Vue({ body: JSON.stringify(payload), }); console.log(response); - let txt = await response.text(); + let r = await response.json(); + this.latency = r.elapsed; if (!response.ok) { this.updateStatusDot(false); - this.errorMsg = 'Integration verification failed:' + txt; + this.errorMsg = 'Integration verification failed:' + JSON.stringify(r); } else { this.errorMsg = ''; this.updateStatusDot(true);