mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
fixes #2
This commit is contained in:
@@ -33,10 +33,10 @@ class LanguageController extends Controller
|
||||
->get()
|
||||
->map(function ($language) {
|
||||
$language->translatedCount = Translation::query()
|
||||
->where('language_id', $language['id'])
|
||||
->whereNotNull('value')
|
||||
->where('value', '<>', '')
|
||||
->count();
|
||||
->where('language_id', $language['id'])
|
||||
->whereNotNull('value')
|
||||
->where('value', '<>', '')
|
||||
->count();
|
||||
$language->toTranslate = Translation::query()
|
||||
->where('language_id', $language['id'])
|
||||
->count();
|
||||
@@ -44,10 +44,13 @@ class LanguageController extends Controller
|
||||
})
|
||||
->toArray();
|
||||
foreach ($array as $key => $item) {
|
||||
$array[$key]['name'] = empty($item['name']) ? $item['language'] : $item['name'];
|
||||
$translated = $item['translatedCount'] > 0 ? $item['translatedCount'] : 1;
|
||||
$itemToTranslate = $item['toTranslate'] > 0 ? $item['toTranslate'] : 1;
|
||||
|
||||
$array[$key]['name'] = empty($item['name']) ? $item['language'] : $item['name'];
|
||||
$array[$key]['description'] = $item['language'] === 'en'
|
||||
? '100% translated'
|
||||
: round($item['translatedCount'] ?? 1 / $item['toTranslate'] * 100).'% translated';
|
||||
: round($translated / $itemToTranslate * 100).'% translated';
|
||||
}
|
||||
|
||||
return response()->json($array);
|
||||
|
||||
@@ -19,20 +19,17 @@ class HorizonServiceProvider extends HorizonApplicationServiceProvider
|
||||
// Horizon::routeMailNotificationsTo('example@example.com');
|
||||
// Horizon::routeSlackNotificationsTo('slack-webhook-url', '#channel');
|
||||
|
||||
// Horizon::night();
|
||||
Horizon::night();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the Horizon gate.
|
||||
*
|
||||
* This gate determines who can access Horizon in non-local environments.
|
||||
*/
|
||||
protected function gate(): void
|
||||
{
|
||||
Gate::define('viewHorizon', function ($user) {
|
||||
return in_array($user->email, [
|
||||
//
|
||||
]);
|
||||
return $user->hasRole('super-admin');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,12 +99,12 @@ return [
|
||||
*/
|
||||
|
||||
'trim' => [
|
||||
'recent' => 60,
|
||||
'pending' => 60,
|
||||
'completed' => 60,
|
||||
'recent' => 60,
|
||||
'pending' => 60,
|
||||
'completed' => 60,
|
||||
'recent_failed' => 10080,
|
||||
'failed' => 10080,
|
||||
'monitored' => 10080,
|
||||
'failed' => 10080,
|
||||
'monitored' => 10080,
|
||||
],
|
||||
|
||||
/*
|
||||
@@ -135,7 +135,7 @@ return [
|
||||
|
||||
'metrics' => [
|
||||
'trim_snapshots' => [
|
||||
'job' => 24,
|
||||
'job' => 24,
|
||||
'queue' => 24,
|
||||
],
|
||||
],
|
||||
@@ -181,23 +181,23 @@ return [
|
||||
|
||||
'defaults' => [
|
||||
'supervisor-1' => [
|
||||
'connection' => 'redis',
|
||||
'queue' => ['default'],
|
||||
'balance' => 'auto',
|
||||
'connection' => 'redis',
|
||||
'queue' => ['default'],
|
||||
'balance' => 'auto',
|
||||
'maxProcesses' => 1,
|
||||
'maxTime' => 0,
|
||||
'maxJobs' => 0,
|
||||
'memory' => 128,
|
||||
'tries' => 1,
|
||||
'timeout' => 60,
|
||||
'nice' => 0,
|
||||
'maxTime' => 0,
|
||||
'maxJobs' => 0,
|
||||
'memory' => 128,
|
||||
'tries' => 1,
|
||||
'timeout' => 60,
|
||||
'nice' => 0,
|
||||
],
|
||||
],
|
||||
|
||||
'environments' => [
|
||||
'production' => [
|
||||
'supervisor-1' => [
|
||||
'maxProcesses' => 10,
|
||||
'maxProcesses' => 10,
|
||||
'balanceMaxShift' => 1,
|
||||
'balanceCooldown' => 3,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user