diff --git a/TODO.md b/TODO.md index 59dee4d..08eab34 100644 --- a/TODO.md +++ b/TODO.md @@ -177,7 +177,7 @@ Valider la faisabilité technique : 2-4 clients, PTT basique, latence < 150ms, m - [x] API PUT /api/audio/channels/names (sauvegarde noms canaux) - [x] API GET /api/audio/channels/names (récupération noms) - [x] Page admin : formulaire nommage canaux (inputs/outputs) -- [ ] Page admin : filtre "canaux nommés uniquement" +- [x] Page admin : filtre "canaux nommés uniquement" - [x] Sauvegarde automatique dans config.yaml #### Matrice de routing (style Dante Controller) diff --git a/client/src/components/AudioRoutingMatrix.jsx b/client/src/components/AudioRoutingMatrix.jsx index 29341f1..21ec7d8 100644 --- a/client/src/components/AudioRoutingMatrix.jsx +++ b/client/src/components/AudioRoutingMatrix.jsx @@ -6,6 +6,7 @@ const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:3000'; function AudioRoutingMatrix({ groups, channelNames }) { const [routing, setRouting] = useState({ inputToGroup: {}, groupToOutput: {}, gains: {} }); const [loading, setLoading] = useState(true); + const [showOnlyNamedChannels, setShowOnlyNamedChannels] = useState(false); useEffect(() => { loadRouting(); @@ -104,6 +105,26 @@ function AudioRoutingMatrix({ groups, channelNames }) { return name || `${type === 'inputs' ? 'Input' : 'Output'} ${id}`; }; + const hasCustomName = (type, id) => { + return channelNames?.[type]?.[id] !== undefined; + }; + + const getVisibleInputChannels = () => { + const allInputs = Array.from({length: 8}, (_, i) => i); + if (showOnlyNamedChannels) { + return allInputs.filter(i => hasCustomName('inputs', i)); + } + return allInputs; + }; + + const getVisibleOutputChannels = () => { + const allOutputs = Array.from({length: 8}, (_, i) => i); + if (showOnlyNamedChannels) { + return allOutputs.filter(i => hasCustomName('outputs', i)); + } + return allOutputs; + }; + if (loading) { return
Chargement...
; } @@ -112,9 +133,19 @@ function AudioRoutingMatrix({ groups, channelNames }) {

Matrice de routing audio

- +
+ + +
@@ -132,7 +163,7 @@ function AudioRoutingMatrix({ groups, channelNames }) {
))} - {Array.from({length: 8}, (_, i) => ( + {getVisibleInputChannels().map(i => (
{getChannelName('inputs', i)} @@ -158,10 +189,10 @@ function AudioRoutingMatrix({ groups, channelNames }) { Sélectionnez vers quels outputs chaque groupe envoie son audio

-
+
- {Array.from({length: 8}, (_, i) => ( + {getVisibleOutputChannels().map(i => (
{getChannelName('outputs', i)}
@@ -173,7 +204,7 @@ function AudioRoutingMatrix({ groups, channelNames }) { {group.name}
- {Array.from({length: 8}, (_, i) => ( + {getVisibleOutputChannels().map(i => (