Skip to content

Commit 00b6a20

Browse files
bubblesnetjvrodley
andauthored
Main (#3)
* start on readme * straightening gitflow branches out Co-authored-by: John Rodley <[email protected]>
1 parent bb6cd7b commit 00b6a20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2672
-1
lines changed

README.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
# controller
1+
# controller
2+
3+
The controller is a control, and data collection and analysis service designed to
4+
work with the bubblesnet edge-device. It consists of:
5+
6+
Client - a React application for controlling one or more edge devices
7+
and viewing the data from those devices.
8+
9+
Server - an API server that serves both the controller React application AND
10+
the edge devices manipulating the physical environment and queueing data for storage.

client/package.json

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "reactweb",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"@testing-library/jest-dom": "^4.2.4",
7+
"@testing-library/react": "^9.5.0",
8+
"@testing-library/user-event": "^7.2.1",
9+
"create-react-class": "^15.6.3",
10+
"enzyme": "^3.11.0",
11+
"enzyme-adapter-react-16": "^1.15.4",
12+
"grommet": "^2.15.0",
13+
"jest-enzyme": "^7.1.2",
14+
"moment": "^2.27.0",
15+
"pg": "^8.3.0",
16+
"react": "^16.13.1",
17+
"react-dom": "^16.13.1",
18+
"react-editable-table": "^1.12.32",
19+
"react-interval-rerender": "^1.0.1",
20+
"react-scripts": "3.4.1",
21+
"rendition": "^16.1.2"
22+
},
23+
"scripts": {
24+
"start": "react-scripts start",
25+
"build": "react-scripts build",
26+
"test": "react-scripts test",
27+
"eject": "react-scripts eject"
28+
},
29+
"eslintConfig": {
30+
"extends": "react-app"
31+
},
32+
"browserslist": {
33+
"production": [
34+
">0.2%",
35+
"not dead",
36+
"not op_mini all"
37+
],
38+
"development": [
39+
"last 1 chrome version",
40+
"last 1 firefox version",
41+
"last 1 safari version"
42+
]
43+
}
44+
}

client/public/favicon16x16.ico

334 Bytes
Binary file not shown.

client/public/favicon32x32.ico

4.19 KB
Binary file not shown.

client/public/favicon96x96.ico

37.2 KB
Binary file not shown.

client/public/iceberg192x192.png

14.1 KB
Loading

client/public/iceberg512x512.png

50.8 KB
Loading

client/public/index.html

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon16x16.ico" />
6+
<link rel="icon" href="%PUBLIC_URL%/favicon32x32.ico" />
7+
<link rel="icon" href="%PUBLIC_URL%/favicon96x96.ico" />
8+
<meta name="viewport" content="width=device-width, initial-scale=1" />
9+
<meta name="theme-color" content="#000000" />
10+
<meta
11+
name="description"
12+
content="Web site created using create-react-app"
13+
/>
14+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
15+
<!--
16+
manifest.json provides metadata used when your web app is installed on a
17+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
18+
-->
19+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
20+
<!--
21+
Notice the use of %PUBLIC_URL% in the tags above.
22+
It will be replaced with the URL of the `public` folder during the build.
23+
Only files inside the `public` folder can be referenced from the HTML.
24+
25+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
26+
work correctly both with client-side routing and a non-root public URL.
27+
Learn how to configure a non-root public URL by running `npm run build`.
28+
-->
29+
<link
30+
rel="stylesheet"
31+
href="https://use.fontawesome.com/releases/v5.7.1/css/all.css"
32+
integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
33+
crossorigin="anonymous"
34+
/>
35+
<title>Icebreaker</title>
36+
</head>
37+
<body>
38+
<noscript>You need to enable JavaScript to run this app.</noscript>
39+
<div id="root"></div>
40+
<!--
41+
This HTML file is a template.
42+
If you open it directly in the browser, you will see an empty page.
43+
44+
You can add webfonts, meta tags, or analytics to this file.
45+
The build step will place the bundled scripts into the <body> tag.
46+
47+
To begin the development, run `npm start` or `yarn start`.
48+
To create a production bundle, use `npm run build` or `yarn build`.
49+
-->
50+
</body>
51+
</html>

client/public/manifest.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"short_name": "Icebreaker",
3+
"name": "Icebreaker Admin UI",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
},
10+
{
11+
"src": "iceberg192x192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "iceberg512x512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
19+
}
20+
],
21+
"start_url": ".",
22+
"display": "standalone",
23+
"theme_color": "#000000",
24+
"background_color": "#ffffff"
25+
}

client/public/robots.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow:

client/src/.eslintignore

Whitespace-only changes.

