mirror of
https://github.com/Av0idD4rk/packmate.git
synced 2026-10-23 16:31:01 +00:00
Паттерны на игнорирование стримов
This commit is contained in:
parent
fb3637a8b2
commit
a8e75766a1
6
package-lock.json
generated
6
package-lock.json
generated
@ -3117,9 +3117,9 @@
|
||||
}
|
||||
},
|
||||
"caniuse-lite": {
|
||||
"version": "1.0.30001039",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001039.tgz",
|
||||
"integrity": "sha512-SezbWCTT34eyFoWHgx8UWso7YtvtM7oosmFoXbCkdC6qJzRfBTeTgE9REtKtiuKXuMwWTZEvdnFNGAyVMorv8Q==",
|
||||
"version": "1.0.30001171",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001171.tgz",
|
||||
"integrity": "sha512-5Alrh8TTYPG9IH4UkRqEBZoEToWRLvPbSQokvzSz0lii8/FOWKG4keO1HoYfPWs8IF/NH/dyNPg1cmJGvV3Zlg==",
|
||||
"dev": true
|
||||
},
|
||||
"case-sensitive-paths-webpack-plugin": {
|
||||
|
||||
@ -7,15 +7,25 @@
|
||||
</button>
|
||||
</li>
|
||||
<b-dropdown-divider/>
|
||||
<b-dropdown-item-button @click.stop.prevent="resetPatternSelection">
|
||||
<strong>All streams</strong>
|
||||
</b-dropdown-item-button>
|
||||
<b-dropdown-item-button v-for="pattern in this.$store.state.patterns"
|
||||
:key="pattern.id" @click.stop.prevent="openPattern(pattern.id)">
|
||||
<strong v-if="pattern.enabled" :style="`color: ${pattern.color};`">{{ pattern.name }}</strong>
|
||||
:key="pattern.id" @click.stop.prevent="openPattern(pattern)"
|
||||
:class="{ 'ignore-pattern' : pattern.actionType === 'IGNORE' }">
|
||||
|
||||
<strong v-if="pattern.enabled" :style="getPatternColor">{{ pattern.name }}</strong>
|
||||
<s v-else :style="`color: ${pattern.color};`">{{ pattern.name }}</s>:
|
||||
|
||||
<code>{{ getSearchTypeValue(pattern.searchType, pattern.value) }}</code>;
|
||||
search
|
||||
|
||||
<template v-if="pattern.actionType === 'FIND'">search </template>
|
||||
<template v-else>ignore </template>
|
||||
|
||||
<template v-if="pattern.directionType === 'BOTH'">anywhere</template>
|
||||
<template v-else-if="pattern.directionType === 'INPUT'">in request</template>
|
||||
<template v-else>in response</template>
|
||||
|
||||
<div class="float-right" style="margin-left: 2em;">
|
||||
<button v-if="pattern.enabled" type="button" class="btn btn-outline-danger btn-block btn-sm"
|
||||
@click.stop.prevent="togglePattern(pattern)">
|
||||
@ -33,9 +43,7 @@
|
||||
export default {
|
||||
name: 'PatternsDropdown',
|
||||
data() {
|
||||
return {
|
||||
// patterns: Array(),
|
||||
};
|
||||
return {};
|
||||
},
|
||||
mounted() {
|
||||
this.updatePatterns();
|
||||
@ -46,6 +54,13 @@
|
||||
else if (searchType === 'SUBSTRING') return `'${value}'`;
|
||||
else return `0x${value}`;
|
||||
},
|
||||
getPatternColor(pattern) {
|
||||
if (pattern.actionType === 'FIND') {
|
||||
return `color: ${pattern.color};`;
|
||||
} else {
|
||||
return `color: inherit;`;
|
||||
}
|
||||
},
|
||||
showAddService() {
|
||||
this.$bvModal.show('addPatternModal');
|
||||
},
|
||||
@ -60,13 +75,24 @@
|
||||
console.error('Failed to load patterns:', e);
|
||||
});
|
||||
},
|
||||
openPattern(patternId) {
|
||||
console.debug('Opening pattern w/ id', patternId);
|
||||
openPattern(pattern) {
|
||||
if (pattern.actionType === 'IGNORE') {
|
||||
return;
|
||||
}
|
||||
|
||||
console.debug('Opening pattern w/ id', pattern.id);
|
||||
this.$router.push({
|
||||
name: 'stream',
|
||||
params: this.$route.params,
|
||||
query: {pattern: patternId,},
|
||||
});
|
||||
query: {pattern: pattern.id,},
|
||||
}, () => {});
|
||||
},
|
||||
resetPatternSelection() {
|
||||
console.debug('Resetting pattern selection');
|
||||
this.$router.push({
|
||||
name: 'stream',
|
||||
params: this.$route.params,
|
||||
}, () => {});
|
||||
},
|
||||
togglePattern(pattern) {
|
||||
const enabled = !pattern.enabled;
|
||||
@ -113,3 +139,8 @@
|
||||
font-size: 100%;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.ignore-pattern button {
|
||||
cursor: default !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -22,7 +22,18 @@
|
||||
id="pattern-value" required v-model="newPattern.value"
|
||||
:placeholder="getPlaceholder()"/>
|
||||
</b-form-group>
|
||||
<b-form-group
|
||||
<b-form-group
|
||||
label-cols-sm="4"
|
||||
label-cols-lg="3"
|
||||
label="Search action"
|
||||
description="What to do with matching streams"
|
||||
label-for="pattern-actionType">
|
||||
<b-form-select id="pattern-actionType" required v-model="newPattern.actionType">
|
||||
<option value="FIND" selected>Highlight found pattern</option>
|
||||
<option value="IGNORE">Ignore matching streams</option>
|
||||
</b-form-select>
|
||||
</b-form-group>
|
||||
<b-form-group v-if="newPattern.actionType === 'FIND'"
|
||||
label-cols-sm="4"
|
||||
label-cols-lg="3"
|
||||
label="Color"
|
||||
@ -46,7 +57,7 @@
|
||||
label-cols-sm="4"
|
||||
label-cols-lg="3"
|
||||
label="Search type"
|
||||
description="in which packets to search for a pattern"
|
||||
description="In which packets to search for a pattern"
|
||||
label-for="pattern-type">
|
||||
<b-form-select id="pattern-type" required v-model="newPattern.directionType">
|
||||
<option value="INPUT">Request</option>
|
||||
@ -70,6 +81,7 @@
|
||||
color: '#FF7474',
|
||||
searchType: 'SUBSTRING',
|
||||
directionType: 'BOTH',
|
||||
actionType: 'FIND',
|
||||
},
|
||||
};
|
||||
},
|
||||
@ -98,6 +110,7 @@
|
||||
color: '#FF7474',
|
||||
searchType: 'SUBSTRING',
|
||||
directionType: 'BOTH',
|
||||
actionType: 'FIND',
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user