mirror of
https://github.com/Av0idD4rk/packmate.git
synced 2026-10-25 11:29:24 +00:00
Pass parameters to PatternModal
This commit is contained in:
parent
154338f128
commit
41c982b1dd
@ -55,7 +55,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</b-dropdown-item-button>
|
</b-dropdown-item-button>
|
||||||
|
|
||||||
<AddPattern/>
|
<AddPattern :creating="patternModalIsCreating" :initial-pattern="patternModalEditingPattern" />
|
||||||
</b-dropdown>
|
</b-dropdown>
|
||||||
</template>
|
</template>
|
||||||
<!--suppress JSUnresolvedReference -->
|
<!--suppress JSUnresolvedReference -->
|
||||||
@ -65,6 +65,12 @@
|
|||||||
export default {
|
export default {
|
||||||
name: 'PatternsDropdown',
|
name: 'PatternsDropdown',
|
||||||
components: {AddPattern: PatternModal, },
|
components: {AddPattern: PatternModal, },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
patternModalIsCreating: true,
|
||||||
|
patternModalEditingPattern: {},
|
||||||
|
};
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.updatePatterns();
|
this.updatePatterns();
|
||||||
},
|
},
|
||||||
@ -90,7 +96,10 @@
|
|||||||
return this.$store.state.services.find(o => o.port === port)?.name ?? '<Deleted service>'
|
return this.$store.state.services.find(o => o.port === port)?.name ?? '<Deleted service>'
|
||||||
},
|
},
|
||||||
showAddPattern() {
|
showAddPattern() {
|
||||||
|
this.patternModalIsCreating = true;
|
||||||
|
this.patternModalEditingPattern = {};
|
||||||
this.$bvModal.show('patternModal');
|
this.$bvModal.show('patternModal');
|
||||||
|
console.debug('Showing patternModal...');
|
||||||
},
|
},
|
||||||
showLookBack(pattern) {
|
showLookBack(pattern) {
|
||||||
// Не знаю, как сделать это без костылей
|
// Не знаю, как сделать это без костылей
|
||||||
|
|||||||
@ -67,7 +67,3 @@
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
@ -85,12 +85,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
const hexRegex = /[0-9A-Fa-f ]/;
|
const hexRegex = /[0-9A-Fa-f ]/;
|
||||||
export default {
|
const defaultPattern = {
|
||||||
name: 'AddPattern',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
newPattern: {
|
|
||||||
name: '',
|
name: '',
|
||||||
value: '',
|
value: '',
|
||||||
color: '#FF7474',
|
color: '#FF7474',
|
||||||
@ -98,8 +95,33 @@
|
|||||||
directionType: 'BOTH',
|
directionType: 'BOTH',
|
||||||
actionType: 'FIND',
|
actionType: 'FIND',
|
||||||
serviceId: null,
|
serviceId: null,
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'AddPattern',
|
||||||
|
props: {
|
||||||
|
creating: Boolean,
|
||||||
|
|
||||||
|
initialPattern: {
|
||||||
|
name: String,
|
||||||
|
value: String,
|
||||||
|
color: String,
|
||||||
|
searchType: String,
|
||||||
|
directionType: String,
|
||||||
|
actionType: String,
|
||||||
|
serviceId: Number,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
newPattern: {},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
initialPattern() {
|
||||||
|
console.debug('initialService changed, reassigning...', this.initialPattern);
|
||||||
|
this.newPattern = {...defaultPattern, ...this.initialPattern,};
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
serviceOptions: function () {
|
serviceOptions: function () {
|
||||||
|
|||||||
@ -142,7 +142,3 @@
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
@ -62,7 +62,3 @@
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user