mirror of
https://github.com/Av0idD4rk/packmate.git
synced 2026-10-25 09:49:24 +00:00
Добавил опцию регекса в паттерны, исправил вебсокеты
This commit is contained in:
parent
aca7e908c4
commit
848307db95
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="dropdown-item" :style="'color:' + color">
|
<div class="dropdown-item" :style="'color:' + color">
|
||||||
{{name}}: {{value}}
|
{{name}}: {{regex ? `/${value}/` : `'${value}'`}}
|
||||||
<div class="float-right">
|
<div class="float-right">
|
||||||
<button @click.prevent="deleteSelf()" class="btn btn-outline-danger btn-block btn-sm" type="button">x</button>
|
<button @click.prevent.stop="deleteSelf()" class="btn btn-outline-danger btn-block btn-sm" type="button">x</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -12,7 +12,7 @@ import axios from "axios";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "FlagPattern",
|
name: "FlagPattern",
|
||||||
props: ['name', 'value', 'color', 'id',],
|
props: ['name', 'value', 'color', 'id', 'regex',],
|
||||||
methods: {
|
methods: {
|
||||||
deleteSelf() {
|
deleteSelf() {
|
||||||
const instance = axios.create({
|
const instance = axios.create({
|
||||||
|
|||||||
@ -3,25 +3,35 @@
|
|||||||
|
|
||||||
<!-- <router-link to="/" class="navbar-brand col-sm-3 col-md-2 mr-0">Packmate</router-link>-->
|
<!-- <router-link to="/" class="navbar-brand col-sm-3 col-md-2 mr-0">Packmate</router-link>-->
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<button class="btn btn-dark dropdown-toggle" type="button" data-toggle="dropdown">
|
<form> <!-- Disable autohide -->
|
||||||
Паттерны
|
<button class="btn btn-dark dropdown-toggle" type="button" data-toggle="dropdown">
|
||||||
</button>
|
Паттерны
|
||||||
<div class="dropdown-menu">
|
</button>
|
||||||
<div class="input-group">
|
<div class="dropdown-menu">
|
||||||
<input type="text" class="form-control" placeholder="Name" v-model="newPattern.name">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" placeholder="Value" v-model="newPattern.value">
|
<input type="text" class="form-control" placeholder="Name" v-model="newPattern.name">
|
||||||
<input type="text" class="form-control" placeholder="#Color" v-model="newPattern.color">
|
<input type="text" class="form-control" placeholder="Value" v-model="newPattern.value">
|
||||||
<div class="input-group-append">
|
<input type="text" class="form-control" placeholder="#Color" v-model="newPattern.color">
|
||||||
<button @click.prevent="createPattern()" class="btn btn-outline-primary" type="button">+</button>
|
<div class="input-group-append">
|
||||||
|
<button @click.prevent="createPattern()" class="btn btn-outline-primary" type="button">+
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="custom-control custom-switch" style="margin-left: 10px; margin-bottom: 8px;">
|
||||||
|
<input type="checkbox" class="custom-control-input"
|
||||||
|
id="isRegexCheckbox" v-model="newPattern.regex">
|
||||||
|
<label class="custom-control-label" for="isRegexCheckbox">Regex?</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<FlagPattern v-for="pattern in patterns"
|
||||||
|
:key="pattern.id"
|
||||||
|
:id="pattern.id"
|
||||||
|
:name="pattern.name"
|
||||||
|
:value="pattern.value"
|
||||||
|
:color="pattern.color"
|
||||||
|
:regex="pattern.regex"></FlagPattern>
|
||||||
</div>
|
</div>
|
||||||
<FlagPattern v-for="pattern in patterns"
|
</form>
|
||||||
:key="pattern.id"
|
|
||||||
:id="pattern.id"
|
|
||||||
:name="pattern.name"
|
|
||||||
:value="pattern.value"
|
|
||||||
:color="pattern.color"></FlagPattern>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
@ -75,6 +85,7 @@ export default {
|
|||||||
name: '',
|
name: '',
|
||||||
value: '',
|
value: '',
|
||||||
color: '',
|
color: '',
|
||||||
|
regex: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -142,10 +153,6 @@ export default {
|
|||||||
dropdown.on('hide.bs.dropdown', function () {
|
dropdown.on('hide.bs.dropdown', function () {
|
||||||
$(this).find('.dropdown-menu').first().stop(true, true).slideUp();
|
$(this).find('.dropdown-menu').first().stop(true, true).slideUp();
|
||||||
});
|
});
|
||||||
$('.dropdown-menu').on("click.bs.dropdown", function (e) {
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
components: {FlagPattern, CtfService,},
|
components: {FlagPattern, CtfService,},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,7 +62,7 @@ export default {
|
|||||||
this.socket.onmessage = ev => {
|
this.socket.onmessage = ev => {
|
||||||
const parsed = JSON.parse(ev.data);
|
const parsed = JSON.parse(ev.data);
|
||||||
console.debug('WS got message', parsed);
|
console.debug('WS got message', parsed);
|
||||||
const currentPort = this.$route.params.servicePort;
|
const currentPort = parseInt(this.$route.params.servicePort, 10);
|
||||||
if (!(currentPort === undefined || currentPort === parsed.service.port)) {
|
if (!(currentPort === undefined || currentPort === parsed.service.port)) {
|
||||||
console.debug('not related port, skipping...');
|
console.debug('not related port, skipping...');
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user