Fix stale identifier flags: refresh composable on Settings toggle
The identifier-flags composable fetched settings once and cached them in a module singleton, so toggling an identifier in Settings (gauge/maintenance/FQDN per asset type) did not take effect on already-open asset views until a full page reload. Disabled identifiers kept showing. - identifierSettings.js: extract applySetting/fetchFlags; export reloadIdentifierFlags() and setIdentifierFlag(name, assettype, enabled) to mutate the shared reactive state. - SystemSettings.vue: push each successful matrix toggle into the shared state via setIdentifierFlag so dependent views react immediately. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -423,6 +423,7 @@
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import { settingsApi } from '../../api'
|
||||
import { setIdentifierFlag } from '../../composables/identifierSettings'
|
||||
|
||||
const settings = reactive({
|
||||
// Zabbix
|
||||
@@ -577,6 +578,9 @@ async function toggleIdentifier(name, assettype) {
|
||||
}
|
||||
}
|
||||
identifierMatrix[key] = newValue
|
||||
// Push into the shared composable so open asset views react without a
|
||||
// full page reload (the composable otherwise fetches only once).
|
||||
setIdentifierFlag(name, assettype, newValue)
|
||||
success.value = 'Setting saved'
|
||||
setTimeout(() => { success.value = '' }, 2000)
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user