2024-02-17 18:33:11 +00:00
|
|
|
<template>
|
2024-04-13 15:49:49 +02:00
|
|
|
<v-container class="v-container-style">
|
|
|
|
<v-card tile outlined width="500">
|
|
|
|
<v-card-title class="card__title primary centered-title">
|
|
|
|
<v-icon left class="pr-5 pl-2" size="30">mdi-send</v-icon>
|
|
|
|
Publier un message
|
|
|
|
</v-card-title>
|
|
|
|
<div class="input-style">
|
|
|
|
<v-select label="Topic" v-model="selectedTopic" :items="topics" prepend-icon="mdi-target"></v-select>
|
|
|
|
<v-text-field label="Message" v-model="message" prepend-icon="mdi-text-box"></v-text-field>
|
|
|
|
</div>
|
|
|
|
<v-btn class="v-btn-style" height="50" @click="publishMessage">Publier</v-btn>
|
|
|
|
</v-card>
|
|
|
|
</v-container>
|
|
|
|
|
2024-02-17 18:33:11 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2024-02-17 19:53:48 +00:00
|
|
|
import { publishMessage } from '@/services/mqttService'
|
2024-02-17 18:33:11 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
message: '', // Initialiser la variable message
|
|
|
|
selectedTopic: 'topic1',
|
2024-02-17 19:53:48 +00:00
|
|
|
topics: [
|
2024-04-13 15:49:49 +02:00
|
|
|
'/display/control',
|
|
|
|
'/sound/playsound',
|
2024-02-17 19:53:48 +00:00
|
|
|
'topic3',
|
|
|
|
'topic4',
|
|
|
|
'topic5',
|
|
|
|
'topic6',
|
|
|
|
'topic7',
|
|
|
|
'topic8',
|
|
|
|
'topic9',
|
|
|
|
'topic10'
|
|
|
|
] // Liste des topics
|
|
|
|
}
|
2024-02-17 18:33:11 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
publishMessage() {
|
2024-02-17 19:53:48 +00:00
|
|
|
publishMessage(this.selectedTopic, this.message)
|
2024-02-17 18:33:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
2024-04-13 15:49:49 +02:00
|
|
|
|
|
|
|
<style>
|
|
|
|
.v-container-style {
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
.input-style{
|
|
|
|
margin: 20px;
|
|
|
|
}
|
|
|
|
.v-btn-style{
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
width: 100%;
|
2024-04-13 16:45:10 +02:00
|
|
|
background-color: #d42828; /* Changez la couleur en fonction de votre thème */
|
2024-04-13 15:49:49 +02:00
|
|
|
border-top-right-radius: 0%;
|
|
|
|
border-top-left-radius: 0%;
|
|
|
|
}
|
|
|
|
.centered-title {
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
</style>
|