Merge branch 'feat/mqtt-button'
This commit is contained in:
commit
ef29ef3d82
@ -7,26 +7,32 @@
|
||||
<v-container class="text-center">
|
||||
<v-row justify="center">
|
||||
<v-col cols="12" sm="6" md="5" class="mt-4">
|
||||
<v-btn width="240" height="130" class="btn card xs12 sm6 md3">
|
||||
<mqtt-button width="240" height="130" class="btn xs12 sm6 md3" topic="/display/control" message="previous">
|
||||
<v-icon left size="100">mdi-skip-previous</v-icon>
|
||||
</v-btn>
|
||||
</mqtt-button>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="6" md="5" class="mt-4">
|
||||
<v-btn width="240" height="130" class="btn card xs12 sm6 md3">
|
||||
<mqtt-button width="240" height="130" class="btn xs12 sm6 md3" topic="/display/control" message="next">
|
||||
<v-icon left size="100">mdi-skip-next</v-icon>
|
||||
</v-btn>
|
||||
</mqtt-button>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="6" md="5" class="mb-4">
|
||||
<v-btn width="240" height="130" class="btn card xs12 sm6 md3">
|
||||
<mqtt-button width="240" height="130" class="btn xs12 sm6 md3" topic="/display/control" message="pause">
|
||||
<v-icon left size="100">mdi-pause</v-icon>
|
||||
</v-btn>
|
||||
</mqtt-button>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="6" md="5" class="mb-4">
|
||||
<v-btn width="240" height="130" class="btn card xs12 sm6 md3">
|
||||
<mqtt-button width="240" height="130" class="btn xs12 sm6 md3 " topic="/display/control" message="play">
|
||||
<v-icon left size="100">mdi-play</v-icon>
|
||||
</v-btn>
|
||||
</mqtt-button>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
import MqttButton from './MqttButton.vue';
|
||||
|
||||
</script>
|
||||
|
@ -7,33 +7,37 @@
|
||||
<v-container class="text-center">
|
||||
<v-row justify="center">
|
||||
<v-col cols="12" sm="6" md="4" class="mt-4">
|
||||
<v-btn class="card" width="200" height="130" @click="" rounded>
|
||||
<mqtt-button class="btn" width="200" height="130" topic="/sound/playsound" message="good-response" rounded>
|
||||
<v-icon size="100">mdi-check-circle-outline</v-icon>
|
||||
</v-btn>
|
||||
</mqtt-button>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="6" md="4" class="mt-4">
|
||||
<v-btn class="card" width="200" height="130" @click="" rounded>
|
||||
<mqtt-button class="btn" width="200" height="130" topic="/sound/playsound" message="bad-response" rounded>
|
||||
<v-icon size="100">mdi-close-circle-outline</v-icon>
|
||||
</v-btn>
|
||||
</mqtt-button>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="6" md="4" class="mt-4">
|
||||
<v-btn class="card" width="200" height="130" @click="" rounded>
|
||||
<mqtt-button class="btn" width="200" height="130" topic="/sound/playsound" message="timer" rounded>
|
||||
<v-icon size="100">mdi-timer-outline</v-icon>
|
||||
</v-btn>
|
||||
</mqtt-button>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row justify="center">
|
||||
<v-col cols="12" sm="6" md="4" class="mb-4">
|
||||
<v-btn class="card" width="220" height="130" @click="" rounded>
|
||||
<mqtt-button class="btn" width="220" height="130" topic="/sound/playsound" message="applause" rounded>
|
||||
<v-icon size="100">mdi-human-handsup</v-icon>
|
||||
</v-btn>
|
||||
</mqtt-button>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="6" md="s" class="mb-4">
|
||||
<v-btn class="card" width="220" height="130" @click="" rounded>
|
||||
<mqtt-button class="btn" width="220" height="130" topic="/sound/playsound" message="bell" rounded>
|
||||
<v-icon size="100">mdi-bell-outline</v-icon>
|
||||
</v-btn>
|
||||
</mqtt-button>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import MqttButton from './MqttButton.vue';
|
||||
</script>
|
||||
|
22
src/components/MqttButton.vue
Normal file
22
src/components/MqttButton.vue
Normal file
@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<v-btn @click="_publishMessage" v-bind="$attrs">
|
||||
<slot/>
|
||||
</v-btn>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { publishMessage } from '@/services/mqttService'
|
||||
import { ref, defineProps } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
topic: String,
|
||||
message: null
|
||||
})
|
||||
|
||||
const disabled = ref(false)
|
||||
|
||||
const _publishMessage = () => {
|
||||
publishMessage(props.topic, JSON.stringify(props.message))
|
||||
disabled.value = true
|
||||
}
|
||||
</script>
|
@ -35,7 +35,8 @@ import CardSoundboard from '@/components/CardSoundboard.vue';
|
||||
background-color: #2E7D32; /* Changez la couleur en fonction de votre thème */
|
||||
}
|
||||
.btn{
|
||||
border-radius:50px!important;
|
||||
border-radius:30px!important;
|
||||
background-color: #2979FF; /* Changez la couleur en fonction de votre thème */
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user