Skip to content

Commit 6cb5c34

Browse files
committed
Update index
1 parent b2320f0 commit 6cb5c34

2 files changed

Lines changed: 42 additions & 37 deletions

File tree

src/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8-
<title>Bigclown HUB</title>
8+
<title>HARDWARIO HUB</title>
99
<link rel='shortcut icon' type='image/x-icon' href='/assets/favicons/favicon.ico' />
1010
<link rel="apple-touch-icon" sizes="180x180" href="/assets/favicons/apple-touch-icon.png">
1111
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicons/favicon-32x32.png">
@@ -16,4 +16,4 @@
1616
<section id="index"></section>
1717
</body>
1818

19-
</html>
19+
</html>

src/index.js

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,29 @@ import 'bootstrap/dist/css/bootstrap.min.css';
1313
import "./assets/scss/index.scss";
1414
import "./favicons";
1515

16-
var hostname = location.hostname; //"hub.local";
1716

18-
var mqttws = "ws://" + hostname + ":9001";
19-
var node_red_src = "http://" + hostname + ":1880/";
17+
// const mqttws = (location.protocol === 'https:' ? 'wss://' : 'ws://') + location.host + location.pathname + "/mqtt-ws";
18+
// const node_red_src = "./node-red/";
19+
// const node_red_src_ui = './ui/';
20+
21+
const hostname = location.hostname; //"hub.local";
22+
const mqttws = "ws://" + hostname + ":9001";
23+
const node_red_src = "http://" + hostname + ":1880/";
24+
const node_red_src_ui = "http://" + hostname + ":1880/ui";
2025

2126
class App extends Component {
2227

2328
constructor(props) {
2429
super(props);
25-
30+
2631
this.radiomanager = new RadioManagerModel();
2732
this.mqttlog = new MqttLogModel();
2833

2934
this.state = {
3035
visible: true,
31-
gatewayConnect: null,
36+
gatewayConnect: false,
3237
mqttConnect: null,
33-
};
38+
};
3439
}
3540

3641
componentDidMount() {
@@ -48,42 +53,42 @@ class App extends Component {
4853
}
4954

5055
onGatewayConnect(status) {
51-
this.setState({gatewayConnect: status});
56+
this.setState({ gatewayConnect: status });
5257
}
5358
onmqttConnect(status) {
54-
this.setState({mqttConnect: status});
59+
this.setState({ mqttConnect: status });
5560
}
5661

5762
render() {
58-
return <HashRouter>
59-
<div id="app" >
60-
<div id="navbar" key="navbar">
61-
<aside className="">
62-
<nav>
63-
<NavLink to="/" exact title={this.state.gatewayConnect === false ? "No Radio USB Dongle connected" : null}>Devices{this.state.gatewayConnect === false ? <i className="fa fa-warning"></i> : null}</NavLink>
64-
<NavLink to="/functions">Functions</NavLink>
65-
<NavLink to="/dashboard">Dashboard</NavLink>
66-
<NavLink to="/messages">Messages</NavLink>
67-
</nav>
68-
69-
<nav className="bottom">
70-
</nav>
63+
return <HashRouter>
64+
<div id="app" >
65+
<div id="navbar" key="navbar">
66+
<aside className="" >
67+
<nav>
68+
<NavLink to="/" exact title={this.state.gatewayConnect === false ? "No Radio USB Dongle connected" : null}>Devices{this.state.gatewayConnect === false ? <i className="fa fa-warning"></i> : null}</NavLink>
69+
<NavLink to="/functions">Functions</NavLink>
70+
<NavLink to="/dashboard">Dashboard</NavLink>
71+
<NavLink to="/messages">Messages</NavLink>
72+
</nav>
73+
74+
<nav className="bottom">
75+
</nav>
7176
<a href="https://www.hardwario.com/" target="_blank">
7277
<img src={require("./assets/images/hw-logo-white.svg")} className="logo" />
73-
</a>
74-
</aside>
75-
</div>
76-
77-
<main key="main">
78-
<RouteWithProps path="/" exact component={RadioManager} model={this.radiomanager} />
79-
<RouteWithProps path="/messages" component={MqttLog} model={this.mqttlog} />
80-
<RouteIframe path="/functions" src={node_red_src} id="node-red" />
81-
<RouteIframe path="/dashboard" src={node_red_src + "ui"} />
82-
</main>
83-
84-
</div>
85-
</HashRouter>;
86-
};
78+
</a>
79+
</aside>
80+
</div>
81+
82+
<main key="main">
83+
<RouteWithProps path="/" exact component={RadioManager} model={this.radiomanager} />
84+
<RouteWithProps path="/messages" component={MqttLog} model={this.mqttlog} />
85+
<RouteIframe path="/functions" src={node_red_src} id="node-red" />
86+
<RouteIframe path="/dashboard" src={node_red_src_ui} />
87+
</main>
88+
89+
</div>
90+
</HashRouter>;
91+
};
8792

8893
}
8994

0 commit comments

Comments
 (0)