Added alert dialog context trigger to quick alert bell.

This commit is contained in:
2025-03-13 00:12:29 +01:00
parent 45ba0b8ebc
commit 04d98a61f6
4 changed files with 86 additions and 15 deletions

View File

@@ -386,19 +386,34 @@ import Checkbox from '#/components/form/checkbox.vue';
const { assets } = inject('pageContext');
const emit = defineEmits(['close']);
const props = defineProps({
presetActors: {
type: Array,
default: () => [],
},
presetEntities: {
type: Array,
default: () => [],
},
presetTags: {
type: Array,
default: () => [],
},
});
const actors = ref([]);
const emit = defineEmits(['alert', 'close']);
const actors = ref(props.presetActors);
const actorResults = ref([]);
const actorInput = ref(null);
const actorQuery = ref('');
const entities = ref([]);
const entities = ref(props.presetEntities);
const entityResults = ref([]);
const entityInput = ref(null);
const entityQuery = ref('');
const tags = ref([]);
const tags = ref(props.presetTags);
const tagResults = ref([]);
const tagInput = ref(null);
const tagQuery = ref('');
@@ -425,7 +440,7 @@ async function createAlert() {
...matches.value.map((match) => match.expression),
].filter(Boolean).join(', ');
await post('/alerts', {
const newAlert = await post('/alerts', {
all: fieldsAnd.value,
allActors: actorAnd.value,
allTags: tagAnd.value,
@@ -443,6 +458,7 @@ async function createAlert() {
appendErrorMessage: true,
});
emit('alert', newAlert);
emit('close', true);
}
@@ -475,7 +491,6 @@ async function searchTags() {
function focusActorInput() {
setTimeout(() => {
console.log(actorInput.value);
actorInput.value.focus();
}, 100);
}