diff --git a/src/App.js b/src/App.js index 8d45bc9..7d16124 100644 --- a/src/App.js +++ b/src/App.js @@ -40,9 +40,13 @@ const theme = deepMerge(grommet, { }, }, tab: { + active: { + weight: "bold", + }, margin: { vertical: "xsmall", }, + border: undefined, }, layer: { background: "#00000000", diff --git a/src/apolloclient.js b/src/apolloclient.js index cb71dc1..3710cb4 100644 --- a/src/apolloclient.js +++ b/src/apolloclient.js @@ -55,7 +55,7 @@ const client = new ApolloClient({ ]), cache: new InMemoryCache({ possibleTypes: { - IndiVector: ["NumberVector", "SwitchVector", "TextVector", "LightVector"], + IndiVector: ["NumberVector", "SwitchVector", "TextVector", "LightVector", "BLOBVector"], }, typePolicies: { Query: { @@ -116,6 +116,8 @@ client query: NEW_PROPERTY, }) .subscribe(({ data }) => { + console.log(data.newIndiProp.id); + console.log(data.newIndiProp.vector) const res = client.readQuery({ query: GETDEVICE, variables: { id: data.newIndiProp.device.id }, @@ -126,10 +128,6 @@ client data: { device: { ...res.device, - /*drivers: - data.newProperty.name === "DRIVER_INFO" - ? data.newProperty.vector.values[3].text - : res.device.drivers,*/ connected: data.newIndiProp.name === "CONNECTION" ? data.newIndiProp.vector.values[0].switch diff --git a/src/components/indi/blob.js b/src/components/indi/blob.js new file mode 100644 index 0000000..8c8fd28 --- /dev/null +++ b/src/components/indi/blob.js @@ -0,0 +1,20 @@ +import React from "react"; +import { Box, Text } from "grommet"; +import { Camera } from "grommet-icons"; + +import { stateToColor } from "../../utils/indi"; + +const BLOBVector = ({ vector }) => { + return ( + + {vector.values.map((v) => ( + + {v.label ? `${v.label} (${v.name})` : v.name} + Binary data + + ))} + + ); +}; + +export default BLOBVector; diff --git a/src/components/indi/device.js b/src/components/indi/device.js index 95e809c..445d19b 100644 --- a/src/components/indi/device.js +++ b/src/components/indi/device.js @@ -36,6 +36,7 @@ const Device = ({ device, messages, onMessagesClosed }) => { setCurrentTab(selectedTabs[device.id] || 0); }, [device, selectedTabs]); + return ( { + const { data } = useQuery(GETDEVICES); + const [openMsg, setOpenMsg] = useState(false); + + return ( + + {data ? ( + + {data && data.devices ? ( + data.devices.map((d) => ( + : } + title={d.name} + key={d.id} + > + setOpenMsg(false)} + /> + + )) + ) : ( +
no devices
+ )} +
+ ) : null} +