chore [P-01]: vite hmr

This commit is contained in:
Nukeap committed 2025-02-26 08:04:18 +03:00
1 parent b10199a46e
commit c718a76490
6 files changed
+169 -221

No files matched your search

+10
View File
@@ -34,12 +34,22 @@ DB_HOST=""
DB_EXTERNAL_PORT=3306
DB_INTERNAL_PORT=3306
REDIS="redis://redis"
REDISBROKER="redis://redis"
REDIS_PORT=6379
REDIS_BASE=0
FRONTEND_EXTERNAL_PORT=3000
FRONTEND_INTERNAL_PORT=3000
BACKEND_EXTERNAL_PORT=8000
BACKEND_INTERNAL_PORT=8000
DOCS_EXTERNAL_PORT=5173
DOCS_INTERNAL_PORT=5173
NGINX_EXTERNAL_PORT=80
+3 -2
View File
@@ -23,7 +23,8 @@ services:
ports:
- "${FRONTEND_EXTERNAL_PORT}:${FRONTEND_INTERNAL_PORT}"
environment:
- CHOKIDAR_USEPOLLING=true
networks:
@@ -33,7 +34,7 @@ services:
redis:
image: redis:alpine # Используем легковесный образ Redis
ports:
- "6379:6379" # Открываем порт Redis для внешнего доступа (по желанию)
- "${REDIS_PORT}:${REDIS_PORT}" # Открываем порт Redis для внешнего доступа (по желанию)
networks:
- dev
+37 -22
View File
@@ -2,26 +2,41 @@ from datetime import timedelta
import os
class Settings():
def __init__(self) -> None:
self.secret_key='V7bvDZMztr3EU8S9g1Dipw'
self.redis_hosts = [("redis", 6379)]
self.access_token_lifetime = timedelta(minutes=480)
self.refresh_token_lifetime = timedelta(days=1)
self.db = {
'default':{
'ENGINE': 'django.db.backends.mysql',
'NAME': os.getenv('DB_NAME'), # Имя базы данных
'USER': os.getenv('DB_USER'), # Имя пользователя
'PASSWORD': os.getenv('DB_PASSWORD'), # Пароль
'HOST': os.getenv('DB_HOST'), # Хост
'PORT': os.getenv('DB_INTERNAL_PORT'), # Порт
}
}
pass
class Settings:
"""
Настройки подключений - потом перенести
"""
def __init__(self) -> None:
"""
Настройки подключений - потом перенести
"""
self.secret_key = "V7bvDZMztr3EU8S9g1Dipw"
self.redis_hosts = [f"{str(os.getenv('REDIS'))}:{str(os.getenv('REDIS_PORT'))}"]
self.access_token_lifetime = timedelta(minutes=480)
self.refresh_token_lifetime = timedelta(days=1)
self.db = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": os.getenv("DB_NAME"), # Имя базы данных
"USER": os.getenv("DB_USER"), # Имя пользователя
"PASSWORD": os.getenv("DB_PASSWORD"), # Пароль
"HOST": os.getenv("DB_HOST"), # Хост
"PORT": os.getenv("DB_INTERNAL_PORT"), # Порт
}
}
def foo1(self) -> None:
"""
Настройки - потом перенести
"""
return None
def foo2(self) -> None:
"""
Настройки подключений - потом перенести
"""
return None
+104 -173
View File
@@ -1,192 +1,127 @@
<template>
<v-container fluid class="d-flex mx-0 pa-0">
<v-row class="ma-2">
<v-col
class="d-flex flex-column"
lg=7
md=12
cols=12
>
<v-row class="flex-grow-0">
<v-col class="pa-1">
<Carousel-list/>
<v-container fluid class="d-flex mx-0 pa-0">
<v-row class="ma-2">
<v-col class="d-flex flex-column" lg="7" md="12" cols="12">
<v-row class="flex-grow-0">
<v-col class="pa-1">
<Carousel-list />
</v-col>
</v-row>
<v-row style="height: 250px">
<v-col class="d-flex flex-column flex-grow-0 pa-1">
<!-- <event-calendar/> -->
</v-col>
</v-row>
</v-col>
</v-row>
<v-row style="height:250px">
<v-col class="d-flex flex-column flex-grow-0 pa-1">
<!-- <event-calendar/> -->
</v-col>
</v-row>
</v-col>
<v-col
class="d-flex flex-column"
lg=5
md=12
cols=12
>
<v-row>
<v-col class="d-flex flex-column">
<v-row >
<v-col
lg=4
md=2
cols=12
class="pa-1"
style="min-height:250px"
>
<digital-letna/>
</v-col>
<v-col
class="d-flex flex-column pa-1"
lg=8
md=10
cols=12
style="min-height:550px"
>
<v-card class="h-100 d-flex flex-column">
<v-row class="d-flex justify-md-center">
<v-col class="flex-column d-flex">
<news-home/>
</v-col>
</v-row>
</v-card>
</v-col>
</v-row>
</v-col>
</v-row>
<v-row class="flex-grow-0">
<v-col class="pa-1">
<v-card class="flex-colmn">
<v-sheet
class="mx-auto "
:class="favorit.length>10?'mx-n3':''"
max-width="800"
>
<v-slide-group
show-arrows
<v-col class="d-flex flex-column" lg="5" md="12" cols="12">
<v-row>
<v-col class="d-flex flex-column">
<v-row>
<v-col lg="4" md="2" cols="12" class="pa-1" style="min-height: 250px">
<digital-letna />
</v-col>
<v-col
class="d-flex flex-column pa-1"
lg="8"
md="10"
cols="12"
style="min-height: 550px"
>
<v-slide-group-item
v-for="x in favorit"
:key="x"
>
<v-btn-toggle
v-model="toggle"
divided
variant="outlined"
>
<v-tooltip
:text="x.pages__page"
location="top"
>
<template v-slot:activator="{ props }">
<v-btn
v-bind="props"
:icon="x.pages__ico"
:to="x.pages__fullPath"
/>
</template>
</v-tooltip>
</v-btn-toggle>
</v-slide-group-item>
</v-slide-group>
</v-sheet>
</v-card>
</v-col>
</v-row>
</v-col>
</v-row>
</v-container>
<v-card class="h-100 d-flex flex-column">
<v-row class="d-flex justify-md-center">
<v-col class="flex-column d-flex">
<news-home />
</v-col>
</v-row>
</v-card>
</v-col>
</v-row>
</v-col>
</v-row>
<v-row class="flex-grow-0">
<v-col class="pa-1">
<v-card class="flex-colmn">
<v-sheet class="mx-auto" :class="favorit.length > 10 ? 'mx-n3' : ''" max-width="800">
<v-slide-group show-arrows>
<v-slide-group-item v-for="x in favorit" :key="x">
<v-btn-toggle v-model="toggle" divided variant="outlined">
<v-tooltip :text="x.pages__page" location="top">
<template v-slot:activator="{ props }">
<v-btn v-bind="props" :icon="x.pages__ico" :to="x.pages__fullPath" />
</template>
</v-tooltip>
</v-btn-toggle>
</v-slide-group-item>
</v-slide-group>
</v-sheet>
</v-card>
</v-col>
</v-row>
</v-col>
</v-row>
</v-container>
</template>
<script>
import { ref, onMounted } from 'vue'
import {useAppStore} from '@/store/app'
import {useAccountStore} from '@/store/AccountStore'
import {pagecounter} from '@/utils/universal_functions'
import { ref, onMounted } from 'vue';
import { useAppStore } from '@/store/app';
import { useAccountStore } from '@/store/AccountStore';
import { pagecounter } from '@/utils/universal_functions';
import CarouselList from '@/components/carousel-list.vue'
import CarouselNumbers from '@/components/carousel-numbers.vue'
import CarouselList from '@/components/carousel-list.vue';
import NewsHome from '@/components/news-home.vue'
import LoadRound from '@/components/load-round.vue'
import DigitalLetna from '@/components/digital-letna.vue'
import { axiosApiInstance } from '@/utils/axios-api'
import NewsHome from '@/components/news-home.vue';
import EventCalendar from '@/components/calendar_of_events/event-calendar.vue'
import DigitalLetna from '@/components/digital-letna.vue';
import { axiosApiInstance } from '@/utils/axios-api';
export default {
export default {
components: {
CarouselList,
components: {
CarouselList,
CarouselNumbers,
DigitalLetna,
NewsHome,
},
LoadRound,
DigitalLetna,
EventCalendar,
NewsHome
},
setup() {
const appStore = useAppStore();
const favorit = ref([]);
const toggle = ref(null);
const accountStore = useAccountStore();
pagecounter();
setup(){
const appStore = useAppStore()
const favorit = ref([])
const toggle = ref(null)
const burl ="d"
const accountStore = useAccountStore()
pagecounter()
onMounted(() => {
favoritLinks();
});
onMounted(() => {
favoritLinks()
const favoritLinks = () => {
axiosApiInstance.get(`api/watcher/selectedlinks/`).then((data) => {
favorit.value = data.data;
});
};
})
return {
accountStore,
appStore,
favoritLinks,
favorit,
const favoritLinks = () => {
axiosApiInstance.get(`api/watcher/selectedlinks/`)
.then(data => {
favorit.value = data.data
})
}
return {
accountStore,
appStore,
favoritLinks,
favorit,
toggle
}
}
}
toggle,
};
},
};
</script>
<style lang="scss">
.v-picker-title, .v-picker__header, .v-picker__actions {
.v-picker-title,
.v-picker__header,
.v-picker__actions {
display: none;
}
.pik {
height: 84vh;
/*height: 85.3vh;*/
@@ -194,7 +129,7 @@
}
.hicard {
height: 40%!important;
height: 40% !important;
overflow: auto;
}
@@ -203,8 +138,6 @@
overflow: auto;
}
.fixed-bar {
position: sticky;
position: -webkit-sticky; /* for Safari */
@@ -213,14 +146,12 @@
}
.bgCard {
/* #ffffff6b #ffffff8c*/
background: #ffffff38 ;
/* #ffffff6b #ffffff8c*/
background: #ffffff38;
}
.bgText {
background: #ffffffb0;
line-height: 2.1rem!important;
background: #ffffffb0;
line-height: 2.1rem !important;
}
</style>
+12 -23
View File
@@ -1,46 +1,35 @@
// Plugins
import vue from '@vitejs/plugin-vue'
import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
import vue from '@vitejs/plugin-vue';
import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify';
// Utilities
import { defineConfig } from 'vite'
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite';
import { fileURLToPath, URL } from 'node:url';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue({
template: { transformAssetUrls }
vue({
template: { transformAssetUrls },
}),
// https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin
vuetify({
autoImport: true,
}),
],
define: { 'process.env': {} },
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
extensions: [
'.js',
'.json',
'.jsx',
'.mjs',
'.ts',
'.tsx',
'.vue',
],
extensions: ['.js', '.json', '.jsx', '.mjs', '.ts', '.tsx', '.vue'],
},
server: {
host: '0.0.0.0',
port: 3000,
hmr:{
host: '0.0.0.0',
hmr: {
// host: '0.0.0.0',
port: 3000,
}
},
},
})
});
+3 -1
View File
@@ -49,7 +49,9 @@ http {
}
location / {
proxy_pass http://frontend:${FRONTEND_EXTERNAL_PORT}; # Прокси на фронтенд
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;