diff --git a/README.md b/README.md index 9c3f726..aa025ef 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,6 @@ - chat - sort Cards by most recently running - EditCard.js can probably derive the list of games that support SpawningPool from Gateway, who can learn it based on gameApis reporting the feature -- Allow disabling SpawningPool instances (visible only in Edit Mode) # Dev Guide diff --git a/gateway/src/routes/spawningPool.js b/gateway/src/routes/spawningPool.js index 9a22096..6a1d20b 100755 --- a/gateway/src/routes/spawningPool.js +++ b/gateway/src/routes/spawningPool.js @@ -30,6 +30,9 @@ async function initSpawningPool() { const spawningPools = await readSpawningPoolConfig(); for (let childApi of Object.values(spawningPools)) { console.log("Checking child gameApi ", childApi.gameId); + if (childApi.disabled) { + continue; + } try { const { data } = await axios.get( `http://localhost:${childApi.apiPort}/control` diff --git a/ui/src/components/EditCard.js b/ui/src/components/EditCard.js index 26da0b4..dd8318e 100755 --- a/ui/src/components/EditCard.js +++ b/ui/src/components/EditCard.js @@ -20,6 +20,8 @@ import { css } from "@emotion/react"; import { TextField } from "@mui/material"; import { useStaticQuery, graphql } from "gatsby"; import Autocomplete from "@mui/material/Autocomplete"; +import Switch from "@mui/material/Switch"; +import FormControlLabel from "@mui/material/FormControlLabel"; const gameApiOptions = [ { @@ -236,6 +238,15 @@ export default function EditCard({ + patchSettings({ disabled: !settings.disabled })} + checked={!settings.disabled} + /> + } + label="Enabled" + />