|
1 | 1 | <template> |
2 | 2 | <v-snackbar |
3 | | - v-for="(error, index) in errors" |
4 | | - :key="index" |
5 | | - v-model="show" |
| 3 | + v-for="(feedback, index) in feedback_store.feedbacks" |
| 4 | + :key="feedback" |
6 | 5 | :style="{ 'margin-bottom': calc_margin(index) }" |
7 | | - color="error" |
| 6 | + :color="feedback.type" |
8 | 7 | location="bottom right" |
9 | 8 | transition="slide-x-reverse-transition" |
10 | | - max-width="30%" |
| 9 | + width="200px" |
11 | 10 | height="20px" |
| 11 | + z-index="99999" |
12 | 12 | > |
13 | 13 | <v-row dense class="flex-nowrap"> |
14 | 14 | <v-col cols="auto"> |
15 | | - <v-tooltip location="left"> |
| 15 | + <v-tooltip v-if="feedback.type === 'error'" location="left"> |
16 | 16 | <span> |
17 | | - error: {{ error.code }} {{ error.name }}<br /> |
18 | | - ressource: {{ error.route }} |
| 17 | + error: {{ feedback.code }} {{ feedback.name }}<br /> |
| 18 | + ressource: {{ feedback.route }} |
19 | 19 | <br /> |
20 | 20 | </span> |
21 | 21 | <template #activator="{ props }"> |
|
24 | 24 | </v-icon> |
25 | 25 | </template> |
26 | 26 | </v-tooltip> |
| 27 | + <v-tooltip v-else-if="feedback.type === 'success'" location="left"> |
| 28 | + <v-icon color="white" class="justify-right"> |
| 29 | + mdi-check-circle-outline |
| 30 | + </v-icon> |
| 31 | + </v-tooltip> |
27 | 32 | </v-col> |
28 | 33 | <v-col cols="9" class="text-no-wrap overflow-hidden"> |
29 | 34 | <v-tooltip location="top"> |
30 | 35 | <span> |
31 | | - {{ error.description }} |
| 36 | + {{ feedback.description }} |
32 | 37 | <br /> |
33 | 38 | </span> |
34 | 39 | <template #activator="{ props }"> |
35 | 40 | <div v-bind="props"> |
36 | | - {{ error.description }} |
| 41 | + {{ feedback.description }} |
37 | 42 | </div> |
38 | 43 | </template> |
39 | 44 | </v-tooltip> |
|
44 | 49 | icon |
45 | 50 | variant="flat" |
46 | 51 | size="20" |
47 | | - color="error" |
48 | | - @click="errors_store.delete_error(index)" |
| 52 | + :color="feedback.type" |
| 53 | + @click="feedback_store.delete_feedback(index)" |
49 | 54 | > |
50 | 55 | <v-icon icon="mdi-close" size="20" color="white" /> |
51 | 56 | </v-btn> |
|
55 | 60 | </template> |
56 | 61 |
|
57 | 62 | <script setup> |
58 | | - const errors_store = use_errors_store() |
59 | | - const { errors } = storeToRefs(errors_store) |
60 | | -
|
61 | | - const show = true |
| 63 | + const feedback_store = use_feedback_store() |
62 | 64 |
|
63 | 65 | function calc_margin(index) { |
64 | 66 | return index * 60 + 8 + "px" |
|
0 commit comments