[enh] makes date readable

This commit is contained in:
Laurent Peuch 2018-07-15 06:23:55 +02:00
parent 145141a23d
commit 9dd5aab623
2 changed files with 16 additions and 6 deletions

View file

@ -27,9 +27,9 @@
<td>{{job.state}}</td>
<td>{{job.target_revision}}</td>
<td>{{job.yunohost_version}}</td>
<td>{{job.created_time}}</td>
<td>{{job.started_time}}</td>
<td>{{job.end_time}}</td>
<td>{{timestampToDate(job.created_time)}}</td>
<td>{{timestampToDate(job.started_time)}}</td>
<td>{{timestampToDate(job.end_time)}}</td>
</tr>
</table>
</div>
@ -41,6 +41,11 @@
data: {
jobs: []
},
methods: {
timestampToDate: function (timestamp) {
return new Date(timestamp * 1000).toLocaleString()
}
}
})
ws = new WebSocket('ws://' + document.domain + ':' + location.port + '/index-ws');

View file

@ -17,9 +17,9 @@
<tr><th>State</th><td>{{job.state}}</td></tr>
<tr><th>Target revision</th><td>{{job.target_revision}}</td></tr>
<tr><th>YunoHost version</th><td>{{job.yunohost_version}}</td></tr>
<tr><th>Created time</th><td>{{job.created_time}}</td></tr>
<tr><th>Started time</th><td>{{job.started_time}}</td></tr>
<tr><th>End time</th><td>{{job.end_time}}</td></tr>
<tr><th>Created time</th><td>{{timestampToDate(job.created_time)}}</td></tr>
<tr><th>Started time</th><td>{{timestampToDate(job.started_time)}}</td></tr>
<tr><th>End time</th><td>{{timestampToDate(job.end_time)}}</td></tr>
</table>
<h2 class="subtitle">Excution log:</h2>
@ -32,6 +32,11 @@
data: {
job: {}
},
methods: {
timestampToDate: function (timestamp) {
return new Date(timestamp * 1000).toLocaleString()
}
}
})
ws = new WebSocket('ws://' + document.domain + ':' + location.port + '/job-%s-ws');