Track some events
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { useForm } from '@inertiajs/vue3';
|
||||
import { trackUmamiEvent } from '@jaseeey/vue-umami-plugin';
|
||||
import { ref, watch } from 'vue';
|
||||
import {
|
||||
Form,
|
||||
@@ -148,6 +149,17 @@ watch(selectedDatasetCopy, (newvalue) => {
|
||||
const trainingId = ref<string>('');
|
||||
|
||||
function startTraining() {
|
||||
trackUmamiEvent('perceptron-training-start', {
|
||||
type: props.type,
|
||||
dataset: selectedDatasetCopy.value,
|
||||
weight_init_method: selectedMethod.value,
|
||||
hidden_layers: hiddenLayers.value,
|
||||
hidden_layers_neurons: hiddenLayersNeurons.value,
|
||||
min_error: minError.value,
|
||||
learning_rate: learningRate.value,
|
||||
max_iterations: maxIterations.value,
|
||||
});
|
||||
|
||||
if (!selectedDatasetCopy.value) {
|
||||
form.setError(
|
||||
'dataset',
|
||||
@@ -173,13 +185,6 @@ function startTraining() {
|
||||
max_iterations: maxIterations.value,
|
||||
});
|
||||
|
||||
console.debug('[max_iterations] submitting', {
|
||||
displayed: maxIterationsInput.value?.inputElement?.value,
|
||||
refValue: maxIterations.value,
|
||||
formValue: form.max_iterations,
|
||||
limit: props.maxIterationsLimit,
|
||||
});
|
||||
|
||||
form.post('/perceptron/run', {
|
||||
preserveScroll: true,
|
||||
});
|
||||
@@ -188,6 +193,10 @@ function startTraining() {
|
||||
const emit = defineEmits(['update:selectedDataset', 'update:trainingId']);
|
||||
|
||||
async function cancelTraining() {
|
||||
trackUmamiEvent('perceptron-training-cancel', {
|
||||
training_id: trainingId.value,
|
||||
});
|
||||
|
||||
form.cancel();
|
||||
|
||||
await fetch(cancel().url, {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { Head } from '@inertiajs/vue3';
|
||||
import { trackUmamiEvent } from '@jaseeey/vue-umami-plugin';
|
||||
import { BookOpenText } from '@lucide/vue';
|
||||
import { useEventListener } from '@vueuse/core';
|
||||
import {
|
||||
Chart as ChartJS,
|
||||
@@ -15,12 +17,19 @@ import {
|
||||
LineController,
|
||||
BarController,
|
||||
LogarithmicScale,
|
||||
|
||||
|
||||
} from 'chart.js';
|
||||
import { ArrowDown, ArrowUp } from 'lucide-vue-next';
|
||||
import { computed, nextTick, ref, watch } from 'vue';
|
||||
import HelpText from '@/components/HelpText.vue';
|
||||
import LinkHeader from '@/components/LinkHeader.vue';
|
||||
import Button from '@/components/ui/button/Button.vue';
|
||||
import Drawer from '@/components/ui/drawer/Drawer.vue';
|
||||
import DrawerContent from '@/components/ui/drawer/DrawerContent.vue';
|
||||
import DrawerTitle from '@/components/ui/drawer/DrawerTitle.vue';
|
||||
import DrawerTrigger from '@/components/ui/drawer/DrawerTrigger.vue';
|
||||
import Kbd from '@/components/ui/kbd/Kbd.vue';
|
||||
import KbdGroup from '@/components/ui/kbd/KbdGroup.vue';
|
||||
import ScrollArea from '@/components/ui/scroll-area/ScrollArea.vue';
|
||||
import {
|
||||
Tooltip as UiTooltip,
|
||||
@@ -34,14 +43,6 @@ import IterationTable from '../components/IterationTable.vue';
|
||||
import PerceptronDecisionGraph from '../components/PerceptronDecisionGraph.vue';
|
||||
import PerceptronIterationsErrorsGraph from '../components/PerceptronIterationsErrorsGraph.vue';
|
||||
import PerceptronSetup from '../components/PerceptronSetup.vue';
|
||||
import HelpText from '@/components/HelpText.vue';
|
||||
import { BookOpenText } from '@lucide/vue';
|
||||
import Drawer from '@/components/ui/drawer/Drawer.vue';
|
||||
import DrawerTrigger from '@/components/ui/drawer/DrawerTrigger.vue';
|
||||
import DrawerContent from '@/components/ui/drawer/DrawerContent.vue';
|
||||
import DrawerTitle from '@/components/ui/drawer/DrawerTitle.vue';
|
||||
import KbdGroup from '@/components/ui/kbd/KbdGroup.vue';
|
||||
import Kbd from '@/components/ui/kbd/Kbd.vue';
|
||||
|
||||
ChartJS.register(
|
||||
Title,
|
||||
@@ -146,6 +147,7 @@ const handleDrawerOpenChange = async (open: boolean) => {
|
||||
|
||||
if (open) {
|
||||
await restoreHelpScroll();
|
||||
trackUmamiEvent('wiki-opened', { perceptronType: props.type });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user