Thème
Superviseur — Frontend / stores/incident-profile.store / useIncidentProfileStore
Variable: useIncidentProfileStore
ts
const useIncidentProfileStore: StoreDefinition<"incident-profile", Pick<{
profiles: Ref<object[],
| IncidentProfile[]
| object[]>;
loaded: Ref<boolean, boolean>;
load: () => Promise<void>;
allIncidents: ComputedRef<IncidentDefinition[]>;
systemSounds: ComputedRef<SystemSound[]>;
incidentForKind: (kind) =>
| IncidentDefinition
| undefined;
labelKeyFor: (kind) => string | undefined;
labelFor: (kind, locale?) => string | undefined;
iconFor: (kind) => string | undefined;
dominantFlag: (flags) => string | undefined;
isAcknowledgeable: (flag) => boolean;
audioKeyForKind: (kind) => string | null;
orderedAudioKeys: ComputedRef<string[]>;
precedenceForAudioKey: (audioKey) => number;
criticalAudioKeys: ComputedRef<Set<string>>;
minVolumeFor: (audioKey) => number | undefined;
profileForType: (panelType) =>
| IncidentProfile
| undefined;
profileById: (profileId) =>
| IncidentProfile
| undefined;
profileFor: (profileId, panelType) =>
| IncidentProfile
| undefined;
capabilitiesFor: (profileId, panelType) => object;
commandsFor: (panelTypeOrProfileId, panelType?) => CommandDefinition[];
systemFlagsFor: (panelType) => SystemFlagDefinition[];
}, "profiles" | "loaded">, Pick<{
profiles: Ref<object[],
| IncidentProfile[]
| object[]>;
loaded: Ref<boolean, boolean>;
load: () => Promise<void>;
allIncidents: ComputedRef<IncidentDefinition[]>;
systemSounds: ComputedRef<SystemSound[]>;
incidentForKind: (kind) =>
| IncidentDefinition
| undefined;
labelKeyFor: (kind) => string | undefined;
labelFor: (kind, locale?) => string | undefined;
iconFor: (kind) => string | undefined;
dominantFlag: (flags) => string | undefined;
isAcknowledgeable: (flag) => boolean;
audioKeyForKind: (kind) => string | null;
orderedAudioKeys: ComputedRef<string[]>;
precedenceForAudioKey: (audioKey) => number;
criticalAudioKeys: ComputedRef<Set<string>>;
minVolumeFor: (audioKey) => number | undefined;
profileForType: (panelType) =>
| IncidentProfile
| undefined;
profileById: (profileId) =>
| IncidentProfile
| undefined;
profileFor: (profileId, panelType) =>
| IncidentProfile
| undefined;
capabilitiesFor: (profileId, panelType) => object;
commandsFor: (panelTypeOrProfileId, panelType?) => CommandDefinition[];
systemFlagsFor: (panelType) => SystemFlagDefinition[];
},
| "allIncidents"
| "systemSounds"
| "orderedAudioKeys"
| "criticalAudioKeys">, Pick<{
profiles: Ref<object[],
| IncidentProfile[]
| object[]>;
loaded: Ref<boolean, boolean>;
load: () => Promise<void>;
allIncidents: ComputedRef<IncidentDefinition[]>;
systemSounds: ComputedRef<SystemSound[]>;
incidentForKind: (kind) =>
| IncidentDefinition
| undefined;
labelKeyFor: (kind) => string | undefined;
labelFor: (kind, locale?) => string | undefined;
iconFor: (kind) => string | undefined;
dominantFlag: (flags) => string | undefined;
isAcknowledgeable: (flag) => boolean;
audioKeyForKind: (kind) => string | null;
orderedAudioKeys: ComputedRef<string[]>;
precedenceForAudioKey: (audioKey) => number;
criticalAudioKeys: ComputedRef<Set<string>>;
minVolumeFor: (audioKey) => number | undefined;
profileForType: (panelType) =>
| IncidentProfile
| undefined;
profileById: (profileId) =>
| IncidentProfile
| undefined;
profileFor: (profileId, panelType) =>
| IncidentProfile
| undefined;
capabilitiesFor: (profileId, panelType) => object;
commandsFor: (panelTypeOrProfileId, panelType?) => CommandDefinition[];
systemFlagsFor: (panelType) => SystemFlagDefinition[];
},
| "load"
| "incidentForKind"
| "labelKeyFor"
| "labelFor"
| "iconFor"
| "dominantFlag"
| "isAcknowledgeable"
| "audioKeyForKind"
| "precedenceForAudioKey"
| "minVolumeFor"
| "profileForType"
| "profileById"
| "profileFor"
| "capabilitiesFor"
| "commandsFor"
| "systemFlagsFor">>;Défini dans: stores/incident-profile.store.ts:24
Store des profils d'incident data-driven, chargés depuis /api/incident-profiles au démarrage.
Centralise le libellé, l'icône, la précédence sonore et la criticité par type d'incident. Ajouter un incident au JSON de configuration suffit à ce qu'il apparaisse nativement (badge, son, réglages). La couleur, elle, ne vient pas du profil : elle dérive de l'échelle de sévérité unique (@/config/severity), pilotée par le statut, afin qu'une couleur porte partout la même signification quel que soit le type de centrale.