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;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#comp-date {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
#company {
|
#company {
|
||||||
text-align: center;
|
text-align: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
#date {
|
||||||
|
text-align: end;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stationItem {
|
.stationItem {
|
||||||
|
|
|
@ -14,7 +14,10 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Train Info</h1>
|
<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 class="content" tabindex="0">
|
||||||
<div id="route">
|
<div id="route">
|
||||||
|
|
|
@ -16,6 +16,7 @@ function onTrainData(data) {
|
||||||
title.appendChild(document.createTextNode(` ${data.number}`))
|
title.appendChild(document.createTextNode(` ${data.number}`))
|
||||||
|
|
||||||
document.getElementById('company').textContent = data.operator
|
document.getElementById('company').textContent = data.operator
|
||||||
|
document.getElementById('date').textContent = data.date
|
||||||
|
|
||||||
document.getElementById('route-from').textContent = data.route.from
|
document.getElementById('route-from').textContent = data.route.from
|
||||||
document.getElementById('route-to').textContent = data.route.to
|
document.getElementById('route-to').textContent = data.route.to
|
||||||
|
@ -198,6 +199,9 @@ function refresh() {
|
||||||
onTrainData(response)
|
onTrainData(response)
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
|
if (refreshStopToken != null) {
|
||||||
|
clearTimeout(refreshStopToken)
|
||||||
|
}
|
||||||
refreshStopToken = setTimeout(function () {
|
refreshStopToken = setTimeout(function () {
|
||||||
refresh()
|
refresh()
|
||||||
}, 60000)
|
}, 60000)
|
||||||
|
|
Loading…
Add table
Reference in a new issue