commit
d980cc2594
2 changed files with 88 additions and 1 deletions
83
35c3-life-support/index.html
Normal file
83
35c3-life-support/index.html
Normal file
|
@ -0,0 +1,83 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>35C3 life support</title>
|
||||
<script src="../vendor/webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../vendor/webcomponentsjs/custom-elements-es5-adapter.js"></script>
|
||||
<script src="../vendor/plotly.js/plotly.min.js"></script>
|
||||
<script src="../lib/infoscreens.js"></script>
|
||||
<link rel="stylesheet" href="../theme/c-base.css">
|
||||
<style>
|
||||
main {
|
||||
height: 88vh;
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
#climate-temperature, #climate-humidity {
|
||||
width: 50vw;
|
||||
height: 55vh;
|
||||
}
|
||||
#climate-pressure {
|
||||
width: 100vw;
|
||||
height: 35vh;
|
||||
}
|
||||
section h2 {
|
||||
line-height: 5vh;
|
||||
font-size: 3vmin;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: center;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
cbase-time, h1 {
|
||||
font-family: 'ceva', sans-serif;
|
||||
font-weight: normal;
|
||||
font-size: 6vmin;
|
||||
line-height: 10vh;
|
||||
color: #fff;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
#screen-title {
|
||||
text-align: left;
|
||||
padding-left: 3vw;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
}
|
||||
#current-time {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
text-align: right;
|
||||
padding-right: 3vw;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="station">
|
||||
<main>
|
||||
<section id="climate-temperature">
|
||||
<h2>temperature</h2>
|
||||
<cbase-linechart timeseries="clima.temperature.lej" width="48" height="50" source="http://openmct.cbrp3.c-base.org:8080"></cbase-linechart>
|
||||
</section>
|
||||
<section id="climate-humidity">
|
||||
<h2>humidity</h2>
|
||||
<cbase-linechart timeseries="clima.humidity.lej" width="48" height="50" source="http://openmct.cbrp3.c-base.org:8080"></cbase-linechart>
|
||||
</section>
|
||||
<section id="climate-pressure">
|
||||
<h2>barometric pressure</h2>
|
||||
<cbase-linechart timeseries="clima.pressure.lej" days="2" width="96" height="30" source="http://openmct.cbrp3.c-base.org:8080"></cbase-linechart>
|
||||
</section>
|
||||
</main>
|
||||
<h1 id="screen-title">c-base @ 35C3</h1>
|
||||
<cbase-time id="current-time" interval="1" format="HH:MM"></cbase-time>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -28,12 +28,16 @@ class LineChart extends Component {
|
|||
width: props.number,
|
||||
height: props.number,
|
||||
references: props.string,
|
||||
source: props.string,
|
||||
};
|
||||
|
||||
connected() {
|
||||
if (!this.timeseries || !this.timeseries.length) {
|
||||
return;
|
||||
}
|
||||
if (!this.source) {
|
||||
this.source = 'http://openmct.cbrp3.c-base.org';
|
||||
}
|
||||
const days = this.days || 1;
|
||||
const endDate = new Date();
|
||||
const startDate = new Date();
|
||||
|
@ -48,7 +52,7 @@ class LineChart extends Component {
|
|||
}
|
||||
|
||||
fetch(timeseries, start, end) {
|
||||
const url = `http://openmct.cbrp3.c-base.org/telemetry/${timeseries}?start=${start.getTime()}&end=${end.getTime()}`;
|
||||
const url = `${this.source}/telemetry/${timeseries}?start=${start.getTime()}&end=${end.getTime()}`;
|
||||
return fetch(url)
|
||||
.then(data => data.json());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue