{% 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', 'users': 'Utilisateurs', 'access': 'Accès', 'audit': "Journaux d'audit", 'settings': 'S3'} %}
{% for key, label in tabs %} {{ label }} {% endfor %}
{# ----------------------------------------------------------- Espaces #} {% if tab == 'spaces' %}

Créer un espace

Espaces ({{ spaces|length }})

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

Ajouter une application Web

Applications ({{ apps|length }})

{% if apps is empty %}
Aucune application
{% else %} {{ t.th('Nom') }}{{ t.th('Espace') }}{{ t.th('Source') }}{{ t.th('Miniature') }}{{ t.th('Lien public') }}{{ t.th('Actions', true) }} {% for app in apps %} {% endfor %}
{{ app.name }} {{ app.space.name }} {% if app.appType == 's3' %} 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 %} {% if app.publicToken %}
Actif
{% else %}
{% endif %}

Modifier l'application

{% if app.thumbnailFilename %}{% endif %}
{% if app.appType == 'html' %}

Remplacer le contenu HTML

{% endif %}
{% 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('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 %}
{% 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' %}

Amazon S3

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

Permet d'ajouter des applications dont le fichier HTML est stocké sur S3 : app-hub génère un lien pré-signé à la volée (signature locale, sans accès réseau) et affiche le dashboard en plein écran.

Configuration dans .env.local (sur le serveur). Les accès S3 — 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 S3 403 / SignatureDoesNotMatch indique une clé erronée, et NoSuchKey une clé d'objet inexistante.

{% endif %}
{% endblock %} {% block javascripts %} {% if tab == 'apps' %} {% endif %} {% if tab == 'settings' %} {% endif %} {% endblock %}