Fix analytics service and audio recorder

This commit is contained in:
N-Pex 2025-05-09 16:01:10 +02:00
parent 2e46a0b663
commit d4041ab9ab
6 changed files with 90 additions and 1356 deletions

View file

@ -17,8 +17,14 @@
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ { .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
opacity: 0; opacity: 0;
} }
.voice-recorder {
.v-btn {
background-color: black;
color: white;
}
.voice-recorder-btn { .voice-recorder-btn {
padding: 30px;
background-color: $voice-recorder-color; background-color: $voice-recorder-color;
&.recording { &.recording {
@ -28,3 +34,4 @@
background-color: $voice-recorded-color; background-color: $voice-recorded-color;
} }
} }
}

View file

@ -9,10 +9,10 @@
<v-row align="center" class="mt-3"> <v-row align="center" class="mt-3">
<v-col cols="4" align="center"> <v-col cols="4" align="center">
<v-btn v-show="state == states.RECORDED" icon @click.stop="redo"> <v-btn v-show="state == states.RECORDED" icon @click.stop="redo">
<v-icon color="white">undo</v-icon> <v-icon>undo</v-icon>
</v-btn> </v-btn>
<v-btn v-show="state == states.INITIAL" icon @click.stop="importAudio"> <v-btn v-show="state == states.INITIAL" icon @click.stop="importAudio">
<v-icon color="white">$vuetify.icons.audio_import</v-icon> <v-icon>$vuetify.icons.audio_import</v-icon>
<input <input
ref="audio_import" ref="audio_import"
type="file" type="file"
@ -23,10 +23,10 @@
/> />
</v-btn> </v-btn>
<v-btn v-show="state == states.IMPORTED" icon @click.stop="previewAudio"> <v-btn v-show="state == states.IMPORTED" icon @click.stop="previewAudio">
<v-icon color="white">$vuetify.icons.audio_import_play</v-icon> <v-icon>$vuetify.icons.audio_import_play</v-icon>
</v-btn> </v-btn>
<v-btn v-show="state == states.PLAYING" icon @click.stop="pauseAudio"> <v-btn v-show="state == states.PLAYING" icon @click.stop="pauseAudio">
<v-icon color="white">pause</v-icon> <v-icon>pause</v-icon>
</v-btn> </v-btn>
</v-col> </v-col>
<v-col cols="4" align="center"> <v-col cols="4" align="center">
@ -36,6 +36,7 @@
icon icon
class="voice-recorder-btn recording" class="voice-recorder-btn recording"
@click.stop="pauseRecording" @click.stop="pauseRecording"
size="60"
> >
<v-icon color="white">stop</v-icon> <v-icon color="white">stop</v-icon>
</v-btn> </v-btn>
@ -46,6 +47,7 @@
icon icon
:disabled="!recordedFile" :disabled="!recordedFile"
@click.stop="send" @click.stop="send"
size="60"
> >
<v-icon color="black">arrow_upward</v-icon> <v-icon color="black">arrow_upward</v-icon>
</v-btn> </v-btn>
@ -55,13 +57,14 @@
class="voice-recorder-btn" class="voice-recorder-btn"
icon icon
@click.stop="startRecording" @click.stop="startRecording"
size="60"
> >
<v-icon color="white">fiber_manual_record</v-icon> <v-icon>fiber_manual_record</v-icon>
</v-btn> </v-btn>
</v-col> </v-col>
<v-col cols="4" align="center"> <v-col cols="4" align="center">
<v-btn id="btn-record-cancel" icon @click.stop="cancelRecording"> <v-btn id="btn-record-cancel" icon @click.stop="cancelRecording">
<v-icon color="white">close</v-icon> <v-icon>close</v-icon>
</v-btn> </v-btn>
</v-col> </v-col>
</v-row> </v-row>

View file

@ -31,6 +31,7 @@ export default {
//autofocus: true, //autofocus: true,
variant: "solo", variant: "solo",
required: true, required: true,
class: "text-left"
}; };
}, },
roomNameInputListeners() { roomNameInputListeners() {

View file

@ -61,6 +61,13 @@ export default {
customProperties: true, customProperties: true,
}, },
dark: false, dark: false,
themes: {
light: {
colors: {
error: "#ff5252",
}
},
},
}, },
}; };
const vuetify = createVuetify(options); const vuetify = createVuetify(options);

View file

@ -1,18 +1,15 @@
import cleaninsights from './cleaninsights.service' import cleaninsights from "./cleaninsights.service";
import matomo from './matomo.service' import matomo from "./matomo.service";
export default { export default {
install(app) { install(app) {
const analyticsService = ({ class AnalyticsServiceClass {
data() { constructor() {
return { this.engines = [];
engines: [], this.cachedEvents = [];
cachedEvents: [], this.initialized = false;
initialized: false
} app.$config.promise.then((config) => {
},
created() {
this.$config.promise.then((config) => {
var analytics = config.analytics || {}; var analytics = config.analytics || {};
if (!Array.isArray(analytics)) { if (!Array.isArray(analytics)) {
analytics = [analytics]; analytics = [analytics];
@ -42,15 +39,15 @@ export default {
// Handle cached events // Handle cached events
this.cachedEvents.forEach(([category, action]) => { this.cachedEvents.forEach(([category, action]) => {
this.event(category, action); this.event(category, action);
}) });
this.cachedEvents = []; this.cachedEvents = [];
}); });
}, }
methods: {
event(category, action) { event(category, action) {
if (!this.initialized) { if (!this.initialized) {
this.cachedEvents.push([category, action]); this.cachedEvents.push([category, action]);
return return;
} }
// Send the event to each configured analytics engine. // Send the event to each configured analytics engine.
@ -59,9 +56,9 @@ export default {
}); });
} }
} }
});
const analyticsService = new AnalyticsServiceClass();
app.$analytics = analyticsService; app.$analytics = analyticsService;
app.config.globalProperties.$analytics = analyticsService; app.config.globalProperties.$analytics = analyticsService;
} },
} };

File diff suppressed because it is too large Load diff