diff --git a/Dockerfile b/Dockerfile
index abf90a4aa..8b312c4af 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -8,9 +8,10 @@ WORKDIR /app
# Копируем package.json и package-lock.json (если доступен) в рабочую директорию
COPY --chown=app:app package.json ./
# COPY package-lock.json ./ # Раскомментируйте эту строку, если у вас есть package-lock.json
-# COPY --chown=app:app ./docs/ ./docs/
+COPY --chown=app:app ./docs/ ./docs/
# Очищаем кэш npm и устанавливаем зависимости
-# RUN npm install
+RUN npm install
+
# RUN npm run githooks
COPY --chown=app:app src/front/package.json ./src/front/package.json
RUN npm install --prefix ./src/front
@@ -24,4 +25,5 @@ EXPOSE 5173 3000
# Команда для запуска приложения
# & npm run dev --prefix ./src/front
# & npm run dev --prefix ./src/front
-CMD ["sh", "-c", "npm run dev --prefix ./src/front "]
\ No newline at end of file
+# CMD ["sh", "-c", "npm run dev --prefix ./src/front "]
+CMD ["sh", "-c", "npm run docs:dev & npm run dev --prefix ./src/front "]
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
index a20e7b18a..4520bb7d3 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -12,22 +12,14 @@ services:
context: ./
volumes:
- ./docs:/app/docs
-
+ - ./src/front:/app/src/front
- /app/node_modules
- /app/src/front/node_modules
ports:
- "3000:3000"
-
- develop:
- watch:
- - action: sync
- path: ./src/front
- target: /app/src/front
- ignore:
- - node_modules/
-
- - action: rebuild
- path: package.json
+ - "5173:5173"
+
+
networks:
- dev
@@ -57,9 +49,11 @@ services:
restart:
always
build:
- context: ./src/back
+ context: .
+ dockerfile: src/back/Dockerfile
ports:
- "8000:8000"
+
env_file:
- src/back/portal/.env
networks:
diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs
index 24c2cff6a..fa10feb24 100644
--- a/docs/.vitepress/config.mjs
+++ b/docs/.vitepress/config.mjs
@@ -528,6 +528,10 @@ export default withMermaid({
"text": "MainmenuStore",
"link": "/src/store/MainmenuStore"
},
+ {
+ "text": "UseAlertStore",
+ "link": "/src/store/UseAlertStore"
+ },
{
"text": "WeekendsStore",
"link": "/src/store/WeekendsStore"
@@ -539,10 +543,6 @@ export default withMermaid({
{
"text": "index",
"link": "/src/store/index"
- },
- {
- "text": "useAlertStore",
- "link": "/src/store/useAlertStore"
}
]
},
diff --git a/docs/.vitepress/theme/components/TestRunner.vue b/docs/.vitepress/theme/components/TestRunner.vue
index 089a2ac0f..3cce30b96 100644
--- a/docs/.vitepress/theme/components/TestRunner.vue
+++ b/docs/.vitepress/theme/components/TestRunner.vue
@@ -3,44 +3,109 @@
Результаты тестов:
+
✅ Все тесты успешно пройдены!
-
- ❌ Ошибки в тестах: {{ results.numFailedTestSuites }}
+ ❌ Ошибки в тестах: {{ results.numFailedTestSuites }} из {{ results.numTotalTestSuites }}
+
⚠️ Некоторые тесты не завершились корректно.
+
{{ errorMessage }}
-
- -
- {{ test.name }}
-
- ✅ Успешно
- ❌ Ошибка
- {{ test.message }}
-
-
+
+
+
Сводка по тестам:
+
+ - Общее количество тестов: {{ results.numTotalTests }}
+ -
+ Пройдено: {{ results.numPassedTests }} ({{
+ getPercentage(results.numPassedTests, results.numTotalTests)
+ }}%)
+
+ -
+ Неудачных: {{ results.numFailedTests }} ({{
+ getPercentage(results.numFailedTests, results.numTotalTests)
+ }}%)
+
+
+
+
+
+
+
Успешные тесты:
+
+ -
+ {{ test.fullName }} ✅ ({{ test.duration }} мс)
+
+
+
+
+
+
@@ -55,6 +120,11 @@ onMounted(async () => {
font-weight: bold;
}
+.warning {
+ color: orange;
+ font-weight: bold;
+}
+
.passed {
color: green;
}
@@ -70,4 +140,13 @@ onMounted(async () => {
white-space: pre-wrap;
font-family: monospace;
}
+
+.summary {
+ margin-bottom: 20px;
+}
+
+.duration {
+ color: #555;
+ font-style: italic;
+}
diff --git a/docs/src/store/UseAlertStore.md b/docs/src/store/UseAlertStore.md
index 589aa4a27..4e083e698 100644
--- a/docs/src/store/UseAlertStore.md
+++ b/docs/src/store/UseAlertStore.md
@@ -1,9 +1,9 @@
-# useAlertStore
+# UseAlertStore
Описание отсутствует.
```js
-import * as useAlertStore from '@/components/store/useAlertStore';
+import * as UseAlertStore from '@/components/store/UseAlertStore';
```
---
diff --git a/src/back/Dockerfile b/src/back/Dockerfile
index 23d67c939..d35a9e6a9 100644
--- a/src/back/Dockerfile
+++ b/src/back/Dockerfile
@@ -8,20 +8,21 @@ RUN apt-get update && apt-get install -y \
pkg-config
# Копируем файлы зависимостей в контейнер
-COPY r.txt .
+COPY src/back/r.txt .
# Устанавливаем зависимости
RUN pip install -r r.txt
# Копируем все файлы проекта в контейнер
-COPY . .
-
+COPY src/back/ .
+COPY sys/wait-for-it.sh /usr/local/bin/wait-for-it
# Выполняем миграции (при необходимости)
# RUN python manage.py makemigrations
# RUN python manage.py migrate
-
+RUN chmod +x /usr/local/bin/wait-for-it
# Открываем порт, на котором будет работать приложение
EXPOSE 8000
# Команда для запуска приложения
-CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
+# CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
+CMD ["wait-for-it", "db:3306", "--", "python", "manage.py", "runserver", "0.0.0.0:8000"]
\ No newline at end of file
diff --git a/src/back/portal/settings.py b/src/back/portal/settings.py
index 18d92bae4..dfd7e6ca3 100644
--- a/src/back/portal/settings.py
+++ b/src/back/portal/settings.py
@@ -43,7 +43,7 @@ CSRF_TRUSTED_ORIGINS = [
'http://127.0.0.1',
'http://yourdomain.com', # Add your production domain here
]
-ALLOWED_HOSTS = ["*","portal-t",'portal9966','localhost','127.0.0.1']
+ALLOWED_HOSTS = ["*","portal-t",'portal9966','localhost','0.0.0.0']
CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
diff --git a/src/front/package.json b/src/front/package.json
index 07842954e..30dc05303 100644
--- a/src/front/package.json
+++ b/src/front/package.json
@@ -1,6 +1,7 @@
{
"name": "front",
"version": "0.0.85",
+ "type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
diff --git a/src/front/src/layouts/default/DefaultPortal.vue b/src/front/src/layouts/default/DefaultPortal.vue
index a58d02ee3..930ab7962 100644
--- a/src/front/src/layouts/default/DefaultPortal.vue
+++ b/src/front/src/layouts/default/DefaultPortal.vue
@@ -13,6 +13,8 @@
+
+
diff --git a/src/front/src/layouts/default/alertDefault.vue b/src/front/src/layouts/default/alertDefault.vue
index 097e29d67..1bf6f3e0a 100644
--- a/src/front/src/layouts/default/alertDefault.vue
+++ b/src/front/src/layouts/default/alertDefault.vue
@@ -25,11 +25,14 @@ export default {
const feedalert = useAlertStore().alert;
watch(
+
() => feedalert,
() => {
setTimeout(function () {
feedalert.text = "";
feedalert.ico = "";
+
+
feedalert.color = "";
feedalert.alert = false;
}, 8000);
diff --git a/src/front/vite.config.js b/src/front/vite.config.js
index de2d1b72a..63953e70a 100644
--- a/src/front/vite.config.js
+++ b/src/front/vite.config.js
@@ -38,5 +38,9 @@ export default defineConfig({
server: {
host: '0.0.0.0',
port: 3000,
+ hmr:{
+ host: '0.0.0.0',
+ port: 3000,
+ }
},
})
diff --git a/sys/wait-for-it.sh b/sys/wait-for-it.sh
new file mode 100644
index 000000000..d990e0d36
--- /dev/null
+++ b/sys/wait-for-it.sh
@@ -0,0 +1,182 @@
+#!/usr/bin/env bash
+# Use this script to test if a given TCP host/port are available
+
+WAITFORIT_cmdname=${0##*/}
+
+echoerr() { if [[ $WAITFORIT_QUIET -ne 1 ]]; then echo "$@" 1>&2; fi }
+
+usage()
+{
+ cat << USAGE >&2
+Usage:
+ $WAITFORIT_cmdname host:port [-s] [-t timeout] [-- command args]
+ -h HOST | --host=HOST Host or IP under test
+ -p PORT | --port=PORT TCP port under test
+ Alternatively, you specify the host and port as host:port
+ -s | --strict Only execute subcommand if the test succeeds
+ -q | --quiet Don't output any status messages
+ -t TIMEOUT | --timeout=TIMEOUT
+ Timeout in seconds, zero for no timeout
+ -- COMMAND ARGS Execute command with args after the test finishes
+USAGE
+ exit 1
+}
+
+wait_for()
+{
+ if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then
+ echoerr "$WAITFORIT_cmdname: waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT"
+ else
+ echoerr "$WAITFORIT_cmdname: waiting for $WAITFORIT_HOST:$WAITFORIT_PORT without a timeout"
+ fi
+ WAITFORIT_start_ts=$(date +%s)
+ while :
+ do
+ if [[ $WAITFORIT_ISBUSY -eq 1 ]]; then
+ nc -z $WAITFORIT_HOST $WAITFORIT_PORT
+ WAITFORIT_result=$?
+ else
+ (echo -n > /dev/tcp/$WAITFORIT_HOST/$WAITFORIT_PORT) >/dev/null 2>&1
+ WAITFORIT_result=$?
+ fi
+ if [[ $WAITFORIT_result -eq 0 ]]; then
+ WAITFORIT_end_ts=$(date +%s)
+ echoerr "$WAITFORIT_cmdname: $WAITFORIT_HOST:$WAITFORIT_PORT is available after $((WAITFORIT_end_ts - WAITFORIT_start_ts)) seconds"
+ break
+ fi
+ sleep 1
+ done
+ return $WAITFORIT_result
+}
+
+wait_for_wrapper()
+{
+ # In order to support SIGINT during timeout: http://unix.stackexchange.com/a/57692
+ if [[ $WAITFORIT_QUIET -eq 1 ]]; then
+ timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --quiet --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT &
+ else
+ timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT &
+ fi
+ WAITFORIT_PID=$!
+ trap "kill -INT -$WAITFORIT_PID" INT
+ wait $WAITFORIT_PID
+ WAITFORIT_RESULT=$?
+ if [[ $WAITFORIT_RESULT -ne 0 ]]; then
+ echoerr "$WAITFORIT_cmdname: timeout occurred after waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT"
+ fi
+ return $WAITFORIT_RESULT
+}
+
+# process arguments
+while [[ $# -gt 0 ]]
+do
+ case "$1" in
+ *:* )
+ WAITFORIT_hostport=(${1//:/ })
+ WAITFORIT_HOST=${WAITFORIT_hostport[0]}
+ WAITFORIT_PORT=${WAITFORIT_hostport[1]}
+ shift 1
+ ;;
+ --child)
+ WAITFORIT_CHILD=1
+ shift 1
+ ;;
+ -q | --quiet)
+ WAITFORIT_QUIET=1
+ shift 1
+ ;;
+ -s | --strict)
+ WAITFORIT_STRICT=1
+ shift 1
+ ;;
+ -h)
+ WAITFORIT_HOST="$2"
+ if [[ $WAITFORIT_HOST == "" ]]; then break; fi
+ shift 2
+ ;;
+ --host=*)
+ WAITFORIT_HOST="${1#*=}"
+ shift 1
+ ;;
+ -p)
+ WAITFORIT_PORT="$2"
+ if [[ $WAITFORIT_PORT == "" ]]; then break; fi
+ shift 2
+ ;;
+ --port=*)
+ WAITFORIT_PORT="${1#*=}"
+ shift 1
+ ;;
+ -t)
+ WAITFORIT_TIMEOUT="$2"
+ if [[ $WAITFORIT_TIMEOUT == "" ]]; then break; fi
+ shift 2
+ ;;
+ --timeout=*)
+ WAITFORIT_TIMEOUT="${1#*=}"
+ shift 1
+ ;;
+ --)
+ shift
+ WAITFORIT_CLI=("$@")
+ break
+ ;;
+ --help)
+ usage
+ ;;
+ *)
+ echoerr "Unknown argument: $1"
+ usage
+ ;;
+ esac
+done
+
+if [[ "$WAITFORIT_HOST" == "" || "$WAITFORIT_PORT" == "" ]]; then
+ echoerr "Error: you need to provide a host and port to test."
+ usage
+fi
+
+WAITFORIT_TIMEOUT=${WAITFORIT_TIMEOUT:-15}
+WAITFORIT_STRICT=${WAITFORIT_STRICT:-0}
+WAITFORIT_CHILD=${WAITFORIT_CHILD:-0}
+WAITFORIT_QUIET=${WAITFORIT_QUIET:-0}
+
+# Check to see if timeout is from busybox?
+WAITFORIT_TIMEOUT_PATH=$(type -p timeout)
+WAITFORIT_TIMEOUT_PATH=$(realpath $WAITFORIT_TIMEOUT_PATH 2>/dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH)
+
+WAITFORIT_BUSYTIMEFLAG=""
+if [[ $WAITFORIT_TIMEOUT_PATH =~ "busybox" ]]; then
+ WAITFORIT_ISBUSY=1
+ # Check if busybox timeout uses -t flag
+ # (recent Alpine versions don't support -t anymore)
+ if timeout &>/dev/stdout | grep -q -e '-t '; then
+ WAITFORIT_BUSYTIMEFLAG="-t"
+ fi
+else
+ WAITFORIT_ISBUSY=0
+fi
+
+if [[ $WAITFORIT_CHILD -gt 0 ]]; then
+ wait_for
+ WAITFORIT_RESULT=$?
+ exit $WAITFORIT_RESULT
+else
+ if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then
+ wait_for_wrapper
+ WAITFORIT_RESULT=$?
+ else
+ wait_for
+ WAITFORIT_RESULT=$?
+ fi
+fi
+
+if [[ $WAITFORIT_CLI != "" ]]; then
+ if [[ $WAITFORIT_RESULT -ne 0 && $WAITFORIT_STRICT -eq 1 ]]; then
+ echoerr "$WAITFORIT_cmdname: strict mode, refusing to execute subprocess"
+ exit $WAITFORIT_RESULT
+ fi
+ exec "${WAITFORIT_CLI[@]}"
+else
+ exit $WAITFORIT_RESULT
+fi