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