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, {
|
||||
|
||||
Reference in New Issue
Block a user