Metrics: Add theme names

This commit is contained in:
Igor Scheller 2020-09-12 20:53:09 +02:00 committed by msquare
parent 9e73e7e181
commit 9dd2525e93
2 changed files with 10 additions and 1 deletions

View File

@ -72,6 +72,11 @@ class Controller extends BaseController
$userLocales = $this->formatStats($this->stats->languages(), 'locales', 'language', 'locale'); $userLocales = $this->formatStats($this->stats->languages(), 'locales', 'language', 'locale');
$userThemes = $this->formatStats($this->stats->themes(), 'available_themes', 'theme'); $userThemes = $this->formatStats($this->stats->themes(), 'available_themes', 'theme');
$themes = $this->config->get('available_themes');
foreach ($userThemes as $key => $theme) {
$userThemes[$key]['labels']['name'] = $themes[$theme['labels']['theme']];
}
$data = [ $data = [
$this->config->get('app_name') . ' stats', $this->config->get('app_name') . ' stats',
'info' => [ 'info' => [

View File

@ -12,7 +12,11 @@ class ControllerTest extends ApplicationFeatureTest
*/ */
public function testMetrics() public function testMetrics()
{ {
config(['api_key' => null, 'metrics' => ['work' => [60 * 60], 'voucher' => [1]]]); config([
'api_key' => null,
'metrics' => ['work' => [60 * 60], 'voucher' => [1]],
'available_themes' => ['1' => 'Test'],
]);
/** @var Controller $controller */ /** @var Controller $controller */
$controller = app()->make(Controller::class); $controller = app()->make(Controller::class);