2525use OCA \ServerInfo \Resources \Disk ;
2626use OCA \ServerInfo \Resources \Memory ;
2727use OCA \ServerInfo \Resources \NetInterface ;
28+ use OCA \ServerInfo \Resources \ThermalZone ;
2829use OCP \Util ;
2930
3031script ('serverinfo ' , 'script ' );
@@ -51,6 +52,8 @@ function FormatMegabytes(int $byte): string {
5152$ disks = $ _ ['diskinfo ' ];
5253/** @var NetInterface[] $interfaces */
5354$ interfaces = $ _ ['networkinterfaces ' ];
55+ /** @var ThermalZone[] $thermalZones */
56+ $ thermalZones = $ _ ['thermalzones ' ];
5457/** @var bool $phpinfo */
5558$ phpinfo = $ _ ['phpinfo ' ];
5659
@@ -80,6 +83,7 @@ function FormatMegabytes(int $byte): string {
8083 <p><?php p ($ l ->t ('Uptime: ' )); ?> <strong id="numFilesStorage"><span class="info" id="uptime"></span></strong></p>
8184 </div>
8285
86+ <?php if (count ($ thermalZones ) > 0 ): ?>
8387 <div class="col col-6 col-l-12">
8488 <h2>
8589 <img class="infoicon" src="<?php p (image_path ('serverinfo ' , 'app-dark.svg ' )); ?> ">
@@ -90,16 +94,17 @@ function FormatMegabytes(int $byte): string {
9094 <thead>
9195 </thead>
9296 <tbody>
93- <?php foreach ($ _ [ ' thermalzones ' ] as $ thermalzone ): ?>
97+ <?php foreach ($ thermalZones as $ thermalZone ): ?>
9498 <tr>
95- <td><?php p ($ thermalzone [ ' type ' ] . ' : ' ) ?> </td>
96- <td><span class="info" id="<?php p ($ thermalzone [ ' hash ' ]) ?> "></span>°C</td>
99+ <td><?php p ($ thermalZone -> getType ()) ?> : </td>
100+ <td> <span class="info" id="<?php p ($ thermalZone -> getZone ()) ?> "> <?php p ( $ thermalZone -> getTemp ()) ? > </span>°C</td>
97101 </tr>
98102 <?php endforeach ; ?>
99103 </tbody>
100104 </table>
101105 </div>
102106 </div>
107+ <?php endif ; ?>
103108 </div>
104109 </div>
105110
0 commit comments