fix ws send; attempt to fix missing contractsState in ws
This commit is contained in:
parent
de01a5f9a3
commit
f452357c29
|
@ -50,24 +50,28 @@ class Server {
|
|||
});
|
||||
});
|
||||
|
||||
app.ws('/dashboard', function(ws, req) {
|
||||
app.ws('/embark/dashboard', function(ws, req) {
|
||||
let dashboardState = { contractsState: [], environment: "", status: "", availableServices: [] };
|
||||
|
||||
// TODO: doesn't feel quite right, should be refactored into a shared
|
||||
// dashboard state
|
||||
self.events.request('setDashboardState');
|
||||
|
||||
self.events.on('contractsState', (contracts) => {
|
||||
dashboardState.contractsState = [];
|
||||
|
||||
contracts.forEach(function (row) {
|
||||
dashboardState.contractsState.push({contractName: row[0], address: row[1], status: row[2]});
|
||||
});
|
||||
ws.send(dashboardState);
|
||||
ws.send(JSON.stringify(dashboardState));
|
||||
});
|
||||
self.events.on('status', (status) => {
|
||||
dashboardState.status = status;
|
||||
ws.send(dashboardState);
|
||||
ws.send(JSON.stringify(dashboardState));
|
||||
});
|
||||
self.events.on('servicesState', (servicesState) => {
|
||||
dashboardState.availableServices = servicesState;
|
||||
ws.send(dashboardState);
|
||||
ws.send(JSON.stringify(dashboardState));
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
pragma solidity ^0.4.17;
|
||||
contract AnotherStorage {
|
||||
|
||||
address public simpleStorageAddress;
|
||||
address simpleStorageAddress2;
|
||||
|
||||
|
|
Loading…
Reference in New Issue