wifictld-analyzer/webroot/js/data.js

33 lines
769 B
JavaScript
Raw Permalink Normal View History

2019-03-01 10:54:19 +01:00
store.commit('setEvent', {
subject:"wifictld_pkg",
callback: (state, msg) => {
// add to ap list
const ip = msg.body.ip;
if(state.controller._ap[ip] === undefined){
state.controller.ap.push(ip)
state.controller._ap[ip] = null;
}
// add clients
const client = msg.body.msg.client;
if (state.controller.clients[client.addr] === undefined) {
state.controller._clients.push(client.addr)
}
client.ap = ip;
state.controller.clients[client.addr] = client;
}
})
2019-03-08 17:09:01 +01:00
VueNativeSock.default.install(Vue, `//${location.host}${location.pathname}ws`, {
store: store,
reconnection: true,
reconnectionDelay: 5000,
format: 'json',
})
getJSON(`//${location.host}${location.pathname}data.json`).then(function(data){
store.commit('initData',data);
})