Thème
Superviseur — Frontend / layouts/components/useSidebarCommands / useSidebarCommands
Fonction: useSidebarCommands()
ts
function useSidebarCommands(): object;1
Défini dans: layouts/components/useSidebarCommands.ts:27
Logique du volet de commandes de la barre latérale : icônes des commandes, sélection de la centrale et de la cible, ouverture des flyouts par type, envoi des commandes (réarmement réservé au SuperAdmin) et confirmation. Extrait de SidebarCommands.vue.
Retourne
| Nom | Type | Valeur par défaut | Description | Défini dans |
|---|---|---|---|---|
IconCheck | VNode<RendererNode, RendererElement, { [key: string]: any; }> | - | - | layouts/components/useSidebarCommands.ts:351 |
IconShield | VNode<RendererNode, RendererElement, { [key: string]: any; }> | - | - | layouts/components/useSidebarCommands.ts:352 |
IconChevronRight | VNode<RendererNode, RendererElement, { [key: string]: any; }> | - | - | layouts/components/useSidebarCommands.ts:353 |
iconFor() | (name) => Component | - | - | layouts/components/useSidebarCommands.ts:354 |
commandLabel() | (command) => string | - | Libellé d'une commande, tel que l'opérateur doit le lire. Un profil déclaré depuis l'application nomme ses commandes en toutes lettres et ne dispose d'aucune clé de traduction : sans ce repli, le bouton porterait le chemin de traduction. Le libellé anglais sert aux postes en anglais, avec repli sur l'autre langue plutôt qu'un vide. | layouts/components/useSidebarCommands.ts:355 |
panelStore | Store<"panel", Pick<{ configurations: Ref<object[], | StationConfiguration[] | object[]>; profiles: Ref<object[], | ModbusProfile[] | object[]>; liveStates: Ref<Record<string, FireStationSystem>, Record<string, FireStationSystem>>; panelStates: Ref<Record<string, PanelSnapshot>, Record<string, PanelSnapshot>>; selectedStationId: Ref<string | null, string | null>; selectedPanelId: ComputedRef<string | number | null>; currentConfig: ComputedRef< | { id?: string | number; name: string; systemSerialNumber?: string; label: string; description?: string; connectionType?: "Tcp" | "Rtu"; ipAddress?: string; port?: number; serialPortName?: string; baudRate?: number; dataBits?: number; parity?: number; stopBits?: number; pollingIntervalMilliseconds: number; slaveId: number; panelType: string; color: string; modbusMapping: string; modbusProfileId: string; zones: object[]; points?: object[]; rawConfiguration?: string; } | undefined>; panelState: ComputedRef< | FireStationSystem | null>; apiConnected: Ref<boolean, boolean>; hasEverConnected: Ref<boolean, boolean>; modbusConnected: Ref<boolean, boolean>; systemStatus: ComputedRef<{ text: string; color: string; }>; activeAlerts: ComputedRef<object[]>; allActiveAlerts: ComputedRef<Alert[]>; groupedIncidents: ComputedRef<StationGroup[]>; activeIncidentCount: ComputedRef<number>; activeAlertsCount: ComputedRef<number>; allActiveAlertsCount: ComputedRef<number>; isGlobalEvacuationActive: ComputedRef<boolean>; connectionStatus: ComputedRef<{ api: { connected: boolean; text: string; color: string; }; modbus: { connected: boolean | undefined; text: string; color: string; }; }>; systemIssues: ComputedRef<SystemIssue[]>; lastDataChange: Ref<number, number>; isFleetHealthy: ComputedRef<boolean>; pendingCommands: Ref<Record<string, boolean>, Record<string, boolean>>; isCommandPending: (serial) => boolean; markCommandPending: (serial, delayMs) => void; statusSince: (serial, kind, index) => number | null; setPanelState: (newState) => void; switchPanel: (id) => void; addPanel: (config) => Promise<void>; removePanel: (dbId) => Promise<void>; setPanelSupervision: (panelId, serial, enabled) => Promise<PanelDto>; setAllPanelsSupervision: (enabled) => Promise<void>; loadConfigurations: () => Promise<void>; loadInitialData: () => Promise<void>; updatePanel: (config) => Promise<void>; updatePanelState: (snapshot) => void; forgetPanel: (panelId, systemSerialNumber?) => void; isPanelConnected: (id) => boolean; isPanelInAlarm: (id) => boolean; setConnectionStatus: (isConnected) => void; setModbusConnected: (s) => boolean; initialize: () => Promise<void>; initialized: Ref<boolean, boolean>; isInitializing: Ref<boolean, boolean>; toggleMute: () => void; isAudioMuted: ComputedRef<boolean>; hasActiveAlert: ComputedRef<boolean>; acknowledgeAlert: (stationId, type, index, flag?) => Promise<void>; rearmStation: (stationId) => Promise<void>; }, | "profiles" | "modbusConnected" | "configurations" | "liveStates" | "panelStates" | "selectedStationId" | "apiConnected" | "hasEverConnected" | "lastDataChange" | "pendingCommands" | "initialized" | "isInitializing">, Pick<{ configurations: Ref<object[], | StationConfiguration[] | object[]>; profiles: Ref<object[], | ModbusProfile[] | object[]>; liveStates: Ref<Record<string, FireStationSystem>, Record<string, FireStationSystem>>; panelStates: Ref<Record<string, PanelSnapshot>, Record<string, PanelSnapshot>>; selectedStationId: Ref<string | null, string | null>; selectedPanelId: ComputedRef<string | number | null>; currentConfig: ComputedRef< | { id?: string | number; name: string; systemSerialNumber?: string; label: string; description?: string; connectionType?: "Tcp" | "Rtu"; ipAddress?: string; port?: number; serialPortName?: string; baudRate?: number; dataBits?: number; parity?: number; stopBits?: number; pollingIntervalMilliseconds: number; slaveId: number; panelType: string; color: string; modbusMapping: string; modbusProfileId: string; zones: object[]; points?: object[]; rawConfiguration?: string; } | undefined>; panelState: ComputedRef< | FireStationSystem | null>; apiConnected: Ref<boolean, boolean>; hasEverConnected: Ref<boolean, boolean>; modbusConnected: Ref<boolean, boolean>; systemStatus: ComputedRef<{ text: string; color: string; }>; activeAlerts: ComputedRef<object[]>; allActiveAlerts: ComputedRef<Alert[]>; groupedIncidents: ComputedRef<StationGroup[]>; activeIncidentCount: ComputedRef<number>; activeAlertsCount: ComputedRef<number>; allActiveAlertsCount: ComputedRef<number>; isGlobalEvacuationActive: ComputedRef<boolean>; connectionStatus: ComputedRef<{ api: { connected: boolean; text: string; color: string; }; modbus: { connected: boolean | undefined; text: string; color: string; }; }>; systemIssues: ComputedRef<SystemIssue[]>; lastDataChange: Ref<number, number>; isFleetHealthy: ComputedRef<boolean>; pendingCommands: Ref<Record<string, boolean>, Record<string, boolean>>; isCommandPending: (serial) => boolean; markCommandPending: (serial, delayMs) => void; statusSince: (serial, kind, index) => number | null; setPanelState: (newState) => void; switchPanel: (id) => void; addPanel: (config) => Promise<void>; removePanel: (dbId) => Promise<void>; setPanelSupervision: (panelId, serial, enabled) => Promise<PanelDto>; setAllPanelsSupervision: (enabled) => Promise<void>; loadConfigurations: () => Promise<void>; loadInitialData: () => Promise<void>; updatePanel: (config) => Promise<void>; updatePanelState: (snapshot) => void; forgetPanel: (panelId, systemSerialNumber?) => void; isPanelConnected: (id) => boolean; isPanelInAlarm: (id) => boolean; setConnectionStatus: (isConnected) => void; setModbusConnected: (s) => boolean; initialize: () => Promise<void>; initialized: Ref<boolean, boolean>; isInitializing: Ref<boolean, boolean>; toggleMute: () => void; isAudioMuted: ComputedRef<boolean>; hasActiveAlert: ComputedRef<boolean>; acknowledgeAlert: (stationId, type, index, flag?) => Promise<void>; rearmStation: (stationId) => Promise<void>; }, | "systemStatus" | "hasActiveAlert" | "selectedPanelId" | "currentConfig" | "panelState" | "activeAlerts" | "allActiveAlerts" | "groupedIncidents" | "activeIncidentCount" | "activeAlertsCount" | "allActiveAlertsCount" | "isGlobalEvacuationActive" | "connectionStatus" | "systemIssues" | "isFleetHealthy" | "isAudioMuted">, Pick<{ configurations: Ref<object[], | StationConfiguration[] | object[]>; profiles: Ref<object[], | ModbusProfile[] | object[]>; liveStates: Ref<Record<string, FireStationSystem>, Record<string, FireStationSystem>>; panelStates: Ref<Record<string, PanelSnapshot>, Record<string, PanelSnapshot>>; selectedStationId: Ref<string | null, string | null>; selectedPanelId: ComputedRef<string | number | null>; currentConfig: ComputedRef< | { id?: string | number; name: string; systemSerialNumber?: string; label: string; description?: string; connectionType?: "Tcp" | "Rtu"; ipAddress?: string; port?: number; serialPortName?: string; baudRate?: number; dataBits?: number; parity?: number; stopBits?: number; pollingIntervalMilliseconds: number; slaveId: number; panelType: string; color: string; modbusMapping: string; modbusProfileId: string; zones: object[]; points?: object[]; rawConfiguration?: string; } | undefined>; panelState: ComputedRef< | FireStationSystem | null>; apiConnected: Ref<boolean, boolean>; hasEverConnected: Ref<boolean, boolean>; modbusConnected: Ref<boolean, boolean>; systemStatus: ComputedRef<{ text: string; color: string; }>; activeAlerts: ComputedRef<object[]>; allActiveAlerts: ComputedRef<Alert[]>; groupedIncidents: ComputedRef<StationGroup[]>; activeIncidentCount: ComputedRef<number>; activeAlertsCount: ComputedRef<number>; allActiveAlertsCount: ComputedRef<number>; isGlobalEvacuationActive: ComputedRef<boolean>; connectionStatus: ComputedRef<{ api: { connected: boolean; text: string; color: string; }; modbus: { connected: boolean | undefined; text: string; color: string; }; }>; systemIssues: ComputedRef<SystemIssue[]>; lastDataChange: Ref<number, number>; isFleetHealthy: ComputedRef<boolean>; pendingCommands: Ref<Record<string, boolean>, Record<string, boolean>>; isCommandPending: (serial) => boolean; markCommandPending: (serial, delayMs) => void; statusSince: (serial, kind, index) => number | null; setPanelState: (newState) => void; switchPanel: (id) => void; addPanel: (config) => Promise<void>; removePanel: (dbId) => Promise<void>; setPanelSupervision: (panelId, serial, enabled) => Promise<PanelDto>; setAllPanelsSupervision: (enabled) => Promise<void>; loadConfigurations: () => Promise<void>; loadInitialData: () => Promise<void>; updatePanel: (config) => Promise<void>; updatePanelState: (snapshot) => void; forgetPanel: (panelId, systemSerialNumber?) => void; isPanelConnected: (id) => boolean; isPanelInAlarm: (id) => boolean; setConnectionStatus: (isConnected) => void; setModbusConnected: (s) => boolean; initialize: () => Promise<void>; initialized: Ref<boolean, boolean>; isInitializing: Ref<boolean, boolean>; toggleMute: () => void; isAudioMuted: ComputedRef<boolean>; hasActiveAlert: ComputedRef<boolean>; acknowledgeAlert: (stationId, type, index, flag?) => Promise<void>; rearmStation: (stationId) => Promise<void>; }, | "removePanel" | "addPanel" | "isCommandPending" | "markCommandPending" | "statusSince" | "setPanelState" | "switchPanel" | "setPanelSupervision" | "setAllPanelsSupervision" | "loadConfigurations" | "loadInitialData" | "updatePanel" | "updatePanelState" | "forgetPanel" | "isPanelConnected" | "isPanelInAlarm" | "setConnectionStatus" | "setModbusConnected" | "initialize" | "toggleMute" | "acknowledgeAlert" | "rearmStation">> | - | - | layouts/components/useSidebarCommands.ts:356 |
isCommandLocked() | (cmd) => boolean | - | - | layouts/components/useSidebarCommands.ts:357 |
apiConnected | ComputedRef<boolean> | - | - | layouts/components/useSidebarCommands.ts:358 |
panelTypes | ComputedRef<object[]> | - | Profils présents dans le site (distincts), avec leur libellé et le nombre de centrales. | layouts/components/useSidebarCommands.ts:359 |
flyoutType | Ref<string | null, string | null> | - | - | layouts/components/useSidebarCommands.ts:360 |
flyoutStyle | object | - | - | layouts/components/useSidebarCommands.ts:361 |
flyoutStyle.top | string | '0px' | - | layouts/components/useSidebarCommands.ts:138 |
flyoutStyle.left | string | '0px' | - | layouts/components/useSidebarCommands.ts:138 |
arrowTop | Ref<number, number> | - | - | layouts/components/useSidebarCommands.ts:362 |
flyoutCommands | ComputedRef<CommandDefinition[]> | - | - | layouts/components/useSidebarCommands.ts:363 |
flyoutLabel | ComputedRef<string> | - | - | layouts/components/useSidebarCommands.ts:364 |
toggleFlyout() | (type, event) => void | - | - | layouts/components/useSidebarCommands.ts:365 |
closeFlyout() | () => void | - | - | layouts/components/useSidebarCommands.ts:366 |
loading | Ref<string | null, string | null> | - | - | layouts/components/useSidebarCommands.ts:367 |
selectedPanel | Ref<string, string> | - | - | layouts/components/useSidebarCommands.ts:368 |
showConfirmDialog | Ref<boolean, boolean> | - | - | layouts/components/useSidebarCommands.ts:369 |
pendingCommand | Ref< | { key: string; labelKey: string; icon: string; scope: CommandScope; variant: string; confirmRequired: boolean; targetsSystemEntity?: boolean; order: number; label?: string | null; labelEn?: string | null; enabled?: boolean; } | null, | CommandDefinition | { key: string; labelKey: string; icon: string; scope: CommandScope; variant: string; confirmRequired: boolean; targetsSystemEntity?: boolean; order: number; label?: string | null; labelEn?: string | null; enabled?: boolean; } | null> | - | - | layouts/components/useSidebarCommands.ts:370 |
commandTarget | Ref<{ zone: number | null; target: number | null; }, | { zone: number | null; target: number | null; } | { zone: number | null; target: number | null; }> | - | - | layouts/components/useSidebarCommands.ts:371 |
panelsOfActiveType | ComputedRef<object[]> | - | Centrales du type actif (celui dont le flyout est ouvert), pour le sélecteur de la modal. | layouts/components/useSidebarCommands.ts:372 |
availableZones | ComputedRef<Zone[]> | - | - | layouts/components/useSidebarCommands.ts:373 |
getPointsForZone() | (zoneId) => object[] | - | - | layouts/components/useSidebarCommands.ts:374 |
needsTargetSelection() | (cmd) => boolean | - | - | layouts/components/useSidebarCommands.ts:375 |
isZoneCommand() | (cmd) => boolean | - | - | layouts/components/useSidebarCommands.ts:376 |
getTargetLabel() | (cmd) => string | - | - | layouts/components/useSidebarCommands.ts:377 |
isTargetValid() | () => boolean | - | - | layouts/components/useSidebarCommands.ts:378 |
confirmCommand() | (cmd) => void | - | - | layouts/components/useSidebarCommands.ts:379 |
cancelCommand() | () => void | - | - | layouts/components/useSidebarCommands.ts:380 |
executePendingCommand() | () => Promise<void> | - | - | layouts/components/useSidebarCommands.ts:381 |
isMobile | Readonly<Ref<boolean, boolean>> | - | - | layouts/components/useSidebarCommands.ts:382 |