Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
AirQMon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Grewe
AirQMon
Commits
fc91dce4
Commit
fc91dce4
authored
3 years ago
by
Jan Grewe
Browse files
Options
Downloads
Patches
Plain Diff
update IAQ zones, hide IAQ status when calibrated
parent
2690abcf
Loading
Loading
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
data/airqmon.js
+29
-26
29 additions, 26 deletions
data/airqmon.js
with
29 additions
and
26 deletions
data/airqmon.js
+
29
−
26
View file @
fc91dce4
...
...
@@ -3,25 +3,11 @@ var websock;
var
timeseries
=
{};
var
charts
=
{};
var
gaugeModes
=
{
staticZones
:
[
{
strokeStyle
:
"
#00E400
"
,
min
:
0
,
max
:
50
},
// Green
{
strokeStyle
:
"
#FFFF00
"
,
min
:
51
,
max
:
100
},
// Yellow
{
strokeStyle
:
"
#FF7E00
"
,
min
:
101
,
max
:
150
},
// Orange
{
strokeStyle
:
"
#FF0000
"
,
min
:
151
,
max
:
200
},
// Red
{
strokeStyle
:
"
#8F3F97
"
,
min
:
201
,
max
:
300
},
// Violet
{
strokeStyle
:
"
#7E0023
"
,
min
:
301
,
max
:
500
}
// Brown
],
percentColors
:
[
[
0.0
,
"
#00E400
"
],
[
0.1
,
"
#FFFF00
"
],
[
0.2
,
"
#FF7E00
"
],
[
0.3
,
"
#FF0000
"
],
[
0.4
,
"
#8F3F97
"
],
[
0.6
,
"
#7E0023
"
]
]
}
$
(
document
).
ready
(
function
(
event
)
{
setupGauge
(
'
staticZones
'
);
//setupGauge('percentColors');
startWebsocket
();
});
var
metrics
=
{
"
iaq
"
:
{
name
:
"
IAQ
"
,
has_accuracy
:
true
,
decimals
:
0
},
...
...
@@ -64,12 +50,33 @@ var gaugeOptions = {
highDpiSupport
:
true
,
// High resolution support
staticLabels
:
{
font
:
"
10px sans-serif
"
,
// Specifies font
labels
:
[
50
,
100
,
150
,
200
,
30
0
,
500
],
// Print labels at these values
labels
:
[
50
,
100
,
150
,
200
,
250
,
35
0
,
500
],
// Print labels at these values
color
:
"
#000000
"
,
// Optional: Label text color
fractionDigits
:
0
// Optional: Numerical precision. 0=round off.
}
};
var
gaugeModes
=
{
staticZones
:
[
{
strokeStyle
:
"
#01E400
"
,
min
:
0
,
max
:
50
},
// Bright Green
{
strokeStyle
:
"
#92D050
"
,
min
:
51
,
max
:
100
},
// Green
{
strokeStyle
:
"
#FFFF00
"
,
min
:
101
,
max
:
150
},
// Yellow
{
strokeStyle
:
"
#FF7E00
"
,
min
:
151
,
max
:
200
},
// Orange
{
strokeStyle
:
"
#FF0000
"
,
min
:
201
,
max
:
250
},
// Red
{
strokeStyle
:
"
#99004C
"
,
min
:
251
,
max
:
350
},
// Violet
{
strokeStyle
:
"
#663300
"
,
min
:
351
,
max
:
500
}
// Brown
],
percentColors
:
[
[
0.0
,
"
#01E400
"
],
[
0.1
,
"
#92D050
"
],
[
0.2
,
"
#FFFF00
"
],
[
0.3
,
"
#FF7E00
"
],
[
0.4
,
"
#FF0000
"
],
[
0.5
,
"
#99004C
"
],
[
0.7
,
"
#663300
"
]
]
}
var
chartOptions
=
{
responsive
:
true
,
millisPerPixel
:
100
,
...
...
@@ -88,11 +95,6 @@ var lineOptions = {
strokeStyle
:
'
#00ff00
'
}
$
(
document
).
ready
(
function
(
event
)
{
setupGauge
(
'
staticZones
'
);
startWebsocket
();
});
function
setupGauge
(
mode
)
{
var
objColor
=
{}
objColor
[
mode
]
=
gaugeModes
[
mode
];
...
...
@@ -101,6 +103,7 @@ function setupGauge(mode) {
gauge
.
setMinValue
(
0
);
gauge
.
maxValue
=
500
;
gauge
.
animationSpeed
=
128
;
gauge
.
set
(
0
);
}
function
startWebsocket
()
{
...
...
@@ -146,7 +149,7 @@ function updateMetric(name, value, accuracy) {
if
(
'
unit
'
in
metrics
[
name
])
{
value
+=
metrics
[
name
].
unit
;
}
if
(
accuracy
!==
false
)
{
if
(
accuracy
!==
false
&&
accuracy
<
3
)
{
value
=
'
<span class="badge bg-
'
+
accuracyStatus
[
accuracy
].
class
+
'
">
'
+
accuracyStatus
[
accuracy
].
name
+
'
</span>
'
+
value
;
}
if
(
!
$
(
'
#metric_
'
+
name
).
length
&&
name
in
metrics
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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