Skip to content

Commit 59bd852

Browse files
committed
Move status.js to src/scripts
1 parent 5b7edf5 commit 59bd852

File tree

6 files changed

+14
-4
lines changed

6 files changed

+14
-4
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ SERVER_FILES = \
1616
src/scripts/modules/sensorLister.js \
1717
src/scripts/modules/server.js
1818

19+
CLIENT_FILES = \
20+
src/scripts/status.js \
21+
1922
TEST_FILES = test-status.js \
2023
src/scripts/modules/jsogpio.js \
2124
src/scripts/modules/cpuinfo.js \
@@ -64,7 +67,7 @@ default.conf: default.conf.in
6467
node_modules:
6568
npm install
6669

67-
client: node_modules
70+
client: node_modules $(CLIENT_FILES)
6871
./node_modules/.bin/rollup --config client.config.js
6972
touch client
7073

client.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import cssnext from 'postcss-cssnext';
1515
import cssnano from 'cssnano';
1616

1717
export default {
18-
entry: 'status.js',
18+
entry: 'src/scripts/status.js',
1919
targets: [
2020
{ dest: 'build/js/brewableclientbundle.js', format: 'iife' },
2121
],

src/scripts/brewable.js

100755100644
File mode changed.

src/scripts/modules/gpioworker.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ gpioWorker.prototype.sensorDevices = function () {
164164
for (var z=0;z<sensorList.length;z++) {
165165
deviceList.push(new sensordevice(sensorList[z]));
166166
}
167+
168+
// Sort the device list by (slightly mangled) id's
169+
deviceList.sort(function(a, b) {
170+
var aval = parseInt(a.id.substr(0,a.id.search("-")),16) + parseInt(a.id.substr(a.id.search("-") + 1),16);
171+
var bval = parseInt(b.id.substr(0,b.id.search("-")),16) + parseInt(b.id.substr(b.id.search("-") + 1),16);
172+
return aval - bval;
173+
});
167174
return deviceList;
168175
};
169176

src/scripts/modules/sensorLister.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var fs =require('fs');
1+
import fs from "fs";
22

33
// Return a list of sensor devices
44
export default function sensors() {

status.js renamed to src/scripts/status.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Import styles (automatically injected into <head>).
2-
import "./styles/brewable.css";
2+
import "../../styles/brewable.css";
33

44
import { select, selectAll, event, mouse } from "d3-selection";
55
import { max, min } from "d3-array";

0 commit comments

Comments
 (0)