From 083b645e8bd6535319490f1e4551816c8f4c32ea Mon Sep 17 00:00:00 2001 From: CopyDemon Date: Wed, 1 May 2024 12:48:40 -0700 Subject: [PATCH] use server_port from context to replace the fixed port --- .../diagnostics_display/diagnostics_display.tsx | 4 ++-- .../flowsheet_diagnostics_component.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/IDAES-UI/src/components/flowsheet_main_component/flowsheet_diagnostics_component/diagnostics_display/diagnostics_display.tsx b/IDAES-UI/src/components/flowsheet_main_component/flowsheet_diagnostics_component/diagnostics_display/diagnostics_display.tsx index f90caf5c..d8cba537 100644 --- a/IDAES-UI/src/components/flowsheet_main_component/flowsheet_diagnostics_component/diagnostics_display/diagnostics_display.tsx +++ b/IDAES-UI/src/components/flowsheet_main_component/flowsheet_diagnostics_component/diagnostics_display/diagnostics_display.tsx @@ -9,7 +9,7 @@ import css from "./diagnostics_display.module.css"; export default function DiagnosticsDisplay(props:any){ // initial context - const {diagnosticsNextStepsOutputState, setDiagnosticsNextStepsOutputState, diagnosticsRunFnNameListState, setDiagnosticsRunFnNameListState, setDiagnosticsRunnerDisplayState} = useContext(AppContext); + const {server_port,fv_id,diagnosticsNextStepsOutputState, setDiagnosticsNextStepsOutputState, diagnosticsRunFnNameListState, setDiagnosticsRunFnNameListState, setDiagnosticsRunnerDisplayState} = useContext(AppContext); // initial diagnostics data const diagnosticData = props.diagnosticData; // initial which issue from props @@ -143,7 +143,7 @@ export default function DiagnosticsDisplay(props:any){ // initial function name by remove () in function let functionName:string = whichFunction.replace("(", "").replace(")", ""); // build api call url - const post_diagnostics_runner_url:string = `http://localhost:49999/run_diagnostic`; + const post_diagnostics_runner_url:string = `http://localhost:${server_port}/run_diagnostic`; // build api call body const windowURL = new URL(window.location.href); const urlId = windowURL.searchParams.get("id"); diff --git a/IDAES-UI/src/components/flowsheet_main_component/flowsheet_diagnostics_component/flowsheet_diagnostics_component.tsx b/IDAES-UI/src/components/flowsheet_main_component/flowsheet_diagnostics_component/flowsheet_diagnostics_component.tsx index 7cc6c55a..f26a1eab 100644 --- a/IDAES-UI/src/components/flowsheet_main_component/flowsheet_diagnostics_component/flowsheet_diagnostics_component.tsx +++ b/IDAES-UI/src/components/flowsheet_main_component/flowsheet_diagnostics_component/flowsheet_diagnostics_component.tsx @@ -30,7 +30,7 @@ export default function FlowsheetDiagnostics(){ // const getDiagnosticUrl = `http://127.0.0.1:${server_port}/api/get_diagnostics`; const windowURL = new URL(window.location.href); const id = windowURL.searchParams.get("id"); - const getDiagnosticUrl = `http://localhost:49999/diagnostics?id=${id}`; + const getDiagnosticUrl = `http://localhost:${server_port}/diagnostics?id=${id}`; const fetchDiagnosticData = async (url:string) =>{ // fetch diagnostic data from end point and update to state