fix some bgus
Gitea Actions Demo / build_and_push (push) Successful in 1m9s
Details
Gitea Actions Demo / build_and_push (push) Successful in 1m9s
Details
This commit is contained in:
parent
b1a3e481f9
commit
0e91273725
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="profile-dropdown-wrapper">
|
||||
<div class="profile-dropdown-wrapper" v-if="isAuth">
|
||||
<VaDropdown
|
||||
v-model="isShown"
|
||||
:offset="[9, 0]"
|
||||
|
|
@ -44,6 +44,9 @@
|
|||
</VaDropdownContent>
|
||||
</VaDropdown>
|
||||
</div>
|
||||
<div class="profile-dropdown-link" v-else>
|
||||
<RouterLink to="/auth">Войти</RouterLink>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
|
@ -57,7 +60,7 @@ const store = useUserStore();
|
|||
const hoverColor = computed(() => setHSLAColor(colors.focus, { a: 0.1 }));
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const isAuth = true ? localStorage.getItem('token') : false;
|
||||
type ProfileListItem = {
|
||||
name: string;
|
||||
to?: string;
|
||||
|
|
@ -136,6 +139,15 @@ const resolveLinkAttribute = (item: ProfileListItem) => {
|
|||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.profile-dropdown-link {
|
||||
a {
|
||||
padding: 0 5px 0 0;
|
||||
color: var(--va-primary);
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
.profile-dropdown {
|
||||
cursor: pointer;
|
||||
|
||||
|
|
|
|||
|
|
@ -103,4 +103,13 @@ if (import.meta.env.VITE_APP_GTM_ENABLED) {
|
|||
);
|
||||
}
|
||||
|
||||
if (localStorage.getItem('token')) {
|
||||
axiosAuth.get("/api/v0/auth/check")
|
||||
.then((response: AxiosResponse) => {
|
||||
console.debug("authAuthenticated")
|
||||
}).catch((error: any) => {
|
||||
localStorage.clear();
|
||||
});
|
||||
}
|
||||
|
||||
app.mount("#app");
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
latitude: number;
|
||||
longitude: number;
|
||||
is_public: boolean;
|
||||
workouted_at: string;
|
||||
external_links?: WorkoutLink;
|
||||
}
|
||||
export const secondsToDuration = (seconds: number) => {
|
||||
|
|
@ -40,6 +41,21 @@
|
|||
return `${hours} ч. ${minutes} мин.`;
|
||||
}
|
||||
|
||||
export const formatTime = (isoString: string): string => {
|
||||
const date = new Date(isoString);
|
||||
if (Number.isNaN(date.valueOf())) {
|
||||
throw new Error('Invalid date string');
|
||||
}
|
||||
const day = date.getDate();
|
||||
const month = date.getMonth() + 1; // Months are 0-based
|
||||
const year = date.getFullYear();
|
||||
return `${pad(day)}.${pad(month)}.${year}`;
|
||||
}
|
||||
|
||||
const pad = (n: number): string => {
|
||||
return `${Math.floor(Math.abs(n))}`.padStart(2, '0');
|
||||
}
|
||||
|
||||
export const distConvert = (speed: number) => {
|
||||
return Math.round(speed/1000)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
<h3>{{ item.name }}</h3>
|
||||
</div>
|
||||
<ul class="metadata">
|
||||
<li v-if="item.workouted_at"><span>Дата:</span> {{ formatTime(item.workouted_at) }}</li>
|
||||
<li v-if="item.speed"><span>Скорость:</span> {{ speedConvert(item.speed) }} км/ч</li>
|
||||
<li v-if="item.heart_rate"><span>Пульс:</span> {{ item.heart_rate }} уд /мин</li>
|
||||
<li v-if="item.cadence"><span>Каденс:</span> {{ item.cadence }} об/мин</li>
|
||||
|
|
@ -32,7 +33,7 @@
|
|||
import { ref, inject } from 'vue';
|
||||
import { useToast } from "vuestic-ui/web-components";
|
||||
import { useRouter } from "vue-router";
|
||||
import { WorkoutItem, secondsToDuration, distConvert, speedConvert } from "./Definitions.vue";
|
||||
import { WorkoutItem, secondsToDuration, distConvert, formatTime, speedConvert } from "./Definitions.vue";
|
||||
|
||||
|
||||
const { push } = useRouter();
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@
|
|||
<h3>{{ workoutItem.name }}</h3>
|
||||
<VaIcon name="edit" @click="showModalTitle = !showModalTitle"/>
|
||||
</div>
|
||||
<div class="workout-item-params" v-if="workoutItem.workouted_at">
|
||||
<div class="workout-item-params-name">Дата:</div>
|
||||
<div class="workout-item-params-value">{{ formatTime(workoutItem.workouted_at) }}</div>
|
||||
</div>
|
||||
<div class="workout-item-params" v-if="workoutItem.power">
|
||||
<div class="workout-item-params-name">Средняя мощность:</div>
|
||||
<div class="workout-item-params-value">{{ Math.floor(workoutItem.power) }} Вт</div>
|
||||
|
|
@ -138,7 +142,7 @@ import {
|
|||
import LineWithLineChart from './components/LineWithLineChart.js'
|
||||
import type { YMap } from '@yandex/ymaps3-types';
|
||||
import { YandexMap, YandexMapDefaultSchemeLayer, YandexMapFeature, YandexMapDefaultFeaturesLayer, YandexMapDefaultMarker } from 'vue-yandex-maps';
|
||||
import { WorkoutItem, distConvert, speedConvert, WorkoutLink } from "./Definitions.vue";
|
||||
import { WorkoutItem, distConvert, speedConvert, formatTime } from "./Definitions.vue";
|
||||
|
||||
|
||||
//Можно использовать для различных преобразований
|
||||
|
|
@ -227,19 +231,24 @@ const chartOptions = {
|
|||
displayColors: false,
|
||||
callbacks: {
|
||||
label: function (context: any) {
|
||||
console.log(data.value.datasets)
|
||||
currentCoordinates.value = lineCoordinates.value[context.dataIndex];
|
||||
let show_data = [];
|
||||
if (data.value.datasets[0].data[context.dataIndex]) {
|
||||
show_data.push("Скорость: " + Math.floor(data.value.datasets[0].data[context.dataIndex]));
|
||||
}
|
||||
if (data.value.datasets[1].data[context.dataIndex]) {
|
||||
show_data.push("Пульс: " + data.value.datasets[1].data[context.dataIndex]);
|
||||
}
|
||||
if (data.value.datasets[2].data[context.dataIndex]) {
|
||||
show_data.push("Мощность: " + data.value.datasets[2].data[context.dataIndex]);
|
||||
}
|
||||
if (Math.floor(data.value.datasets[3].data[context.dataIndex])) {
|
||||
show_data.push("Подъем: " + Math.floor(data.value.datasets[3].data[context.dataIndex]));
|
||||
for (let i = 0; i < data.value.datasets.length; i++) {
|
||||
let value = data.value.datasets[i].label + " :" + Math.floor(data.value.datasets[i].data[context.dataIndex])
|
||||
if (data.value.datasets[i].label == "Скорость") {
|
||||
value = value + " км/ч";
|
||||
}
|
||||
if (data.value.datasets[i].label == "Пульс") {
|
||||
value = value + " уд/мин";
|
||||
}
|
||||
if (data.value.datasets[i].label == "Мощность") {
|
||||
value = value + " Ватт";
|
||||
}
|
||||
if (data.value.datasets[i].label == "Подъем") {
|
||||
value = value + " м";
|
||||
}
|
||||
show_data.push(value);
|
||||
}
|
||||
return show_data;
|
||||
}
|
||||
|
|
@ -281,6 +290,13 @@ const saveLink = (hide: any) => {
|
|||
});
|
||||
};
|
||||
const saveName = (hide: any) => {
|
||||
if (workoutItem.value?.name.length == 0) {
|
||||
init({
|
||||
message: "Название не может быть пустым",
|
||||
color: "error",
|
||||
});
|
||||
return;
|
||||
}
|
||||
axiosAuth
|
||||
.patch(`/api/v0/workouts/${workoutItem.value?.id}`,{ name: workoutItem.value?.name })
|
||||
.then((response: AxiosResponse) => {
|
||||
|
|
@ -341,16 +357,16 @@ const initWorkout = (id: string) => {
|
|||
lineCoordinates.value = coords
|
||||
mapCenter.value = [coords[0][0], coords[0][1]];
|
||||
let datasets = [];
|
||||
if (speed) {
|
||||
if (speed.length > 0) {
|
||||
datasets.push({ radius: 0, label: 'Скорость', borderColor: '#00aa00', backgroundColor: '#00aa00', data: speed });
|
||||
}
|
||||
if (heart_rate) {
|
||||
if (heart_rate.length > 0) {
|
||||
datasets.push({ radius: 0, label: 'Пульс', borderColor: '#990000', backgroundColor: '#990000', data: heart_rate, });
|
||||
}
|
||||
if (power) {
|
||||
if (power.length > 0) {
|
||||
datasets.push({ radius: 0, label: 'Мощность', borderColor: '#cccccc', backgroundColor: '#cccccc', data: power, });
|
||||
}
|
||||
if (elevation) {
|
||||
if (elevation.length > 0) {
|
||||
datasets.push( { radius: 0, label: 'Подъем', borderColor: '#000', backgroundColor: '#000', data: elevation, });
|
||||
}
|
||||
data.value = {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
<VaIcon name="delete_forever" size="22px" color="#bbc1c3" class="news-item-icon" @click="(event: any) => deleteItem(item.id, event)"/>
|
||||
</div>
|
||||
<ul class="metadata">
|
||||
<li v-if="item.workouted_at"><span>Дата:</span> {{ formatTime(item.workouted_at) }}</li>
|
||||
<li v-if="item.speed"><span>Скорость:</span> {{ speedConvert(item.speed) }} км/ч</li>
|
||||
<li v-if="item.heart_rate"><span>Пульс:</span> {{ item.heart_rate }} уд /мин</li>
|
||||
<li v-if="item.cadence"><span>Каденс:</span> {{ item.cadence }} об/мин</li>
|
||||
|
|
@ -35,7 +36,7 @@ import { AxiosResponse, AxiosInstance } from "axios";
|
|||
import { ref, inject } from 'vue';
|
||||
import { useToast } from "vuestic-ui/web-components";
|
||||
import { useRouter } from "vue-router";
|
||||
import { WorkoutItem, Attachment, secondsToDuration, distConvert, speedConvert } from "./Definitions.vue";
|
||||
import { WorkoutItem, formatTime, secondsToDuration, distConvert, speedConvert } from "./Definitions.vue";
|
||||
|
||||
|
||||
const { push } = useRouter();
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@
|
|||
</div>
|
||||
<div id="workout-short-data">
|
||||
<h3>{{ workoutItem.name }}</h3>
|
||||
<div class="workout-item-params" v-if="workoutItem.workouted_at">
|
||||
<div class="workout-item-params-name">Дата:</div>
|
||||
<div class="workout-item-params-value">{{ formatTime(workoutItem.workouted_at) }}</div>
|
||||
</div>
|
||||
<div class="workout-item-params" v-if="workoutItem.power">
|
||||
<div class="workout-item-params-name">Средняя мощность:</div>
|
||||
<div class="workout-item-params-value">{{ Math.floor(workoutItem.power) }} Вт</div>
|
||||
|
|
@ -113,7 +117,7 @@ import {
|
|||
import LineWithLineChart from './components/LineWithLineChart.js'
|
||||
import type { YMap } from '@yandex/ymaps3-types';
|
||||
import { YandexMap, YandexMapDefaultSchemeLayer, YandexMapFeature, YandexMapDefaultFeaturesLayer, YandexMapDefaultMarker } from 'vue-yandex-maps';
|
||||
import { WorkoutItem, distConvert, speedConvert } from "./Definitions.vue";
|
||||
import { WorkoutItem, distConvert, formatTime, speedConvert } from "./Definitions.vue";
|
||||
|
||||
//Можно использовать для различных преобразований
|
||||
const map = shallowRef<null | YMap>(null);
|
||||
|
|
|
|||
Loading…
Reference in New Issue