- The public server is provided for convenience, but may not be as
- reliable as a local server, depending on the current load and
- availability.
+ setStanWasmServerUrl(e.target.value)}
+ />
)}
-
-
-
+
+
+ {choice === "local" && (
+
+
To start a local compilation server:
+
+
+ docker run -p 8083:8080 -it magland/stan-wasm-server:latest
+
+
+
+ )}
+ {choice === "public" && (
+
+
+ The public server is provided for convenience, but may not be as
+ reliable as a local server, depending on the current load and
+ availability.
+
+
+ )}
+
+
+
);
};
diff --git a/gui/src/app/pages/HomePage/TopBar.tsx b/gui/src/app/pages/HomePage/TopBar.tsx
index 918bd37d..7936c32c 100644
--- a/gui/src/app/pages/HomePage/TopBar.tsx
+++ b/gui/src/app/pages/HomePage/TopBar.tsx
@@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import CompilationServerConnectionControl from "@SpStanc/CompilationServerConnectionControl";
-import { SmallIconButton } from "@fi-sci/misc";
import { Menu, QuestionMark } from "@mui/icons-material";
import AppBar from "@mui/material/AppBar";
import IconButton from "@mui/material/IconButton";
@@ -35,18 +34,18 @@ const TopBar: FunctionComponent = ({ title, onSetCollapsed }) => {
Stan Playground - {title}
-
- }
- onClick={() => {
- window.open(
- "https://github.com/flatironinstitute/stan-playground",
- "_blank",
- );
- }}
- title={`About Stan Playground`}
- />
-
+
+ window.open(
+ "https://github.com/flatironinstitute/stan-playground",
+ "_blank",
+ )
+ }
+ >
+
+
);
diff --git a/gui/src/localStyles.css b/gui/src/localStyles.css
index 435a10bf..509689e1 100644
--- a/gui/src/localStyles.css
+++ b/gui/src/localStyles.css
@@ -17,18 +17,6 @@
padding: 10px;
}
-.CompilationServerConnectionPane {
- font-size: 12px;
-}
-
-.CompilationServerConnectionPane .connected {
- color: lightgreen;
-}
-
-.CompilationServerConnectionPane .disconnected {
- color: pink;
-}
-
/* Compilation Results (StanCompileResultWindow) */
.ErrorsWindow {
height: 100%;
From 1f7f012aa1370bd29e823232334b129945430062 Mon Sep 17 00:00:00 2001
From: Brian Ward
Date: Wed, 31 Jul 2024 15:17:36 +0000
Subject: [PATCH 2/5] Fix MUI imports
---
gui/src/app/App.tsx | 2 +-
.../ConfigureCompilationServerDialog.tsx | 14 ++++++--------
gui/src/app/pages/HomePage/Sidebar.tsx | 3 ++-
3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/gui/src/app/App.tsx b/gui/src/app/App.tsx
index 7899515e..67a3efa9 100644
--- a/gui/src/app/App.tsx
+++ b/gui/src/app/App.tsx
@@ -1,4 +1,4 @@
-import { createTheme } from "@mui/material";
+import createTheme from "@mui/material/styles/createTheme";
import { ThemeProvider } from "@mui/system";
import ProjectContextProvider from "@SpCore/ProjectContextProvider";
import HomePage from "@SpPages/HomePage";
diff --git a/gui/src/app/CompilationServerConnectionControl/ConfigureCompilationServerDialog.tsx b/gui/src/app/CompilationServerConnectionControl/ConfigureCompilationServerDialog.tsx
index 781f7b71..83708a36 100644
--- a/gui/src/app/CompilationServerConnectionControl/ConfigureCompilationServerDialog.tsx
+++ b/gui/src/app/CompilationServerConnectionControl/ConfigureCompilationServerDialog.tsx
@@ -3,14 +3,12 @@ import Link from "@mui/material/Link";
import { FunctionComponent, useCallback, useState } from "react";
import { localUrl, publicUrl } from "./CompilationServerConnectionControl";
import FormControl from "@mui/material/FormControl";
-import {
- Divider,
- FormControlLabel,
- FormLabel,
- Radio,
- RadioGroup,
- TextField,
-} from "@mui/material";
+import Divider from "@mui/material/Divider";
+import FormLabel from "@mui/material/FormLabel";
+import RadioGroup from "@mui/material/RadioGroup";
+import FormControlLabel from "@mui/material/FormControlLabel";
+import Radio from "@mui/material/Radio";
+import TextField from "@mui/material/TextField";
type ServerType = "public" | "local" | "custom";
diff --git a/gui/src/app/pages/HomePage/Sidebar.tsx b/gui/src/app/pages/HomePage/Sidebar.tsx
index eceeb4b7..529cb0c4 100644
--- a/gui/src/app/pages/HomePage/Sidebar.tsx
+++ b/gui/src/app/pages/HomePage/Sidebar.tsx
@@ -5,11 +5,12 @@ import { ProjectContext } from "@SpCore/ProjectContextProvider";
import { modelHasUnsavedChanges } from "@SpCore/ProjectDataModel";
import LoadProjectWindow from "@SpPages/LoadProjectWindow";
import SaveProjectWindow from "@SpPages/SaveProjectWindow";
-import { List, ListItem } from "@mui/material";
import Button from "@mui/material/Button";
import Divider from "@mui/material/Divider";
import Drawer from "@mui/material/Drawer";
import Link from "@mui/material/Link";
+import List from "@mui/material/List";
+import ListItem from "@mui/material/ListItem";
import Toolbar from "@mui/material/Toolbar";
import { FunctionComponent, useContext, useMemo } from "react";
import { useNavigate } from "react-router-dom";
From fc0395e467e4a4dd956ab6cf6e58c75fddc3f585 Mon Sep 17 00:00:00 2001
From: Brian Ward
Date: Wed, 31 Jul 2024 15:38:51 +0000
Subject: [PATCH 3/5] Change retry button, show urls in descriptions
---
.../ConfigureCompilationServerDialog.tsx | 37 ++++++++-----------
gui/src/localStyles.css | 5 +++
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/gui/src/app/CompilationServerConnectionControl/ConfigureCompilationServerDialog.tsx b/gui/src/app/CompilationServerConnectionControl/ConfigureCompilationServerDialog.tsx
index 83708a36..25d511ea 100644
--- a/gui/src/app/CompilationServerConnectionControl/ConfigureCompilationServerDialog.tsx
+++ b/gui/src/app/CompilationServerConnectionControl/ConfigureCompilationServerDialog.tsx
@@ -1,5 +1,3 @@
-import Button from "@mui/material/Button";
-import Link from "@mui/material/Link";
import { FunctionComponent, useCallback, useState } from "react";
import { localUrl, publicUrl } from "./CompilationServerConnectionControl";
import FormControl from "@mui/material/FormControl";
@@ -9,6 +7,8 @@ import RadioGroup from "@mui/material/RadioGroup";
import FormControlLabel from "@mui/material/FormControlLabel";
import Radio from "@mui/material/Radio";
import TextField from "@mui/material/TextField";
+import IconButton from "@mui/material/IconButton";
+import { Refresh } from "@mui/icons-material";
type ServerType = "public" | "local" | "custom";
@@ -16,19 +16,12 @@ type ConfigureCompilationServerDialogProps = {
stanWasmServerUrl: string;
setStanWasmServerUrl: (url: string) => void;
isConnected: boolean;
- closeDialog: () => void;
onRetry: () => void;
};
const ConfigureCompilationServerDialog: FunctionComponent<
ConfigureCompilationServerDialogProps
-> = ({
- stanWasmServerUrl,
- setStanWasmServerUrl,
- isConnected,
- closeDialog,
- onRetry,
-}) => {
+> = ({ stanWasmServerUrl, setStanWasmServerUrl, isConnected, onRetry }) => {
const [choice, setChoice] = useState("custom");
const makeChoice = useCallback(
@@ -37,7 +30,9 @@ const ConfigureCompilationServerDialog: FunctionComponent<
setStanWasmServerUrl(publicUrl);
} else if (choice === "local") {
setStanWasmServerUrl(localUrl);
- } else if (choice !== "custom") {
+ } else if (choice === "custom") {
+ setStanWasmServerUrl("");
+ } else {
return;
}
setChoice(choice);
@@ -60,9 +55,9 @@ const ConfigureCompilationServerDialog: FunctionComponent<
Not connected
)}
-
- retry
-
+
+
+
- The public server is provided for convenience, but may not be as
- reliable as a local server, depending on the current load and
- availability.
+ The public server ({publicUrl}) is
+ provided for convenience, but may not be as reliable as a local
+ server, depending on the current load and availability.