{% extends 'base.html.twig' %} {% block title %}Paramétrage - App Hub BI{% endblock %} {% macro th(label, right) %} {{ label }} {% endmacro %} {% block layout %} {% import _self as t %}
{{ include('_sidebar.html.twig') }}

Paramétrage

Administration de la plateforme

{% for type in ['success', 'error'] %} {% for msg in app.flashes(type) %}
{{ msg }}
{% endfor %} {% endfor %} {% set tabs = {'spaces': 'Espaces', 'apps': 'Applications', 'metiers': 'Métiers', 'users': 'Utilisateurs', 'access': 'Accès', 'audit': "Journaux d'audit", 'settings': 'Stockage'} %}
{% for key, label in tabs %}{% if key in allowedTabs %} {{ label }} {% endif %}{% endfor %}
{# ----------------------------------------------------------- Espaces #} {% if tab == 'spaces' %}

Créer un espace

À la création, le dossier de l'espace est créé dans le stockage.

Espaces ({{ spaces|length }})

{% if spaces is empty %}
Aucun espace créé
{% else %} {{ t.th('Nom') }}{{ t.th('Créateurs assignés') }}{{ t.th('Créé le') }}{{ t.th('Actions', true) }} {% for space in spaces %} {% endfor %}
{{ space.name }}
renommer
{% for c in space.creators %} {{ c.email }}
{% else %} Aucun {% endfor %}
{{ space.createdAt|date('d/m/Y') }}
{% endif %}
{% endif %} {# ------------------------------------------------------- Applications #} {% if tab == 'apps' %}

Ajouter une application

{% if not s3.configured %}
⚠️ Stockage non configuré (onglet Stockage) — à renseigner avant d'ajouter une application.
{% endif %}
{% if metiers is not empty %}
{% for m in metiers %}{% endfor %}
{% endif %}

Emplacement :

Applications ({{ apps|length }})

{% if apps is empty %}
Aucune application
{% else %} {{ t.th('Nom') }}{{ t.th('Espace') }}{{ t.th('Source') }}{{ t.th('Miniature') }}{{ t.th('Actions', true) }} {% for app in apps %} {% endfor %}
{{ app.name }} {{ app.space.name }} {% if app.appType == 's3' %} {{ app.url }} {% elseif app.appType in ['url', 'iframe'] %} {{ app.appType == 'iframe' ? 'Intégré' : 'Lien' }}{{ app.url }} {% else %} {{ app.htmlFilename ?: '—' }} {% endif %} {% if app.thumbnailFilename %}Oui{% else %}Non{% endif %}

Modifier l'application

{% if app.thumbnailFilename %}{% endif %}
{% if metiers is not empty %} {% set appMetierIds = app.metiers|map(m => m.id) %}
{% for m in metiers %}{% endfor %}
{% endif %}
{% if app.appType == 'html' %}

Remplacer le contenu HTML

{% endif %}
{% endif %}
{% endif %} {# ------------------------------------------------------------ Métiers #} {% if tab == 'metiers' %}

Importer des métiers

Fichier CSV ou Excel (.xlsx) — une ligne = un métier et un email. Le métier est créé s'il n'existe pas, l'utilisateur (Lecteur) aussi, et le métier lui est affecté.

Ajouter un métier

Métiers ({{ metiers|length }})

{% if metiers is empty %}
Aucun métier
{% else %} {{ t.th('Nom') }}{{ t.th('Actions', true) }} {% for m in metiers %} {% endfor %}
{{ m.name }}
{% endif %}
{% endif %} {# ------------------------------------------------------- Utilisateurs #} {% if tab == 'users' %}

Créer un utilisateur

Utilisateurs ({{ users|length }})

{% if users is empty %}
Aucun utilisateur
{% else %} {{ t.th('Email') }}{{ t.th('Licence') }}{{ t.th('Métier') }}{{ t.th('Créé le') }}{{ t.th('Actions', true) }} {% for u in users %} {% endfor %}
{{ u.email }}
{{ u.createdAt|date('d/m/Y') }}
{% endif %}
{% endif %} {# ------------------------------------------------------------- Accès #} {% if tab == 'access' %}

Accorder un accès

Accès accordés ({{ permissions|length }})

{% if permissions is empty %}
Aucun accès accordé
{% else %} {{ t.th('Utilisateur') }}{{ t.th('Application') }}{{ t.th('Espace') }}{{ t.th('Accordé le') }}{{ t.th('Actions', true) }} {% for p in permissions %} {% endfor %}
{{ p.userEmail }} {{ p.app.name }} {{ p.app.space.name }} {{ p.grantedAt|date('d/m/Y') }}
{% endif %}
{# --- Accès par métier --- #} {% if metiers is not empty %}

Accorder un accès par métier

{% endif %} {% set metierAccessCount = apps|filter(a => a.metiers|length > 0)|length %}

Accès par métier

{% if metierAccessCount == 0 %}
Aucun accès par métier
{% else %} {{ t.th('Métier') }}{{ t.th('Application') }}{{ t.th('Espace') }}{{ t.th('Actions', true) }} {% for a in apps %}{% for m in a.metiers %} {% endfor %}{% endfor %}
{{ m.name }} {{ a.name }} {{ a.space.name }}
{% endif %}
{% endif %} {# ------------------------------------------------------------- Audit #} {% if tab == 'audit' %}

Journaux d'audit ({{ auditLogs|length }})

{% if auditLogs is empty %}
Aucun événement enregistré
{% else %}
{{ t.th('Date & heure') }}{{ t.th('Utilisateur') }}{{ t.th('Action') }}{{ t.th('Application') }}{{ t.th('Espace') }} {% for log in auditLogs %} {% endfor %}
{{ log.timestamp|date('d/m/Y H:i:s') }} {{ log.userEmail }} {{ log.action == 'login' ? 'Connexion' : 'Ouverture app' }} {{ log.appName ?: '—' }} {{ log.spaceName ?: '—' }}
{% endif %}
{% endif %} {# ---------------------------------------------------------- Paramètres #} {% if tab == 'settings' %}

Stockage des fichiers

{% if s3.configured %} Configuré {% else %} Non configuré {% endif %}

Stockage distant où sont déposés et lus les fichiers HTML des applications.

Configuration dans .env.local (sur le serveur). Les accès au stockage — y compris la clé secrète — ne sont volontairement pas saisis dans l'interface ni stockés en base. Pour les modifier, éditez .env.local puis videz le cache. Variables : S3_ACCESS_KEY, S3_SECRET_KEY, S3_REGION, S3_BUCKET, S3_ENDPOINT, S3_EXPIRY. Conseil : une clé IAM dédiée, en lecture seule (s3:GetObject sur ce bucket).
Région
{{ s3.region ?: '—' }}
Bucket
{{ s3.bucket ?: '—' }}
Endpoint
{{ s3.endpoint ?: 'AWS standard' }}
Validité des liens
{{ s3.expiry }} s
Identifiants
{{ s3.configured ? 'présents (.env.local)' : 'manquants' }}

Tester la connexion

Génère un lien pré-signé pour une clé d'objet et l'ouvre dans un nouvel onglet (enregistrez d'abord la configuration ci-dessus). Le test s'exécute dans votre navigateur car le serveur n'a pas d'accès réseau sortant : si le fichier s'affiche, les accès sont bons ; une erreur 403 / SignatureDoesNotMatch indique une clé erronée, et NoSuchKey un fichier inexistant.

{% endif %}
{% endblock %} {% block javascripts %} {% if tab in ['spaces', 'apps'] %} {% endif %} {% if tab == 'apps' %} {% endif %} {% if tab == 'settings' %} {% endif %} {% endblock %}