client/src/App.css

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
.App {
2+
text-align: center;
3+
}
4+
5+
.App-logo {
6+
height: 40vmin;
7+
pointer-events: none;
8+
}
9+
10+
@media (prefers-reduced-motion: no-preference) {
11+
.App-logo {
12+
animation: App-logo-spin infinite 20s linear;
13+
}
14+
}
15+
16+
.App-header {
17+
background-color: #282c34;
18+
min-height: 10vh;
19+
display: flex;
20+
flex-direction: column;
21+
align-items: center;
22+
justify-content: center;
23+
font-size: calc(10px + 2vmin);
24+
color: white;
25+
}
26+
27+
.IcebergApp-header {
28+
background: #22445e;
29+
flexDirection: row;
30+
flexWrap: nowrap;
31+
min-height: 5vh;
32+
display: flex;
33+
align-items: flex-start;
34+
justify-content: flex-start;
35+
font-size: calc(10px + 2vmin);
36+
color: white;
37+
}
38+
39+
.App-link {
40+
color: #61dafb;
41+
}
42+
43+
@keyframes App-logo-spin {
44+
from {
45+
transform: rotate(0deg);
46+
}
47+
to {
48+
transform: rotate(360deg);
49+
}
50+
}
51+
52+
.RenderEnvironmentPickerFunctional {
53+
justify-content: center;
54+
background: #aaaaaa;
55+
}

client/src/App.js

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import React, {useState} from 'react';
2+
3+
import RenderTestQueueListFunctional from "./TestQueueListFunctional";
4+
import RenderTestRunListFunctional from "./TestRunListFunctional";
5+
import RenderMetrics from "./MetricsPanelFunctional";
6+
import RenderSBCEditor from "./SBCEditor";
7+
import {Tabs, Tab, Img} from "rendition";
8+
import RenderDeviceStatusListFunctional from "./DeviceStatusListFunctional";
9+
import RenderEnvironmentPickerFunctional from "./EnvironmentPickerFunctional"
10+
import Iceberg from './iceberg.png'
11+
12+
function App (props) {
13+
console.log("IceBreakerApp render props = " + JSON.stringify(props))
14+
let [database, setDatabase] = useState("production"); // The array of SingleBoardComputers
15+
let [port, setPort] = useState(3001); // The port we should send queries to - depends on dev/test/prod
16+
let [language, setLanguage] = useState("all")
17+
18+
let setLang = (value) => {
19+
console.log("App setting lantuage to " + value)
20+
setLanguage(value)
21+
}
22+
23+
let setEnvironment = (value) => {
24+
// console.log("setEnvironment(" + value + ")")
25+
var thedatabase = value
26+
var theport
27+
if (thedatabase === "production") {
28+
theport = 3001;
29+
} else if (thedatabase === "test") {
30+
theport = 3002;
31+
} else if (thedatabase === "development") {
32+
theport = 3003;
33+
}
34+
// console.log("setting state db to " + thedatabase + " port to " + theport)
35+
// console.log("IceBreakerApp render port = " + port)
36+
setDatabase(thedatabase);
37+
setPort(theport);
38+
}
39+
40+
return (
41+
<div className="App">
42+
<header className="IcebergApp-header">
43+
<span style={{
44+
'width': '25%',
45+
'alignItems': 'flex-start',
46+
'marginLeft': '25px'
47+
}}>Icebreaker ({database})</span>
48+
<span style={{'width': '50%'}}/>
49+
<span style={{'width': '25%'}}><Img style={{'marginRight': '25px', 'float': 'right'}}
50+
src={Iceberg}/></span>
51+
</header>
52+
<RenderEnvironmentPickerFunctional database={database} port={port}
53+
handleClick={setEnvironment}/>
54+
<Tabs margin="medium" flex="shrink">
55+
<Tab title="Metrics">
56+
<RenderMetrics database={database} port={port}/>
57+
</Tab>
58+
<Tab title="Work Queue">
59+
<RenderTestQueueListFunctional database={database} port={port} language={language}
60+
onChangeLanguage={setLang}/>
61+
</Tab>
62+
<Tab title="Workers">
63+
<RenderDeviceStatusListFunctional database={database} port={port}/>
64+
</Tab>
65+
<Tab title="Runs">
66+
<RenderTestRunListFunctional database={database} port={port}/>
67+
</Tab>
68+
<Tab title="SBC Targets">
69+
<RenderSBCEditor database={database} port={port} blah={"blahblah"}/>
70+
</Tab>
71+
</Tabs>
72+
</div>
73+
);
74+
}
75+
76+
export default App

0 commit comments

Comments
 (0)