Skip to content

Commit

Permalink
use server_port from context to replace the fixed port
Browse files Browse the repository at this point in the history
  • Loading branch information
CopyDemon committed May 1, 2024
1 parent 4a2f5a2 commit 083b645
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 083b645

Please sign in to comment.