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