From 1fc8670b70857fb000647f647c31a1c9e805bdbb Mon Sep 17 00:00:00 2001 From: Blair Date: Fri, 23 Aug 2024 11:03:31 +0900 Subject: [PATCH] renaming --- promgen/static/js/promgen.vue.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/promgen/static/js/promgen.vue.js b/promgen/static/js/promgen.vue.js index 831a46ee4..71857aa8d 100644 --- a/promgen/static/js/promgen.vue.js +++ b/promgen/static/js/promgen.vue.js @@ -39,7 +39,7 @@ const silenceStore = Vue.reactive({ }, }); -const silenceTableStore = Vue.reactive({ +const silenceListStore = Vue.reactive({ state: { show: false, labels: [] @@ -109,7 +109,7 @@ const app = Vue.createApp({ this.addSilenceLabel('instance', this.selectedHosts.join('|')); }, openSilenceListModal() { - silenceTableStore.showModal(); + silenceListStore.showModal(); }, fetchSilences: function () { fetch('/proxy/v1/silences') @@ -358,7 +358,7 @@ app.component('silence-list-modal', { mixins: [mixins], data() { return { - state: silenceTableStore.state, + state: silenceListStore.state, form: { labels: [], label: '', @@ -368,9 +368,6 @@ app.component('silence-list-modal', { }; }, computed: { - globalMessages() { - return globalStore.state.messages; - }, activeSilences() { return this.$root.activeSilences || []; }, @@ -402,7 +399,7 @@ app.component('silence-list-modal', { const modal = $('#silenceListModal'); if (modal.length) { modal.on('hidden.bs.modal', () => { - silenceTableStore.hideModal(); + silenceListStore.hideModal(); }); modal.modal('show'); } @@ -412,19 +409,19 @@ app.component('silence-list-modal', { if (!this.form.labels.some(item => item.label === label && item.value === value)) { this.form.labels.push({ label, value }); } - silenceTableStore.addFilterLabel(label, value); + silenceListStore.addFilterLabel(label, value); } else if (this.form.label && this.form.value) { if (!this.form.labels.some(item => item.label === this.form.label && item.value === this.form.value)) { this.form.labels.push({ label: this.form.label, value: this.form.value }); } - silenceTableStore.addFilterLabel(this.form.label, this.form.value); + silenceListStore.addFilterLabel(this.form.label, this.form.value); this.form.label = ''; this.form.value = ''; } }, removeFilterLabel(label, value) { this.form.labels = this.form.labels.filter(item => !(item.label === label && item.value === value)); - silenceTableStore.removeFilterLabel(label, value); + silenceListStore.removeFilterLabel(label, value); }, }, watch: {