Skip to content

Commit

Permalink
chore: disable view inferences button if user is a windows user (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristencheung authored Jan 24, 2025
1 parent 160a0f8 commit 2709764
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
- feat: support MySQL database connections [#722](https://github.com/hypermodeinc/modus/pull/722)
- chore: refactoring / tests [#723](https://github.com/hypermodeinc/modus/pull/723)
- feat: check for Binaryen installation [#725](https://github.com/hypermodeinc/modus/pull/725)
- chore: show inferences error in api explorer
[#726](https://github.com/hypermodeinc/modus/pull/726)

## 2025-01-09 - CLI 0.16.6

Expand Down
15 changes: 15 additions & 0 deletions runtime/explorer/content/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ if (!rootElement) {
}
const root = createRoot(rootElement);

type InferenceError = {
message: string;
status: number;
};

function App() {
const modusTheme = {
background: "150 60% 3%",
Expand All @@ -35,11 +40,20 @@ function App() {
};
const [endpoints, setEndpoints] = useState<string[]>(["http://localhost:8686/graphql"]);
const [inferences, setInferences] = useState<any[]>([]);
const [inferenceError, setInferenceError] = useState<InferenceError | undefined>();

useEffect(() => {
const fetchInferences = async () => {
try {
const response = await fetch("/explorer/api/inferences");

if (!response.ok) {
setInferenceError({
message: response.statusText,
status: response.status,
});
return;
}
const data = await response.json();

setInferences(JSON.parse(JSON.stringify(data || {})));
Expand Down Expand Up @@ -77,6 +91,7 @@ function App() {
<ApiExplorer
endpoints={endpoints}
inferences={inferences}
inferenceError={inferenceError}
theme={modusTheme}
title={
<div className="flex items-center">
Expand Down
8 changes: 4 additions & 4 deletions runtime/explorer/content/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion runtime/explorer/content/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@hypermode/react-api-explorer": "^1.0.0-alpha.20",
"@hypermode/react-api-explorer": "^1.0.0-alpha.23",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
Expand Down

0 comments on commit 2709764

Please sign in to comment.