Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
weather_interface
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Porter Libby
weather_interface
Commits
79ca2979
Commit
79ca2979
authored
2 years ago
by
Porter Libby
Browse files
Options
Downloads
Patches
Plain Diff
fix no data status
parent
59a78272
Branches
Branches containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
data/current-weather.csv
+2
-2
2 additions, 2 deletions
data/current-weather.csv
public/css/styles.css
+5
-0
5 additions, 0 deletions
public/css/styles.css
public/js/home.js
+10
-4
10 additions, 4 deletions
public/js/home.js
views/home.ejs
+1
-0
1 addition, 0 deletions
views/home.ejs
with
18 additions
and
6 deletions
data/current-weather.csv
+
2
−
2
View file @
79ca2979
timestamp,barometric,baroTrend,insideTemp,insideHum,outsideTemp,outsideHum,windSpeed,windSpeedAvg,windSpeed2mAvg,windDir,forecast,UVLevel,solarRad,sunrise,sunset
05-18-2022 09:40:01,29.85,n/a-236,77.5,44,62.2,70,0,0.0,0.3,NNW,Increasing clouds with little temperature change.,0.8,127,06:22,20:51
\ No newline at end of file
status,timestamp,barometric,baroTrend,insideTemp,insideHum,outsideTemp,outsideHum,windSpeed,windSpeedAvg,windSpeed2mAvg,windDir,forecast,UVLevel,solarRad,sunrise,sunset
no data,06-21-2022 20:18:26,,,,,,,,,,,,,,,
\ No newline at end of file
This diff is collapsed.
Click to expand it.
public/css/styles.css
+
5
−
0
View file @
79ca2979
...
...
@@ -141,3 +141,8 @@ h2{
bottom
:
10px
;
right
:
10px
;
}
#error-bar
{
color
:
#980000
;
font-family
:
sans-serif
;
font-size
:
16px
;
}
This diff is collapsed.
Click to expand it.
public/js/home.js
+
10
−
4
View file @
79ca2979
...
...
@@ -42,6 +42,7 @@ function get_current_weather(){
}
// ----------- RENDER display ----------- //
function
make_display
(
arr
){
console
.
log
(
arr
);
data
=
{};
for
(
x
=
0
;
x
<
arr
[
0
].
length
;
x
++
){
title
=
arr
[
0
][
x
];
...
...
@@ -52,10 +53,15 @@ function make_display(arr){
document
.
getElementById
(
"
lastrecord
"
).
innerText
=
"
Recorded at:
"
+
data
[
'
timestamp
'
];
// Build out various displays
temptable
(
data
);
forecast
(
data
);
windtable
(
data
);
lighttable
(
data
);
if
(
data
[
"
status
"
]
==
'
no data
'
){
// if status=no data, show error message.
document
.
getElementById
(
"
error-bar
"
).
innerText
=
"
Host was not able to collect data from Davis Vantage Pro. Check your system.
"
}
else
{
// status is normal
temptable
(
data
);
forecast
(
data
);
windtable
(
data
);
lighttable
(
data
);
}
}
function
forecast
(
data
){
forcast_elem
=
document
.
getElementById
(
"
current-weather-forecast
"
);
...
...
This diff is collapsed.
Click to expand it.
views/home.ejs
+
1
−
0
View file @
79ca2979
...
...
@@ -32,6 +32,7 @@
</div>
<!-- Table for current weather data, shows most recent data available (should be within 5-10 minutes) -->
<h3
id=
"error-bar"
></h3>
<table
id=
'current-weather-table-temp'
></table>
<table
id=
'current-weather-table-wind'
></table>
<table
id=
'current-weather-table-light'
></table>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment