Skip to content

Commit

Permalink
Adjust telemetry to meet requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
yorkshire-pudding committed Jul 24, 2024
1 parent c7ff388 commit 1953a49
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
23 changes: 13 additions & 10 deletions commands/status.bee.inc
Original file line number Diff line number Diff line change
Expand Up @@ -284,22 +284,19 @@ function status_bee_callback($arguments, $options) {
array('value' => bt('Status')),
array('value' => $telemetry_status ? 'on' : 'off'),
);
if ($telemetry_status) {
$data_summary = json_encode(bee_telemetry_get_data());
}
else {
$data_summary = bt('None');
}
$rows[] = array(
array('value' => bt('Data')),
array('value' => $data_summary),
);
if ($telemetry_status) {
$rows[] = array(
array('value' => bt('Last sent')),
array('value' => $bee_telemetry_last),
);
}
if ($telemetry_status) {
$data_summary = json_encode(bee_telemetry_get_data());
}
else {
$data_summary = bt('None');
}
$data_string = " Data: $data_summary\n";

echo "\n";
return array(
Expand All @@ -312,6 +309,12 @@ function status_bee_callback($arguments, $options) {
'delimiter_right' => ' ',
),
),
array(
'type' => 'text',
'variables' => array(
'value' => $data_string,
),
),
);
}
else {
Expand Down
1 change: 1 addition & 0 deletions includes/telemetry.inc
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ function bee_telemetry_get_data() {
$data = array(
'bee' => array(
'version' => BEE_VERSION,
'bee_version' => BEE_VERSION,
'php_version' => PHP_VERSION,
'multisite' => !empty($_bee_multisites) ? 'Yes' : 'No',
),
Expand Down

0 comments on commit 1953a49

Please sign in to comment.