diff --git a/src/components/sidebar/NavigationRoutes.ts b/src/components/sidebar/NavigationRoutes.ts index f5c536d..c18d28a 100644 --- a/src/components/sidebar/NavigationRoutes.ts +++ b/src/components/sidebar/NavigationRoutes.ts @@ -18,100 +18,28 @@ export default { icon: "vuestic-iconset-dashboard", }, }, - // { - // name: 'users', - // displayName: 'menu.users', - // meta: { - // icon: 'group', - // }, - // }, - { - name: 'workouts', - displayName: 'menu.workouts', - meta: { - icon: 'folder_shared', - }, - children: [ - { - name: 'list_workouts', - displayName: 'menu.list_workouts', - }, - { - name: 'upload_workouts', - displayName: 'menu.upload_workouts', - } - ], - }, - // { - // name: 'payments', - // displayName: 'menu.payments', - // meta: { - // icon: 'credit_card', - // }, - // children: [ - // { - // name: 'payment-methods', - // displayName: 'menu.payment-methods', - // }, - // { - // name: 'pricing-plans', - // displayName: 'menu.pricing-plans', - // }, - // { - // name: 'billing', - // displayName: 'menu.billing', - // }, - // ], - // }, - // { - // name: 'auth', - // displayName: 'menu.auth', - // meta: { - // icon: 'login', - // }, - // children: [ - // { - // name: 'login', - // displayName: 'menu.login', - // }, - // { - // name: 'signup', - // displayName: 'menu.signup', - // }, - // { - // name: 'recover-password', - // displayName: 'menu.recover-password', - // }, - // ], - // }, - - // { - // name: 'faq', - // displayName: 'menu.faq', - // meta: { - // icon: 'quiz', - // }, - // }, - // { - // name: '404', - // displayName: 'menu.404', - // meta: { - // icon: 'vuestic-iconset-files', - // }, - // }, - // { - // name: 'preferences', - // displayName: 'menu.preferences', - // meta: { - // icon: 'manage_accounts', - // }, - // }, - // { - // name: 'settings', - // displayName: 'menu.settings', - // meta: { - // icon: 'settings', - // }, - // }, + { + name: 'workouts', + displayName: 'menu.workouts', + meta: { + icon: 'folder_shared', + }, + children: [ + { + name: 'list_workouts', + displayName: 'menu.list_workouts', + children: [ + { + name: 'workout_item', + displayName: 'Тренировка', + }, + ] + }, + { + name: 'upload_workouts', + displayName: 'menu.upload_workouts', + } + ], + }, ] as INavigationRoute[], }; diff --git a/src/pages/workouts/WorkoutItem.vue b/src/pages/workouts/WorkoutItem.vue new file mode 100644 index 0000000..142480a --- /dev/null +++ b/src/pages/workouts/WorkoutItem.vue @@ -0,0 +1,46 @@ + + + + + + \ No newline at end of file diff --git a/src/pages/workouts/WorkoutList.vue b/src/pages/workouts/WorkoutList.vue index 4c71196..5a9b010 100644 --- a/src/pages/workouts/WorkoutList.vue +++ b/src/pages/workouts/WorkoutList.vue @@ -8,7 +8,7 @@ @@ -30,6 +33,33 @@ import { AxiosResponse, AxiosInstance } from "axios"; import { ref, inject } from 'vue'; import { useToast } from "vuestic-ui/web-components"; +import { useRouter } from "vue-router"; + + +type Attachment = { + url: string; +} +type WorkoutItem = { + id: string; + name: string; + created_by: string; + created_at: string; + updated_at: string; + description: string; + cadence: number; + heart_rate: number; + temperature: number; + speed: number; + power: number; + duraion_sec: number; + distantion: number; + attachment: Attachment; +}; + +const { push } = useRouter(); +const axiosAuth= inject('axiosAuth') as AxiosInstance; +let workoutItems = ref>([]); +const { init } = useToast(); const deleteItem = (id: string) => { axiosAuth @@ -64,29 +94,10 @@ const speedConvert = (speed: number) => { return Math.round(speed*3.6) } -type Attachment = { - url: string; -} -type WorkoutItem = { - id: string; - name: string; - created_by: string; - created_at: string; - updated_at: string; - description: string; - cadence: number; - heart_rate: number; - temperature: number; - speed: number; - power: number; - duraion_sec: number; - distantion: number; - attachment: Attachment; -}; -const axiosAuth= inject('axiosAuth') as AxiosInstance; -let workoutItems = ref>([]); -const { init } = useToast(); +const openWorkout = (id: string) => { + push({ name: "workout_item", params: {id: id}}).catch((error) => {}); +}; const initWorkouts = () => { axiosAuth @@ -101,12 +112,14 @@ const initWorkouts = () => { color: "error", }); }); -} +}; + initWorkouts();