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