phpvms/resources/views/layouts/default/widgets/weather.blade.php

81 lines
2.4 KiB
PHP
Raw Normal View History

{{--
If you want to edit this, you can reference the CheckWX API docs:
https://api.checkwx.com/#metar-decoded
--}}
@if(!$metar)
<p>METAR/TAF data could not be retrieved</p>
@else
2018-04-04 08:21:42 +08:00
<table class="table table-striped">
<tr>
<td>Conditions</td>
<td>
2018-04-07 22:05:06 +08:00
{{ $metar['category'] }}
{{ $metar['temperature'][$unit_temp] }}
2018-04-07 22:05:06 +08:00
°{{strtoupper($unit_temp)}}
@if($metar['visibility'])
, visibility {{ $metar['visibility'][$unit_dist] }} {{$unit_dist}}
2018-04-07 22:05:06 +08:00
@endif
@if($metar['humidity'])
, {{ $metar['humidity'] }}% humidity
2018-04-07 22:05:06 +08:00
@endif
@if($metar['dew_point'])
, dew point
{{ $metar['dew_point'][$unit_temp] }}
°{{strtoupper($unit_temp)}}
@endif
</td>
</tr>
<tr>
<td>Barometer</td>
<td>
2018-04-07 22:05:06 +08:00
{{ $metar['barometer'] }} Hg
/ {{ $metar['barometer_in'] * 1000 }} MB
</td>
</tr>
2018-04-07 22:05:06 +08:00
@if($metar['clouds'])
<tr>
<td>Clouds</td>
<td>
@if($unit_alt === 'ft')
{{$metar['clouds_report_ft']}}
@else
{{ $metar['clouds_report'] }}
@endif
</td>
</tr>
@endif
<tr>
<td>Wind</td>
<td>
2018-04-07 22:05:06 +08:00
{{$metar['wind_speed']}} kts from {{$metar['wind_direction_label']}}
({{$metar['wind_direction']}}°)
@if($metar['wind_gust_speed'])
gusts to {{ $metar['wind_gust_speed'] }}
@endif
</td>
</tr>
<tr>
<td>METAR</td>
<td>
<div style="line-height:1.5em;min-height: 3em;">
2018-04-07 22:05:06 +08:00
{{ $metar['raw'] }}
</div>
</td>
</tr>
2018-04-07 22:05:06 +08:00
@if($metar['remarks'])
<tr>
<td>Remarks</td>
<td>
{{ $metar['remarks'] }}
</td>
</tr>
@endif
<tr>
<td>Updated</td>
2018-04-07 22:05:06 +08:00
<td>{{$metar['observed_time']}} ({{$metar['observed_age']}})</td>
</tr>
</table>
@endif