Fix PHP warnings on the server status data not set
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
b3eeb098a3
commit
aa0c22959d
@ -54,6 +54,8 @@ class StatusController extends AbstractController
|
|||||||
$connections = [];
|
$connections = [];
|
||||||
$replication = '';
|
$replication = '';
|
||||||
if ($this->data->dataLoaded) {
|
if ($this->data->dataLoaded) {
|
||||||
|
// In some case the data was reported not to exist, check it for all keys
|
||||||
|
if (isset($this->data->status['Bytes_received'], $this->data->status['Bytes_sent'])) {
|
||||||
$networkTraffic = implode(
|
$networkTraffic = implode(
|
||||||
' ',
|
' ',
|
||||||
Util::formatByteDown(
|
Util::formatByteDown(
|
||||||
@ -62,7 +64,10 @@ class StatusController extends AbstractController
|
|||||||
1
|
1
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
if (isset($this->data->status['Uptime'])) {
|
||||||
$uptime = Util::timespanFormat($this->data->status['Uptime']);
|
$uptime = Util::timespanFormat($this->data->status['Uptime']);
|
||||||
|
}
|
||||||
$startTime = Util::localisedDate($this->getStartTime());
|
$startTime = Util::localisedDate($this->getStartTime());
|
||||||
|
|
||||||
$traffic = $this->getTrafficInfo();
|
$traffic = $this->getTrafficInfo();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user