Added favicon and device suppression
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 1.5 KiB |
+26
-5
@@ -55,7 +55,13 @@ const client = new ApolloClient({
|
|||||||
]),
|
]),
|
||||||
cache: new InMemoryCache({
|
cache: new InMemoryCache({
|
||||||
possibleTypes: {
|
possibleTypes: {
|
||||||
IndiVector: ["NumberVector", "SwitchVector", "TextVector", "LightVector", "BLOBVector"],
|
IndiVector: [
|
||||||
|
"NumberVector",
|
||||||
|
"SwitchVector",
|
||||||
|
"TextVector",
|
||||||
|
"LightVector",
|
||||||
|
"BLOBVector",
|
||||||
|
],
|
||||||
},
|
},
|
||||||
typePolicies: {
|
typePolicies: {
|
||||||
Query: {
|
Query: {
|
||||||
@@ -139,8 +145,26 @@ const GETDEVICE = gql`
|
|||||||
${propertyVectorFragment}
|
${propertyVectorFragment}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const DEL_DEVICE = gql`
|
||||||
|
subscription delIndiDevice {
|
||||||
|
delIndiDevice
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
client
|
||||||
|
.subscribe({
|
||||||
|
query: DEL_DEVICE,
|
||||||
|
})
|
||||||
|
.subscribe(({ data }) => {
|
||||||
|
const res = client.readQuery({ query: GETDEVICES });
|
||||||
|
client.writeQuery({
|
||||||
|
query: GETDEVICES,
|
||||||
|
data: { devices: res.devices.filter(d => d.id !== data.delIndiDevice) },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
const NEW_PROPERTY = gql`
|
const NEW_PROPERTY = gql`
|
||||||
subscription newProperty {
|
subscription newIndiProp {
|
||||||
newIndiProp {
|
newIndiProp {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
@@ -159,8 +183,6 @@ client
|
|||||||
query: NEW_PROPERTY,
|
query: NEW_PROPERTY,
|
||||||
})
|
})
|
||||||
.subscribe(({ data }) => {
|
.subscribe(({ data }) => {
|
||||||
console.log(data.newIndiProp.id);
|
|
||||||
console.log(data.newIndiProp.vector)
|
|
||||||
const res = client.readQuery({
|
const res = client.readQuery({
|
||||||
query: GETDEVICE,
|
query: GETDEVICE,
|
||||||
variables: { id: data.newIndiProp.device.id },
|
variables: { id: data.newIndiProp.device.id },
|
||||||
@@ -247,7 +269,6 @@ client
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
console.log(res);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user