Skip to content

Commit

Permalink
webapp/Training: mv Buttons to Steps
Browse files Browse the repository at this point in the history
  • Loading branch information
tharvik committed Jan 6, 2025
1 parent d8118f5 commit 4071c88
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 26 deletions.
2 changes: 0 additions & 2 deletions webapp/src/components/progress_bars/TrainingBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
</ProgressIcon>
</div>
</div>
<TrainingButtons />
</div>
</template>

Expand All @@ -124,7 +123,6 @@ import TasksIcon from '@/assets/svg/TasksIcon.vue'
import PerformanceIcon from '@/assets/svg/PerformanceIcon.vue'
import DISCOllaboratives from '@/components/simple/DISCOllaboratives.vue'
import TrainingButtons from './TrainingButtons.vue'
const router = useRouter()
const route = useRoute()
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/progress_bars/TrainingButtons.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div v-show="route.fullPath !== '/list'" class="flex flex-row justify-center">
<div class="flex flex-row justify-center">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-8">
<CustomButton
v-show="trainingStore.step !== undefined && trainingStore.step >= 1"
Expand Down
70 changes: 47 additions & 23 deletions webapp/src/components/training/TrainingSteps.vue
Original file line number Diff line number Diff line change
@@ -1,30 +1,54 @@
<template>
<div v-if="task !== undefined">
<Description v-show="trainingStore.step === 1" :task="task" />

<div
v-show="trainingStore.step === 2"
class="flex flex-col space-y-4 md:space-y-8"
>
<LabeledDatasetInput :task v-model="dataset">
<template #header>
<DataDescription :task />
</template>
</LabeledDatasetInput>
</div>

<Trainer
v-show="trainingStore.step === 3"
:task
:dataset="unamedDataset"
@model="(m) => (trainedModel = m)"
/>

<Finished v-show="trainingStore.step === 4" :task :model="trainedModel" />
<div class="separated">
<!-- TrainingBar -->

<TrainingButtons />

<template v-if="task !== undefined">
<div v-show="trainingStore.step === 1">
<Description :task />
</div>

<div v-show="trainingStore.step === 2" class="separated">
<LabeledDatasetInput :task v-model="dataset">
<template #header>
<DataDescription :task />
</template>
</LabeledDatasetInput>
</div>

<div v-show="trainingStore.step === 3">
<Trainer
:task
:dataset="unamedDataset"
@model="(m) => (trainedModel = m)"
/>
</div>

<div v-show="trainingStore.step === 4">
<Finished :task :model="trainedModel" />
</div>

<TrainingButtons />
</template>
</div>
<TrainingButtons />
</template>

<style lang="css" scoped>
.separated {
display: flex;
flex-direction: column;
gap: 1rem;
}
/* tailwind "md" size */
@media (min-width: 768px) {
.separated {
gap: 2rem;
}
}
</style>

<script lang="ts" setup>
import { computed, onMounted, ref, toRaw, watch } from "vue";
import { useRouter, useRoute } from "vue-router";
Expand Down

0 comments on commit 4071c88

Please sign in to comment.