Compare commits
6 Commits
fetch-test
...
56bf47b91a
Author | SHA1 | Date | |
---|---|---|---|
56bf47b91a | |||
745532c1b8 | |||
7e0687d3ca | |||
8a3185d694 | |||
340fbd3812 | |||
4c42f15dc6 |
@ -1 +0,0 @@
|
|||||||
test
|
|
@ -1,40 +0,0 @@
|
|||||||
/**
|
|
||||||
* plugins/vuetify.js
|
|
||||||
*
|
|
||||||
* Framework documentation: https://vuetifyjs.com`
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Styles
|
|
||||||
import '@mdi/font/css/materialdesignicons.css'
|
|
||||||
import 'vuetify/styles'
|
|
||||||
|
|
||||||
// Composables
|
|
||||||
import { createVuetify } from 'vuetify'
|
|
||||||
|
|
||||||
// https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides
|
|
||||||
export default createVuetify({
|
|
||||||
theme: {
|
|
||||||
themes: {
|
|
||||||
light: {
|
|
||||||
background: '#212121',
|
|
||||||
primary: '#cc0000',
|
|
||||||
controls: '#cc0000',
|
|
||||||
soundboard: '#9A2779',
|
|
||||||
secondary: '#b0bec5',
|
|
||||||
feedback: '#2E7D32',
|
|
||||||
accent: '#8c9eff',
|
|
||||||
error: '#b71c1c',
|
|
||||||
},
|
|
||||||
dark: {
|
|
||||||
background: '#121212',
|
|
||||||
primary: '#2979FF',
|
|
||||||
controls: '#AB47B',
|
|
||||||
secondary: '#90a4ae',
|
|
||||||
feedback: '#2E7D32',
|
|
||||||
accent: '#8c9eff',
|
|
||||||
error: '#b71c1c',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
defaultTheme: 'dark',
|
|
||||||
}
|
|
||||||
})
|
|
8
package-lock.json → ui/package-lock.json
generated
@ -22,7 +22,7 @@
|
|||||||
"eslint-plugin-vue": "^9.17.0",
|
"eslint-plugin-vue": "^9.17.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.0.3",
|
||||||
"unplugin-fonts": "^1.1.1",
|
"unplugin-fonts": "^1.1.1",
|
||||||
"vite": "^5.1.4",
|
"vite": "^5.1.6",
|
||||||
"vite-plugin-vuetify": "^2.0.1"
|
"vite-plugin-vuetify": "^2.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2814,9 +2814,9 @@
|
|||||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
|
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
|
||||||
},
|
},
|
||||||
"node_modules/vite": {
|
"node_modules/vite": {
|
||||||
"version": "5.1.4",
|
"version": "5.1.6",
|
||||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/vite/-/vite-5.1.6.tgz",
|
||||||
"integrity": "sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==",
|
"integrity": "sha512-yYIAZs9nVfRJ/AiOLCA91zzhjsHUgMjB+EigzFb6W2XTLO8JixBCKCjvhKZaye+NKYHCrkv3Oh50dH9EdLU2RA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esbuild": "^0.19.3",
|
"esbuild": "^0.19.3",
|
@ -25,7 +25,7 @@
|
|||||||
"eslint-plugin-vue": "^9.17.0",
|
"eslint-plugin-vue": "^9.17.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.0.3",
|
||||||
"unplugin-fonts": "^1.1.1",
|
"unplugin-fonts": "^1.1.1",
|
||||||
"vite": "^5.1.4",
|
"vite": "^5.1.6",
|
||||||
"vite-plugin-vuetify": "^2.0.1"
|
"vite-plugin-vuetify": "^2.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 768 KiB After Width: | Height: | Size: 768 KiB |
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 276 B |
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
function toggleTheme() {
|
function toggleTheme() {
|
||||||
darkTheme.value = !darkTheme.value
|
darkTheme.value = !darkTheme.value
|
||||||
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark'
|
theme.global.name.value = theme.global.current.value.dark ? 'CustomThemeLight' : 'CustomThemeDark'
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
8
ui/src/config.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
// Fichier vide, regarde config.js.example pour personaliser ce fichier.
|
||||||
|
// Note de dev : Normalement ce fichier ne devrait plus avoir de
|
||||||
|
// modifications
|
||||||
|
|
||||||
|
// config.js
|
||||||
|
export default {
|
||||||
|
mqttBrokerUrl: 'ws://localhost:9001'
|
||||||
|
};
|
@ -31,6 +31,11 @@ const router = createRouter({
|
|||||||
path: '/mqtt-debugger',
|
path: '/mqtt-debugger',
|
||||||
name: 'Debugger MQTT',
|
name: 'Debugger MQTT',
|
||||||
component: () => import('@/views/MQTTDebugView.vue')
|
component: () => import('@/views/MQTTDebugView.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/settings',
|
||||||
|
name: 'Paramètres',
|
||||||
|
component: () => import('@/views/SettingsView.vue')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
50
ui/src/plugins/vuetify.js
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
/**
|
||||||
|
* plugins/vuetify.js
|
||||||
|
*
|
||||||
|
* Framework documentation: https://vuetifyjs.com`
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Styles
|
||||||
|
import '@mdi/font/css/materialdesignicons.css'
|
||||||
|
import 'vuetify/styles'
|
||||||
|
|
||||||
|
// Composables
|
||||||
|
import { createVuetify } from 'vuetify'
|
||||||
|
|
||||||
|
const CustomThemeDark = {
|
||||||
|
dark: true,
|
||||||
|
colors: {
|
||||||
|
background: '#121212',
|
||||||
|
primary: '#e91e1e',
|
||||||
|
secondary: '#F44336',
|
||||||
|
accent: '#FFC107',
|
||||||
|
error: '#FF5722',
|
||||||
|
warning: '#FFC107',
|
||||||
|
info: '#607D8B',
|
||||||
|
success: '#4CAF50'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const CustomThemeLight = {
|
||||||
|
dark: false,
|
||||||
|
colors: {
|
||||||
|
background: '#ffffff',
|
||||||
|
primary: '#e91e1e',
|
||||||
|
secondary: '#F44336',
|
||||||
|
accent: '#FFC107',
|
||||||
|
error: '#FF5722',
|
||||||
|
warning: '#FFC107',
|
||||||
|
info: '#607D8B',
|
||||||
|
success: '#4CAF50'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides
|
||||||
|
export default createVuetify({
|
||||||
|
theme: {
|
||||||
|
defaultTheme: 'CustomThemeDark',
|
||||||
|
themes: {
|
||||||
|
CustomThemeDark,
|
||||||
|
CustomThemeLight,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
51
ui/src/views/SettingsView.vue
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<h1 class="title mb-4 ml-5 mt-5">Paramètres</h1>
|
||||||
|
<hr/>
|
||||||
|
<h2 class="title ml-10 mb-5 mt-5">Son</h2>
|
||||||
|
<div style="display: flex; align-items: center;">
|
||||||
|
<v-switch label="Activer le son intégré" v-model="EmbeddedSound" class="ml-10" color="primary"/>
|
||||||
|
<div style="width: 250px; margin-left: 16px;">
|
||||||
|
<v-slider class="ml-15" :disabled="EmbeddedSound === false" v-model="EmbeddedSoundVolume" color="primary"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<v-switch label="Activer le son MQTT" v-model="MQTTSound" class="ml-10" color="primary"/>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, onMounted, watch } from 'vue';
|
||||||
|
|
||||||
|
const EmbeddedSound = ref(false); // Définition d'une référence pour la case à cocher. Initialement décochée.
|
||||||
|
const EmbeddedSoundVolume = ref(50); // Définition d'une référence pour la case à cocher. Initialement décochée.
|
||||||
|
const MQTTSound = ref(false); // Définition d'une référence pour la case à cocher. Initialement décochée.
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (localStorage.getItem('EmbeddedSound')) {
|
||||||
|
EmbeddedSound.value = localStorage.getItem('EmbeddedSound') === 'true'; // Si l'état de la case à cocher est stocké, le mettre dans la référence
|
||||||
|
}
|
||||||
|
if (localStorage.getItem('MQTTSound')) {
|
||||||
|
MQTTSound.value = localStorage.getItem('MQTTSound') === 'true'; // Si l'état de la case à cocher est stocké, le mettre dans la référence
|
||||||
|
}
|
||||||
|
if (localStorage.getItem('EmbeddedSoundVolume')) {
|
||||||
|
EmbeddedSoundVolume.value = localStorage.getItem('EmbeddedSoundVolume'); // Si l'état de la case à cocher est stocké, le mettre dans la référence
|
||||||
|
}
|
||||||
|
});
|
||||||
|
watch(EmbeddedSound, (EmbeddedSoundNewValue) => {
|
||||||
|
if (EmbeddedSoundNewValue !== null) {
|
||||||
|
localStorage.setItem('EmbeddedSound', EmbeddedSoundNewValue); // Mettre à jour l'état de la case à cocher dans le LocalStorage chaque fois qu'il change.
|
||||||
|
}
|
||||||
|
});
|
||||||
|
watch(EmbeddedSoundVolume, (EmbeddedSoundVolumeNewValue) => {
|
||||||
|
if (EmbeddedSoundVolumeNewValue !== null) {
|
||||||
|
localStorage.setItem('EmbeddedSoundVolume', EmbeddedSoundVolumeNewValue); // Mettre à jour l'état de la case à cocher dans le LocalStorage chaque fois qu'il change.
|
||||||
|
}
|
||||||
|
});
|
||||||
|
watch(MQTTSound, (MQTTSoundNewValue) => {
|
||||||
|
|
||||||
|
if (MQTTSoundNewValue !== null) {
|
||||||
|
localStorage.setItem('MQTTSound', MQTTSoundNewValue); // Mettre à jour l'état de la case à cocher dans le LocalStorage chaque fois qu'il change.
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|