-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mass style correction (eslint) and reuse of some components.
The issue related to the loading display is also resolved while the metrics are reanalyzed.
- Loading branch information
Showing
85 changed files
with
2,285 additions
and
2,431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
test/*.conf.js | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,3 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"extends": "eslint:recommended", | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"mocha": true, | ||
"es6": true | ||
}, | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"modules": true, | ||
"jsx": true | ||
} | ||
}, | ||
"globals": {}, | ||
"rules": { | ||
"no-empty": 0, | ||
"no-console": 0, | ||
"no-empty-pattern": 0, | ||
"no-unused-vars": [0, { "varsIgnorePattern": "^h$" }], | ||
"no-cond-assign": 1, | ||
"semi": 2, | ||
"camelcase": 0, | ||
"comma-style": 2, | ||
"comma-dangle": [2, "never"], | ||
"indent": [2, 2, {"SwitchCase": 1}], | ||
"no-mixed-spaces-and-tabs": [2, "smart-tabs"], | ||
"no-trailing-spaces": [2, { "skipBlankLines": true }], | ||
"max-nested-callbacks": [2, 3], | ||
"no-eval": 2, | ||
"no-implied-eval": 2, | ||
"no-new-func": 2, | ||
"guard-for-in": 2, | ||
"eqeqeq": 1, | ||
"no-else-return": 2, | ||
"no-redeclare": 2, | ||
"no-dupe-keys": 2, | ||
"radix": 2, | ||
"strict": [2, "never"], | ||
"no-shadow": 0, | ||
"no-delete-var": 2, | ||
"no-undef-init": 2, | ||
"no-shadow-restricted-names": 2, | ||
"handle-callback-err": 0, | ||
"no-lonely-if": 2, | ||
"keyword-spacing": 2, | ||
"constructor-super": 2, | ||
"no-this-before-super": 2, | ||
"no-dupe-class-members": 2, | ||
"no-const-assign": 2, | ||
"prefer-spread": 2, | ||
"no-useless-concat": 2, | ||
"no-var": 2, | ||
"object-shorthand": 2, | ||
"prefer-arrow-callback": 2 | ||
} | ||
"extends": "eslint-config-synacor" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
import { | ||
IFACE_CHANGE, | ||
STATION_SET, | ||
IFACES_LOAD, | ||
TIMER_STOP | ||
IFACE_CHANGE, | ||
STATION_SET, | ||
IFACES_LOAD, | ||
TIMER_STOP | ||
} from './alignConstants'; | ||
|
||
export const changeInterface = (iface) => (dispatch, getState) => { | ||
if (iface === getState().align.currentReading.iface) { | ||
return; | ||
} | ||
dispatch({ | ||
type: IFACE_CHANGE, | ||
payload: { | ||
iface | ||
} | ||
}); | ||
if (iface === getState().align.currentReading.iface) { | ||
return; | ||
} | ||
dispatch({ | ||
type: IFACE_CHANGE, | ||
payload: { | ||
iface | ||
} | ||
}); | ||
}; | ||
|
||
export const changeStation = (mac) => (dispatch, getState) => { | ||
if (mac === getState().align.currentReading.mac) { | ||
return; | ||
} | ||
dispatch({ | ||
type: STATION_SET, | ||
payload: getState().align.stations.filter(x => x.mac === mac)[0] | ||
}); | ||
if (mac === getState().align.currentReading.mac) { | ||
return; | ||
} | ||
dispatch({ | ||
type: STATION_SET, | ||
payload: getState().align.stations.filter(x => x.mac === mac)[0] | ||
}); | ||
}; | ||
|
||
export const startAlign = () => (dispatch) => { | ||
dispatch({ | ||
type:IFACES_LOAD | ||
}); | ||
dispatch({ | ||
type: IFACES_LOAD | ||
}); | ||
}; | ||
|
||
export const stopTimer = () => (dispatch) => { | ||
dispatch({ | ||
type:TIMER_STOP | ||
}); | ||
dispatch({ | ||
type: TIMER_STOP | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,35 @@ | ||
export const getIfaceStation = (api, sid, iface) => { | ||
return api.call(sid, 'get_iface_stations', { iface }) | ||
.map(x => x.stations) | ||
.map(data => Object.keys(data).map((key, index)=>data[key]).reduce((x,y) => x.concat(y), [])) | ||
.map((nodes) => nodes.map(node => { | ||
if (node.signal) { | ||
node.signal = Number(node.signal); | ||
} | ||
return node; | ||
})) | ||
.map((nodes) => { return { iface, nodes }; }) | ||
.map( x => { | ||
if (x.nodes.length > 0) { return x; } | ||
throw new Error(); | ||
}); | ||
}; | ||
export const getIfaceStation = (api, sid, iface) => api.call(sid, 'get_iface_stations', { iface }) | ||
.map(x => x.stations) | ||
.map(data => Object.keys(data).map((key, index) => data[key]).reduce((x,y) => x.concat(y), [])) | ||
.map((nodes) => nodes.map(node => { | ||
if (node.signal) { | ||
node.signal = Number(node.signal); | ||
} | ||
return node; | ||
})) | ||
.map((nodes) => ({ iface, nodes })) | ||
.map( x => { | ||
if (x.nodes.length > 0) { return x; } | ||
throw new Error(); | ||
}); | ||
|
||
export const getStationSignal = (api, sid, node) => { | ||
return api.call(sid, 'get_station_signal', { station_mac: node.mac, iface: node.iface }); | ||
}; | ||
export const getStationSignal = (api, sid, node) => api.call(sid, 'get_station_signal', { station_mac: node.mac, iface: node.iface }); | ||
|
||
export const getInterfaces = (api, sid) => { | ||
return api.call(sid, 'get_interfaces', {}) | ||
.map(res => res.interfaces) | ||
.map(iface => iface.map((x) => { return { name: x }; })); | ||
}; | ||
export const getInterfaces = (api, sid) => api.call(sid, 'get_interfaces', {}) | ||
.map(res => res.interfaces) | ||
.map(iface => iface.map((x) => ({ name: x }))); | ||
|
||
export const getStations = (api,sid) => { | ||
return new Promise((res,rej) => { | ||
api.call(sid, 'get_stations', {}) | ||
.map(x => x.stations) | ||
.map(data => Object.keys(data).map((key, index)=>data[key]).reduce((x,y) => x.concat(y), [])) | ||
.map((y) => { | ||
return y.reduce((a, b) => a.concat(b), []); | ||
}) | ||
.map((nodes) => nodes.map(node => { | ||
node.signal = Number(node.signal); | ||
return node; | ||
})) | ||
.subscribe( x => { | ||
if (x.length > 0) { res(x); } | ||
rej(x); | ||
}); | ||
}); | ||
}; | ||
export const getStations = (api,sid) => new Promise((res,rej) => { | ||
api.call(sid, 'get_stations', {}) | ||
.map(x => x.stations) | ||
.map(data => Object.keys(data).map((key, index) => data[key]).reduce((x,y) => x.concat(y), [])) | ||
.map((y) => y.reduce((a, b) => a.concat(b), [])) | ||
.map((nodes) => nodes.map(node => { | ||
node.signal = Number(node.signal); | ||
return node; | ||
})) | ||
.subscribe( x => { | ||
if (x.length > 0) { res(x); } | ||
rej(x); | ||
}); | ||
}); |
Oops, something went wrong.