BadWolf42/jMQTT

Move orphan eqLogic & cmd search and rescue in health modal

github-actions opened this issue · 0 comments

// TODO: Move orphan eqLogic & cmd search and rescue in health modal

/** @var jMQTT[][] $eqNonBrokers */
$eqNonBrokers = jMQTT::getNonBrokers();
/** @var jMQTT[] $eqBrokers */
$eqBrokers = jMQTT::getBrokers();

// TODO: Move orphan eqLogic & cmd search and rescue in health modal
//  labels: enhancement, php

?>
<legend><i class="fas fa-table"></i> {{Brokers}}</legend>
<table class="table table-condensed tablesorter" id="table_healthMQTT_brk">
    <thead>
        <tr>
            <th class="col-md-3">{{Broker}}</th>
            <th class="col-md-1 center">{{ID}}</th>
            <th class="col-md-4">{{Statut}}</th>
            <th class="col-md-1 center">{{Équipements}}</th>
            <th class="col-md-1 center">{{Dernière comm.}}</th>
            <th class="col-md-1 center">{{Date de création}}</th>
            <th>&nbsp;</th>
        </tr>
    </thead>
    <tbody>
<?php
foreach ($eqBrokers as $eqB) { // List all Brokers on top
    echo '<tr><td><a href="' . $eqB->getLinkToConfiguration() . '" class="eName" data-key="' . $eqB->getHumanName() . '" style="text-decoration: none;">' . $eqB->getHumanName(true) . '</a></td>';
    echo '<td style="text-align:center"><span class="label label-info eId" style="font-size:1em;cursor:default;width:70px;height:20px;">' . $eqB->getId() . '</span></td>';
    echo '<td>' . $eqB->getMqttClientInfo()['message'] . '</td>';
    echo '<td style="text-align:center"><span class="label label-info" style="font-size:1em;cursor:default;width:60px;height:20px;">' . (isset($eqNonBrokers[$eqB->getId()]) ? count($eqNonBrokers[$eqB->getId()]) : '0') . '</span></td>';
    echo '<td style="text-align:center"><span class="label label-info" style="font-size:1em;cursor:default;width:135px;height:20px;">' . $eqB->getStatus('lastCommunication') . ' </span></td>';
    echo '<td style="text-align:center"><span class="label label-info" style="font-size:1em;cursor:default;width:135px;height:20px;">' . $eqB->getConfiguration('createtime') . ' </span></td>';
    echo '<td style="text-align:center"><a class="eqLogicAction" data-action="configureEq"><i class="fas fa-cogs"></i></a> ';
    echo '<a class="eqLogicAction" data-action="removeEq"><i class="fas fa-minus-circle"></i></a></td></tr>';
}
?>
    </tbody>
</table>