Удаление паттернов, размер шрифта

This commit is contained in:
saber-nyan 2019-11-25 20:35:54 +03:00
parent 038465582e
commit 0d709a97e4
No known key found for this signature in database
GPG Key ID: 7B069E9C295E6B4A
2 changed files with 22 additions and 0 deletions

View File

@ -114,6 +114,7 @@
font-family: 'Open Sans', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size: .875rem;
}
body {

View File

@ -15,6 +15,12 @@
<template v-if="pattern.type === 'BOTH'">anywhere</template>
<template v-else-if="pattern.type === 'INPUT'">in request</template>
<template v-else>in response</template>
<div class="float-right" style="margin-left: 2em;">
<button type="button" class="btn btn-outline-danger btn-block btn-sm"
@click.stop.prevent="deletePattern(pattern.id)">
<i class="far fa-trash-alt"/>
</button>
</div>
</b-dropdown-item-button>
</b-dropdown>
</template>
@ -52,6 +58,21 @@
query: {pattern: patternId,},
});
},
deletePattern(patternId) {
console.debug('Deleting pattern w/ id', patternId);
this.$http.delete(`pattern/${patternId}`)
.then(response => {
const data = response.data;
console.debug('Done deleting pattern', data);
this.$emit('patternAddComplete');
}).catch(e => {
this.$bvToast.toast(`Не удалось удалить паттерн: ${e}`, {
title: 'Сбой',
variant: 'danger',
});
console.error('Failed to delete pattern', e);
});
},
},
};
</script>