Visualize clients going offline + Add mqtt connection details to config
This commit is contained in:
parent
b2f1e2b07c
commit
964e3c0305
4 changed files with 13 additions and 3 deletions
|
|
@ -4,7 +4,8 @@ import * as utils from './utils';
|
||||||
const config : Config = {
|
const config : Config = {
|
||||||
space: {
|
space: {
|
||||||
name: "RZL",
|
name: "RZL",
|
||||||
color: "orange"
|
color: "orange",
|
||||||
|
mqtt: "ws://map.rzl:1884"
|
||||||
},
|
},
|
||||||
topics: {
|
topics: {
|
||||||
led_stahltraeger: {
|
led_stahltraeger: {
|
||||||
|
|
|
||||||
|
|
@ -89,4 +89,4 @@ store.subscribe(() => ReactDOM.render(<App state={store.getState()} />, document
|
||||||
|
|
||||||
store.dispatch({type:null});
|
store.dispatch({type:null});
|
||||||
|
|
||||||
connectMqtt("ws://172.22.36.207:1884", store);
|
connectMqtt(Config.space.mqtt, store);
|
||||||
|
|
|
||||||
|
|
@ -23,4 +23,13 @@ export default function connectMqtt(url: string, store: Store<*,*>) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
client.on("offline", () => {
|
||||||
|
store.dispatch({ type: null });
|
||||||
|
});
|
||||||
|
client.on("close", () => {
|
||||||
|
store.dispatch({ type: null });
|
||||||
|
});
|
||||||
|
client.on("reconnect", () => {
|
||||||
|
store.dispatch({ type: null });
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ declare type ControlUI = {
|
||||||
|
|
||||||
// DROPDOWN optional properties
|
// DROPDOWN optional properties
|
||||||
options?: Map<string,any>, //options for dropDown
|
options?: Map<string,any>, //options for dropDown
|
||||||
renderValue?: (value: string) => string
|
renderValue?: (value: string) => string,
|
||||||
|
|
||||||
// SLIDER optional properties
|
// SLIDER optional properties
|
||||||
min?: number,
|
min?: number,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue