mirror of
https://github.com/nidebr/as-stats-gui.git
synced 2025-02-20 11:23:18 +08:00
save
This commit is contained in:
parent
b79da8b937
commit
96087e8ed1
@ -1,4 +1,5 @@
|
||||
config:
|
||||
language: 'fr'
|
||||
top: 20
|
||||
daystatsfile: '/home/nidebr/data/DEV/asstats/stats/asstats_day.txt'
|
||||
knownlinksfile: '/home/nidebr/data/DEV/asstats/conf/knownlinks'
|
||||
|
@ -66,9 +66,9 @@ class ConfigApplication
|
||||
return self::getAsStatsConfig()['top'];
|
||||
}
|
||||
|
||||
public static function getLangage(): string
|
||||
public static function getLanguage(): string
|
||||
{
|
||||
if (false === \array_key_exists('langage', self::getAsStatsConfig())) {
|
||||
if (false === \array_key_exists('language', self::getAsStatsConfig())) {
|
||||
return 'en';
|
||||
}
|
||||
|
||||
|
@ -11,21 +11,25 @@ use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\Translation\LocaleSwitcher;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
abstract class BaseController extends AbstractController
|
||||
{
|
||||
protected ConfigApplication $configApplication;
|
||||
protected TranslatorInterface $translator;
|
||||
protected array $base_data = [];
|
||||
|
||||
public function __construct(
|
||||
ConfigApplication $configApplication,
|
||||
RequestStack $requestStack,
|
||||
LocaleSwitcher $localeSwitcher,
|
||||
TranslatorInterface $translator,
|
||||
) {
|
||||
$this->configApplication = $configApplication;
|
||||
$this->base_data = self::getBaseData($requestStack);
|
||||
$this->translator = $translator;
|
||||
|
||||
$localeSwitcher->setLocale($this->configApplication::getLangage());
|
||||
$localeSwitcher->setLocale($this->configApplication::getLanguage());
|
||||
}
|
||||
|
||||
private function getBaseData(
|
||||
|
@ -16,7 +16,6 @@ use Doctrine\DBAL\Exception;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
#[Menu('top_as')]
|
||||
class IndexController extends BaseController
|
||||
@ -38,12 +37,11 @@ class IndexController extends BaseController
|
||||
Request $request,
|
||||
GetAsDataRepository $asDataRepository,
|
||||
GetStartEndGraph $getStartEndGraph,
|
||||
TranslatorInterface $translator,
|
||||
): Response {
|
||||
$this->base_data['content_wrapper']['titre'] = \sprintf(
|
||||
'Top %s (%s)',
|
||||
$this->base_data['top'],
|
||||
$translator->trans('hour', ['num_hours' => 24]),
|
||||
$this->translator->trans('hour', ['num_hours' => 24]),
|
||||
);
|
||||
|
||||
$form = $this->createForm(LegendForm::class);
|
||||
|
@ -17,11 +17,11 @@
|
||||
<div class="col">
|
||||
<div class="list-inline list-inline-dots mb-0 text-secondary d-sm-block d-none">
|
||||
{% if configapplication_graph('outispositive') %}
|
||||
<div class="list-inline-item">{{ icon('up') }} Outbound traffic</div>
|
||||
<div class="list-inline-item">{{ icon('down') }} Inbound traffic</div>
|
||||
<div class="list-inline-item">{{ icon('up') }} {{ 'outbound traffic'|trans }}</div>
|
||||
<div class="list-inline-item">{{ icon('down') }} {{ 'inbound traffic'|trans }}</div>
|
||||
{% else %}
|
||||
<div class="list-inline-item">{{ icon('up') }} Inbound traffic</div>
|
||||
<div class="list-inline-item">{{ icon('down') }} Outbound traffic</div>
|
||||
<div class="list-inline-item">{{ icon('up') }} {{ 'inbound traffic'|trans }}</div>
|
||||
<div class="list-inline-item">{{ icon('down') }} {{ 'outbound traffic'|trans }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -4,3 +4,7 @@ hour: >-
|
||||
=1 {# hour}
|
||||
other {# hours}
|
||||
}
|
||||
|
||||
outbound traffic: Outbound traffic
|
||||
inbound traffic: Inbound traffic
|
||||
|
||||
|
@ -4,3 +4,6 @@ hour: >-
|
||||
=1 {# heure}
|
||||
other {# heures}
|
||||
}
|
||||
|
||||
outbound traffic: Trafic sortant
|
||||
inbound traffic: Trafic entrant
|
||||
|
Loading…
x
Reference in New Issue
Block a user