Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pi.hub
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
iot
pi.hub
Commits
bf46c2c2
Commit
bf46c2c2
authored
Jul 06, 2017
by
Martin Kotula
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hub mqtt fixes:
parent
4595f28b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
15 deletions
+15
-15
UI.Web.Dashboard/src/pages/test/test.html
+9
-8
UI.Web.Dashboard/src/services/mqttListener.js
+4
-5
UI.Web.Dashboard/wwwroot/index.html
+2
-2
UI.Web.Dashboard/wwwroot/scripts.js
+0
-0
No files found.
UI.Web.Dashboard/src/pages/test/test.html
View file @
bf46c2c2
...
@@ -7,12 +7,12 @@
...
@@ -7,12 +7,12 @@
<h3>
Example data
</h3>
<h3>
Example data
</h3>
<pre>
<pre>
{ "
object": { "sensorId": "Sensor 1", "isBusy": true}
}
{ "
sensorId": "Sensor 1", "isBusy": true
}
{ "
object": { "sensorId": "Sensor 2", "isBusy": true}
}
{ "
sensorId": "Sensor 2", "isBusy": true
}
{ "
object": { "sensorId": "Sensor 1", "isBusy": true}
}
{ "
sensorId": "Sensor 1", "isBusy": true
}
{ "
object": { "sensorId": "Sensor 2", "isBusy": true}
}
{ "
sensorId": "Sensor 2", "isBusy": true
}
{ "
object": { "sensorId": "Sensor 1", "isBusy": true}
}
{ "
sensorId": "Sensor 1", "isBusy": true
}
{ "
object": { "sensorId": "Sensor 1", "isBusy": false}
}
{ "
sensorId": "Sensor 1", "isBusy": false
}
{ "
object": { "sensorId": "Sensor 3", "isBusy": false}}
}
{ "
sensorId": "Sensor 3", "isBusy": false
}
{ "
object": { "sensorId": "Sensor 3", "isBusy": true}
}
{ "
sensorId": "Sensor 3", "isBusy": true
}
</pre>
</pre>
\ No newline at end of file
UI.Web.Dashboard/src/services/mqttListener.js
View file @
bf46c2c2
...
@@ -17,15 +17,14 @@ define(["app/config", "app/events", "mqtt", "lodash", "knockout", "knockout-post
...
@@ -17,15 +17,14 @@ define(["app/config", "app/events", "mqtt", "lodash", "knockout", "knockout-post
try
{
try
{
console
.
debug
(
"Mqtt message received: "
+
message
.
toString
());
console
.
debug
(
"Mqtt message received: "
+
message
.
toString
());
var
messageBody
=
JSON
.
parse
(
message
.
toString
());
var
messageBody
=
JSON
.
parse
(
message
.
toString
());
if
(
messageBody
.
object
===
undefined
||
if
(
messageBody
.
sensorId
===
undefined
||
messageBody
.
object
.
sensorId
===
undefined
||
messageBody
.
isBusy
===
undefined
){
messageBody
.
object
.
isBusy
===
undefined
){
throw
"InvalidMessageFormat"
;
throw
"InvalidMessageFormat"
;
}
}
var
model
=
{
var
model
=
{
id
:
messageBody
.
object
.
sensorId
,
id
:
messageBody
.
sensorId
,
isOccupied
:
messageBody
.
object
.
isBusy
,
isOccupied
:
messageBody
.
isBusy
,
timestamp
:
new
Date
()
timestamp
:
new
Date
()
};
};
...
...
UI.Web.Dashboard/wwwroot/index.html
View file @
bf46c2c2
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<title>
OccupancySensorDashboard
</title>
<title>
OccupancySensorDashboard
</title>
<link
rel=
"stylesheet"
href=
"css.css?1499
263535088
"
>
<link
rel=
"stylesheet"
href=
"css.css?1499
344294490
"
>
<script
src=
"scripts.js?1499
263535088
"
></script>
<script
src=
"scripts.js?1499
344294491
"
></script>
</head>
</head>
<body>
<body>
...
...
UI.Web.Dashboard/wwwroot/scripts.js
View file @
bf46c2c2
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment