fix(add latency param):

This commit is contained in:
Alexander Myasoedov
2025-02-17 19:47:35 +02:00
parent a7f61af921
commit 3e1dd27f03
+6 -2
View File
@@ -4,6 +4,7 @@ var app = new Vue({
progressWidth: '0%', progressWidth: '0%',
modelSpec: LLM_SPECS[0], modelSpec: LLM_SPECS[0],
budget: 50, budget: 50,
latency: 0,
isFocused: false, // Tracks if the textarea is focused isFocused: false, // Tracks if the textarea is focused
showParams: false, showParams: false,
showResetConfirmation: false, showResetConfirmation: false,
@@ -121,6 +122,7 @@ var app = new Vue({
const state = { const state = {
modelSpec: this.modelSpec, modelSpec: this.modelSpec,
budget: this.budget, budget: this.budget,
selectedConfig: this.selectedConfig,
dataConfig: this.dataConfig, dataConfig: this.dataConfig,
optimize: this.optimize, optimize: this.optimize,
enableChartDiagram: this.enableChartDiagram, enableChartDiagram: this.enableChartDiagram,
@@ -139,6 +141,7 @@ var app = new Vue({
this.optimize = state.optimize; this.optimize = state.optimize;
this.enableChartDiagram = state.enableChartDiagram; this.enableChartDiagram = state.enableChartDiagram;
this.enableMultiStepAttack = state.enableMultiStepAttack; this.enableMultiStepAttack = state.enableMultiStepAttack;
this.selectedConfig = state.selectedConfig;
} }
}, },
resetState() { resetState() {
@@ -198,10 +201,11 @@ var app = new Vue({
body: JSON.stringify(payload), body: JSON.stringify(payload),
}); });
console.log(response); console.log(response);
let txt = await response.text(); let r = await response.json();
this.latency = r.elapsed;
if (!response.ok) { if (!response.ok) {
this.updateStatusDot(false); this.updateStatusDot(false);
this.errorMsg = 'Integration verification failed:' + txt; this.errorMsg = 'Integration verification failed:' + JSON.stringify(r);
} else { } else {
this.errorMsg = ''; this.errorMsg = '';
this.updateStatusDot(true); this.updateStatusDot(true);