Added date on view train page
This commit is contained in:
parent
b0afb0dfea
commit
c86c7c14ad
3 changed files with 18 additions and 2 deletions
|
@ -14,8 +14,17 @@
|
|||
color: black;
|
||||
}
|
||||
|
||||
#comp-date {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
#company {
|
||||
text-align: center;
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
#date {
|
||||
text-align: end;
|
||||
}
|
||||
|
||||
.stationItem {
|
||||
|
|
|
@ -14,7 +14,10 @@
|
|||
</head>
|
||||
<body>
|
||||
<h1>Train Info</h1>
|
||||
<p class="sec" id="company"></p>
|
||||
<div id="comp-date">
|
||||
<p class="sec" id="company"></p>
|
||||
<p class="sec" id="date"></p>
|
||||
</div>
|
||||
|
||||
<div class="content" tabindex="0">
|
||||
<div id="route">
|
||||
|
|
|
@ -16,6 +16,7 @@ function onTrainData(data) {
|
|||
title.appendChild(document.createTextNode(` ${data.number}`))
|
||||
|
||||
document.getElementById('company').textContent = data.operator
|
||||
document.getElementById('date').textContent = data.date
|
||||
|
||||
document.getElementById('route-from').textContent = data.route.from
|
||||
document.getElementById('route-to').textContent = data.route.to
|
||||
|
@ -198,6 +199,9 @@ function refresh() {
|
|||
onTrainData(response)
|
||||
})
|
||||
.then(function () {
|
||||
if (refreshStopToken != null) {
|
||||
clearTimeout(refreshStopToken)
|
||||
}
|
||||
refreshStopToken = setTimeout(function () {
|
||||
refresh()
|
||||
}, 60000)
|
||||
|
|
Loading…
Add table
Reference in a new issue