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