Skip to content

Commit 2166cd3

Browse files
committed
Add map.
1 parent 0111d27 commit 2166cd3

5 files changed

Lines changed: 19 additions & 4 deletions

File tree

app/controllers/csv.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function createEntitiesFromRows(rows) {
7777
case 'agroVocConcept':
7878
case 'alternateName':
7979
case 'birthdate':
80-
case 'comment':
80+
8181
case 'controlledProperty':
8282
case 'dataProvider':
8383
case 'dateIssued':
@@ -107,6 +107,9 @@ function createEntitiesFromRows(rows) {
107107
case 'windDirection':
108108
entity[key] = { value: tryParse(value), type: 'Property' };
109109
break;
110+
case 'comment':
111+
entity[key] = { value: tryParse(value), type: 'Property', observedAt: timestamp };
112+
break;
110113

111114
case 'atmosphericPressure':
112115
case 'illuminance':

app/controllers/ngsi-ld/agri-device.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async function displayAgriDevice(req, res) {
2222
} catch (error) {
2323
const errorDetail = error.error | error;
2424
debug(errorDetail);
25-
// If no animal has been found, display an error screen
25+
// If no device has been found, display an error screen
2626
return res.render('error', {
2727
title: `Error: ${errorDetail.title}`,
2828
message: errorDetail.detail,

app/controllers/ngsi-ld/crop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async function displayCrop(req, res) {
2222
} catch (error) {
2323
const errorDetail = error.error;
2424
debug(errorDetail);
25-
// If no animal has been found, display an error screen
25+
// If no crop has been found, display an error screen
2626
return res.render('error', {
2727
title: `Error: ${errorDetail.title}`,
2828
message: errorDetail.detail,

app/routes/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ router.get('/', async function (req, res) {
114114
});
115115

116116
return res.render('index', {
117+
title: 'NGSI-LD Smart Farm',
117118
success: req.flash('success'),
118119
errors: req.flash('error'),
119120
info: req.flash('info'),

app/views/index.pug

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,18 @@ block content
8383
| #{building.name}
8484
div.row
8585
div.col
86-
h3 Animal Details
86+
div.d-flex.flex-row
87+
div
88+
h3 Animal Details
89+
- if (cows.length > 0)
90+
div.ms-auto
91+
div.ms-2
92+
div(style="margin-top: 15px")
93+
a(class="link-underline link-underline-opacity-0" href=`app/animals`)
94+
img(class="ps-2" src='/img/cow.svg' width="32" height="32")
95+
span.px-2 /
96+
img(class="pe-2" src='/img/pig.svg' width="32" height="32")
97+
| Map
8798
div.row
8899
div.col
89100
div.card

0 commit comments

Comments
 (0)