Compare commits
1 Commits
master
...
feature/ad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58fabdce11 |
5
.gitignore
vendored
5
.gitignore
vendored
@ -25,9 +25,11 @@ __pycache__/
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
@ -171,6 +173,3 @@ cython_debug/
|
||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
#.idea/
|
||||
|
||||
static/position/
|
||||
test_data
|
||||
|
||||
@ -1,34 +1,68 @@
|
||||
repos:
|
||||
# Базовые хуки
|
||||
# Репозиторий pre-commit-hooks содержит базовые хуки для проверки кода.
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v5.0.0
|
||||
rev: v5.0.0 # Версия репозитория.
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: check-yaml
|
||||
- id: check-json
|
||||
exclude: launch.json
|
||||
- id: check-case-conflict
|
||||
- id: check-merge-conflict
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace # Удаляет пробелы в конце строк.
|
||||
- id: check-added-large-files # Проверяет, что добавляемые файлы не слишком большие.
|
||||
- id: check-yaml # Проверяет корректность YAML-файлов.
|
||||
- id: check-json # Проверяет корректность JSON-файлов.
|
||||
exclude: launch.json # Исключает файл launch.json из проверки.
|
||||
- id: check-case-conflict # Проверяет конфликты имен файлов с учетом регистра.
|
||||
- id: check-merge-conflict # Проверяет наличие маркеров конфликтов слияния.
|
||||
- id: end-of-file-fixer # Добавляет пустую строку в конец файла, если её нет.
|
||||
|
||||
# ruff - линтер, форматер
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.12.2
|
||||
# Репозиторий isort используется для сортировки импортов в Python.
|
||||
- repo: https://github.com/pycqa/isort
|
||||
rev: 6.0.1
|
||||
hooks:
|
||||
- id: ruff-check
|
||||
args: ["--verbose"]
|
||||
- id: ruff-format
|
||||
- id: isort
|
||||
exclude: __init__.py # Исключает файлы __init__.py из обработки.
|
||||
args: [ --profile, black, --filter-files ] # Использует профиль Black для совместимости.
|
||||
|
||||
# mypy - статическая проверка типов
|
||||
# pyupgrade автоматически обновляет синтаксис Python до более современного.
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v3.19.1
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: [ --py310-plus ] # Обновляет код для Python 3.10 и выше.
|
||||
|
||||
# Flake8 — это линтер Python, который проверяет код на соответствие стандартам PEP 8.
|
||||
- repo: https://github.com/PyCQA/flake8
|
||||
rev: 7.1.2
|
||||
hooks:
|
||||
- id: flake8
|
||||
exclude: "app/project/settings/__init__.py" # Исключает указанный файл из проверки.
|
||||
args: [ "--ignore=E501,F821", "--max-line-length=120" ] # Игнорирует определенные ошибки.
|
||||
|
||||
# mypy — это статический анализатор типов для Python.
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v1.15.0
|
||||
hooks:
|
||||
- id: mypy
|
||||
exclude: migrations/
|
||||
args: [
|
||||
"--ignore-missing-imports",
|
||||
"--disallow-untyped-defs",
|
||||
"--explicit-package-bases",
|
||||
"--show-error-codes"
|
||||
]
|
||||
additional_dependencies: [ types-requests ]
|
||||
args: [ --ignore-missing-imports, --disallow-untyped-defs, --explicit-package-bases] # Игнорирует отсутствующие импорты и требует аннотации типов.
|
||||
exclude: "migrations/"
|
||||
additional_dependencies:
|
||||
- types-requests
|
||||
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.9.9
|
||||
hooks:
|
||||
- id: ruff
|
||||
args: [ --fix ]
|
||||
- id: ruff-format
|
||||
|
||||
# pygrep-hooks содержит регулярные выражения для поиска проблем в коде.
|
||||
- repo: https://github.com/pre-commit/pygrep-hooks
|
||||
rev: v1.10.0
|
||||
hooks:
|
||||
- id: python-check-blanket-noqa # Проверяет неправильное использование noqa.
|
||||
- id: python-check-mock-methods # Проверяет правильность использования методов mock.
|
||||
- id: python-no-log-warn # Запрещает использование устаревшего метода warn() в логгировании.
|
||||
- id: python-use-type-annotations # Требует использование аннотаций типов вместо комментариев.
|
||||
|
||||
# flynt преобразует старый синтаксис форматирования строк в f-строки.
|
||||
- repo: https://github.com/ikamensh/flynt
|
||||
rev: 1.0.1
|
||||
hooks:
|
||||
- id: flynt
|
||||
|
||||
64
README.md
64
README.md
@ -1,17 +1,13 @@
|
||||
# Описание
|
||||
|
||||
Проект представляет собой позиционирование как отдельный сервис
|
||||
|
||||
# Установка
|
||||
|
||||
## Системные требование
|
||||
|
||||
* linux
|
||||
* docker
|
||||
* [gdal, geos, proj](https://trac.osgeo.org/osgeo4w/)
|
||||
|
||||
## Переменные окружения
|
||||
|
||||
В файле `example.env` приведены эти переменные
|
||||
|
||||
`POSTGRES_PASSWORD` - Пароль от БД
|
||||
@ -32,67 +28,11 @@
|
||||
|
||||
`TZ` - Временная зона
|
||||
|
||||
`PROJECT_ENV` - Состояние окружения (production, local)
|
||||
|
||||
`UE_STATIC_REPO` - Ссылка на git позиционирования
|
||||
`PROJECT_ENV` Состояние окружения (production, local)
|
||||
|
||||
## Развертывание
|
||||
|
||||
### Среда разработки (Windows)
|
||||
|
||||
Надо будет установить системные библиотеки:
|
||||
* [OSGeo4W](https://trac.osgeo.org/osgeo4w/):
|
||||
* gdal (bin)
|
||||
* gdal-devel (bin)
|
||||
* geos (bin)
|
||||
* proj (bin)
|
||||
* [Microsoft Visual C++ Build Tools](https://visualstudio.microsoft.com/ru/visual-cpp-build-tools/):
|
||||
* В установщике надо будет выбрать компоненты:
|
||||
* **MSVC v142** или выше (компилятор C++)
|
||||
* **C++ CMake Tools** for Windows (если есть)
|
||||
* **Windows 10 SDK** (если не установлен автоматически)
|
||||
|
||||
И прописать переменные окружения (Они необходимы для того, чтобы библиотеки Python работали корректно)
|
||||
|
||||
```conf
|
||||
Переменная Пример значения (для OSGeo4W) Назначение
|
||||
PATH C:\OSGeo4W\bin Чтобы система находила исполняемые файлы GDAL (gdal.dll, geos_c.dll и др.)
|
||||
GDAL_DATA C:\OSGeo4W\share\gdal Путь к данным GDAL (системы координат, единицы измерений)
|
||||
PROJ_LIB C:\OSGeo4W\share\proj Путь к данным PROJ (файлы проекций)
|
||||
GEOS_LIBRARY_PATH C:\OSGeo4W\bin\geos_c.dll Указывает Django путь к GEOS DLL (для работы с геометрией)
|
||||
GDAL_LIBRARY_PATH C:\OSGeo4W\bin\gdal.dll Указывает Django путь к GDAL DLL (для работы с растровыми/векторными данными)
|
||||
```
|
||||
|
||||
```bash
|
||||
poetry install --with dev
|
||||
```
|
||||
|
||||
```bash
|
||||
poetry run python manage.py runserver
|
||||
```
|
||||
|
||||
### Боевая среда
|
||||
|
||||
1. `git pull https://git.cybercode.pro/zakhy/mfss-positioning.git`
|
||||
2. `mv example.env .env` (Переименовать пароли и прочее)
|
||||
2. `mv example.env .env`
|
||||
3. `sudo docker compose up -d`
|
||||
|
||||
Будет запущен gunicorn на 8000 порту, nginx на 80
|
||||
|
||||
# Состояние по модулям
|
||||
|
||||
## Камеры
|
||||
|
||||
Пока что перенесена логика, но не интегрирована в приложение
|
||||
|
||||
## 3д позиционирование
|
||||
|
||||
Перенесено и интегрировано
|
||||
|
||||
## Уличное позиционирование
|
||||
|
||||
Первая итерация достигнута:
|
||||
* Отображение зданий:
|
||||
* Отображение количества людей в зданиях
|
||||
* Отображение базовых станций
|
||||
* Отображение уличных тегов на карте
|
||||
|
||||
25
app/Dockerfile
Normal file
25
app/Dockerfile
Normal file
@ -0,0 +1,25 @@
|
||||
FROM python:3.10.16-alpine3.21 as builder
|
||||
|
||||
RUN pip install poetry==2.1.1
|
||||
|
||||
ENV POETRY_NO_INTERACTION=1 \
|
||||
POETRY_VIRTUALENVS_IN_PROJECT=1 \
|
||||
POETRY_VIRTUALENVS_CREATE=1 \
|
||||
POETRY_CACHE_DIR=/tmp/poetry_cache
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY pyproject.toml poetry.lock ./
|
||||
RUN touch README.md
|
||||
|
||||
RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev --no-root
|
||||
|
||||
FROM python:3.10.16-alpine3.21 as runtime
|
||||
|
||||
ENV VIRTUAL_ENV=/app/.venv \
|
||||
PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
|
||||
COPY . .
|
||||
13
app/apps/cam/admin.py
Normal file
13
app/apps/cam/admin.py
Normal file
@ -0,0 +1,13 @@
|
||||
from apps.cam.models.model_channel import Channel
|
||||
from apps.cam.models.model_channelgroup import ChannelGroup
|
||||
from django.contrib import admin
|
||||
|
||||
|
||||
@admin.register(Channel)
|
||||
class ChannelAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
@admin.register(ChannelGroup)
|
||||
class ChannelGroupAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
@ -1,6 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class StreetPosConfig(AppConfig):
|
||||
class CamConfig(AppConfig):
|
||||
default_auto_field = "django.db.models.BigAutoField"
|
||||
name = "apps.street_pos"
|
||||
name = "apps.cam"
|
||||
5
app/apps/cam/forms/form_cam.py
Normal file
5
app/apps/cam/forms/form_cam.py
Normal file
@ -0,0 +1,5 @@
|
||||
from django import forms
|
||||
|
||||
|
||||
class DeleteForm(forms.Form):
|
||||
delete = forms.HiddenInput()
|
||||
5
app/apps/cam/forms/form_channel.py
Normal file
5
app/apps/cam/forms/form_channel.py
Normal file
@ -0,0 +1,5 @@
|
||||
from django import forms
|
||||
|
||||
|
||||
class ChannelStreamSelectForm(forms.Form):
|
||||
stream = forms.CharField(max_length=128, widget=forms.HiddenInput)
|
||||
44
app/apps/cam/forms/form_channel_group.py
Normal file
44
app/apps/cam/forms/form_channel_group.py
Normal file
@ -0,0 +1,44 @@
|
||||
from typing import Any
|
||||
|
||||
from apps.cam.models.model_channelgroup import ChannelGroup
|
||||
from django import forms
|
||||
|
||||
|
||||
class ChannelGroupEditForm(forms.ModelForm):
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields["title"].widget.attrs.update({"class": "form-control"})
|
||||
self.fields["title"].label = "Новое наименование группы"
|
||||
|
||||
class Meta:
|
||||
model = ChannelGroup
|
||||
fields = ("title",)
|
||||
|
||||
|
||||
class ChannelGroupCreateForm(forms.ModelForm):
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields["title"].widget.attrs.update({"class": "form-control"})
|
||||
self.fields["title"].label = "Наименование группы"
|
||||
self.fields["channels"].widget.attrs.update({"class": "form-control h-100"})
|
||||
self.fields["channels"].label = "Выберите камеры"
|
||||
|
||||
class Meta:
|
||||
model = ChannelGroup
|
||||
fields = ("title", "channels")
|
||||
|
||||
|
||||
class ChannelGroupAddForm(forms.ModelForm):
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields["channels"].label = "Камеры:"
|
||||
self.fields["channels"].widget.attrs.update({"class": "form-control mb-2"})
|
||||
self.fields["title"].label = "Наименование:"
|
||||
self.fields["title"].widget.attrs.update({"class": "form-control mb-2"})
|
||||
self.fields["active"].widget.attrs.update(
|
||||
{"active": "form-control mb-2", "id": "active"}
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = ChannelGroup
|
||||
fields = ("channels", "title", "active")
|
||||
73
app/apps/cam/migrations/0001_initial.py
Normal file
73
app/apps/cam/migrations/0001_initial.py
Normal file
@ -0,0 +1,73 @@
|
||||
# Generated by Django 4.2.19 on 2025-03-06 09:31
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="Channel",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("title", models.CharField(max_length=255)),
|
||||
("guid", models.CharField(max_length=50, unique=True)),
|
||||
("codec", models.CharField(default="h264", max_length=50)),
|
||||
("have_mainstream", models.BooleanField(default=False)),
|
||||
("have_substream", models.BooleanField(default=False)),
|
||||
("active", models.BooleanField(default=True)),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "камера",
|
||||
"verbose_name_plural": "камеры",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="ChannelGroup",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("title", models.CharField(max_length=128)),
|
||||
("active", models.BooleanField(default=True)),
|
||||
("channels", models.ManyToManyField(to="cam.channel")),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "группа камер",
|
||||
"verbose_name_plural": "группы камер",
|
||||
},
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="channel",
|
||||
index=models.Index(fields=["title"], name="cam_channel_title_09fbb8_idx"),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="channel",
|
||||
index=models.Index(fields=["guid"], name="cam_channel_guid_40e858_idx"),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="channel",
|
||||
index=models.Index(fields=["active"], name="cam_channel_active_ad3a4d_idx"),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="channelgroup",
|
||||
index=models.Index(fields=["title"], name="cam_channel_title_c1c1af_idx"),
|
||||
),
|
||||
]
|
||||
22
app/apps/cam/models/model_channel.py
Normal file
22
app/apps/cam/models/model_channel.py
Normal file
@ -0,0 +1,22 @@
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Channel(models.Model):
|
||||
title = models.CharField(max_length=255)
|
||||
guid = models.CharField(max_length=50, unique=True)
|
||||
codec = models.CharField(max_length=50, default="h264")
|
||||
have_mainstream = models.BooleanField(default=False)
|
||||
have_substream = models.BooleanField(default=False)
|
||||
active = models.BooleanField(default=True)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.title
|
||||
|
||||
class Meta:
|
||||
verbose_name = "камера"
|
||||
verbose_name_plural = "камеры"
|
||||
indexes = [
|
||||
models.Index(fields=("title",)),
|
||||
models.Index(fields=("guid",)),
|
||||
models.Index(fields=("active",)),
|
||||
]
|
||||
17
app/apps/cam/models/model_channelgroup.py
Normal file
17
app/apps/cam/models/model_channelgroup.py
Normal file
@ -0,0 +1,17 @@
|
||||
from django.db import models
|
||||
|
||||
|
||||
class ChannelGroup(models.Model):
|
||||
title = models.CharField(max_length=128)
|
||||
channels = models.ManyToManyField("Channel")
|
||||
active = models.BooleanField(default=True)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.title
|
||||
|
||||
class Meta:
|
||||
verbose_name = "группа камер"
|
||||
verbose_name_plural = "группы камер"
|
||||
indexes = [
|
||||
models.Index(fields=("title",)),
|
||||
]
|
||||
58
app/apps/cam/templates/cam/cam_delete_confirm.html
Normal file
58
app/apps/cam/templates/cam/cam_delete_confirm.html
Normal file
@ -0,0 +1,58 @@
|
||||
{% extends 'eps_base.html' %}
|
||||
{% load mysettings %}
|
||||
{% load static %}
|
||||
{% block style_sheets %}
|
||||
|
||||
<link href="{% static 'eps/bootstrap.min.css' %}?ver={% settings_value 'APP_VER' %}" rel="stylesheet">
|
||||
{% endblock %}
|
||||
{% block nav_header %}
|
||||
{% include 'adminLTE_custom_templates/_header.html' %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb p-2" style="margin-bottom: 0;">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="{% url 'eps:cam_list' %}" style="text-decoration: none">Список
|
||||
камер</a></li>
|
||||
<li class="breadcrumb-item" aria-current="page">
|
||||
<a href="{% url 'eps:manage_channels' %}" style="text-decoration: none"> Управление группами камер</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Удаление камеры из группы {{ group.title }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
||||
{% block nav_sidebar %}
|
||||
{% include 'adminLTE_custom_templates/_sidebar.html' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="col-6">
|
||||
<div class="card card-danger">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Удаление канала: из группы "{{ group.title }}"</h3>
|
||||
</div>
|
||||
<form method="post">
|
||||
{{ form }}
|
||||
{% csrf_token %}
|
||||
<div class="card-body">
|
||||
<div class="card-desc">
|
||||
<p>
|
||||
Вы действительно хотите удалить камеру <b>"{{ channel.title }}"</b> из группы
|
||||
<b>"{{ group.title }}"</b>
|
||||
</p>
|
||||
</div>
|
||||
<div class="">
|
||||
<button type="submit" class="btn btn-danger">Удалить</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
136
app/apps/cam/templates/cam/cam_detail.html
Normal file
136
app/apps/cam/templates/cam/cam_detail.html
Normal file
@ -0,0 +1,136 @@
|
||||
{% extends 'eps_base.html' %}
|
||||
{% load static %}
|
||||
{% block title %}
|
||||
Камеры внутри фабрики
|
||||
{% endblock %}
|
||||
|
||||
{% block nav_sidebar %}
|
||||
{% include 'adminLTE_custom_templates/_sidebar.html' %}
|
||||
{% endblock %}
|
||||
{% block nav_btns %} {% endblock %}
|
||||
|
||||
{% block content_wrapper %}
|
||||
<div class="content-wrapper d-flex flex-column">
|
||||
{% block breadcrumbs %}
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb p-2" style="margin-bottom: 0;">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="{% url 'eps:main_index' %}" style="text-decoration: none">
|
||||
Система определения местоположения сотрудников
|
||||
</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="{% url 'eps:cam_list' %}" style="text-decoration: none">
|
||||
{{ current_group.title }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{{ current_channel.title }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
{% endblock breadcrumbs %}
|
||||
<div class="d-flex justify-content-center align-items-center m-4">
|
||||
<div class="" style="width: 70%;background-color: #F4F6F9;">
|
||||
<div class="nav navbar navbar-expand-lg navbar-white navbar-light border-bottom p-0"
|
||||
style="gap:10px">
|
||||
|
||||
<div class="dropdown">
|
||||
<a class="btn btn-info dropdown-toggle" id="currentStream" type="button" data-toggle="dropdown"
|
||||
aria-expanded="false" data-stream="main">
|
||||
Основной поток
|
||||
</a>
|
||||
<div class="dropdown-menu">
|
||||
<button type="button" id="streamSwitch" class="dropdown-item">
|
||||
Дополнительный поток
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a type="button" class="btn btn-outline-primary" href="{% url 'eps:get_screenshot' guid %}">
|
||||
Скриншот</a>
|
||||
<div class="d-flex ml-auto">
|
||||
<a class="nav-link ml-auto" id="camExpand" href="#">
|
||||
<i class="fas fa-expand"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade active show" id="panel-index" role="tabpanel" aria-labelledby="tab-index">
|
||||
<img src="http://192.168.100.249:555/{{ camera_token }}" style="width: 100%; height: 100%;"
|
||||
id="cam-img"
|
||||
alt="" onerror="getCameraToken('main')">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block nav_footer %}
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_js %}
|
||||
<script>
|
||||
const img = document.querySelector('#cam-img');
|
||||
const expandBtn = document.querySelector('#camExpand')
|
||||
expandBtn.addEventListener('click', function (e) {
|
||||
img.requestFullscreen();
|
||||
})
|
||||
img.addEventListener('dblclick', () => {
|
||||
img.requestFullscreen();
|
||||
})
|
||||
{#img.onerror = getCameraToken()#}
|
||||
|
||||
function getCookie(name) {
|
||||
let cookieArr = document.cookie.split(';');
|
||||
for (let i = 0; i < cookieArr.length; i++) {
|
||||
let cookiePair = cookieArr[i].split("=");
|
||||
let cookieName = cookiePair[0].trim();
|
||||
if (cookieName === name) {
|
||||
return decodeURIComponent(cookiePair[1]);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async function getCameraToken(stream) {
|
||||
return await fetch(`${stream}/`)
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
console.error(response)
|
||||
}
|
||||
return response.json()
|
||||
})
|
||||
.then(data => {
|
||||
return data.token
|
||||
})
|
||||
}
|
||||
|
||||
function switchStream() {
|
||||
const stream = getCookie('currentStream')
|
||||
if (stream === 'main') {
|
||||
document.cookie = 'currentStream=sub'
|
||||
return 'sub'
|
||||
} else {
|
||||
document.cookie = 'currentStream=main'
|
||||
return 'main'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const streamSwitchButton = document.querySelector('#streamSwitch')
|
||||
const currentStream = document.querySelector('#currentStream')
|
||||
document.cookie = 'currentStream=main'
|
||||
streamSwitchButton.addEventListener('click', async (e) => {
|
||||
const stream = switchStream()
|
||||
const new_token = await getCameraToken(stream)
|
||||
if (stream === 'main') {
|
||||
currentStream.textContent = 'Основной поток'
|
||||
streamSwitchButton.textContent = 'Дополнительный поток'
|
||||
} else {
|
||||
currentStream.textContent = 'Дополнительный поток'
|
||||
streamSwitchButton.textContent = 'Основной поток'
|
||||
}
|
||||
img.src = `http://192.168.100.249:555/${new_token}`
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
37
app/apps/cam/templates/cam/cam_empty.html
Normal file
37
app/apps/cam/templates/cam/cam_empty.html
Normal file
@ -0,0 +1,37 @@
|
||||
{% extends 'eps_base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block nav_header %}
|
||||
{% include 'adminLTE_custom_templates/_header.html' %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block breadcrumbs %}
|
||||
{% endblock %}
|
||||
|
||||
{% block nav_sidebar %}
|
||||
{% include 'adminLTE_custom_templates/_sidebar.html' %}
|
||||
{% endblock %}
|
||||
{% block nav_heading %}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="col-6">
|
||||
<div class="card card-danger collapsed-card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Камеры не добавлены</h3>
|
||||
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-tool" data-card-widget="collapse"><i
|
||||
class="fas fa-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body" style="display: none;">
|
||||
Необходимо добавить камеры
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
119
app/apps/cam/templates/cam/cam_group_add.html
Normal file
119
app/apps/cam/templates/cam/cam_group_add.html
Normal file
@ -0,0 +1,119 @@
|
||||
{% extends 'eps_base.html' %}
|
||||
|
||||
{% load static %}
|
||||
{% block title %}
|
||||
Добавление камеры в группу
|
||||
{% endblock %}
|
||||
{% block nav_header %}
|
||||
{% include 'adminLTE_custom_templates/_header.html' %}]
|
||||
{% endblock %}
|
||||
|
||||
{% block nav_sidebar %}
|
||||
{% include 'adminLTE_custom_templates/_sidebar.html' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb p-2" style="margin-bottom: 0;">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="{% url 'eps:cam_list' %}" style="text-decoration: none">Список
|
||||
камер</a></li>
|
||||
<li class="breadcrumb-item" aria-current="page">
|
||||
<a href="{% url 'eps:manage_channels' %}" style="text-decoration: none"> Управление группами камер</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Добавить камеру в группу {{ obj.title }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xl-4 col-lg-6 col-sm-12">
|
||||
<div class="card card-primary">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Выберите камеру</h3>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="card-body" style="display: grid;">
|
||||
{% csrf_token %}
|
||||
<label for="id_title">
|
||||
{{ channel_add_form.title.label }}
|
||||
</label>
|
||||
{{ channel_add_form.title }}
|
||||
<label for="id_channels">
|
||||
{{ channel_add_form.channels.label }}
|
||||
</label>
|
||||
{{ channel_add_form.channels }}
|
||||
<div class="d-flex align-items-center" style="gap: 20px">
|
||||
<label for="active-w">Активна:</label>
|
||||
<div class="icheck-primary d-inline" id="active-w">
|
||||
{{ channel_add_form.active }}
|
||||
<label for="active">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mt-3">Редактировать</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-8 col-lg-6 col-sm-12">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Группа: {{ obj.title }}</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse">
|
||||
<i class="fas fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-0" style="display: block;">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Наименование камеры</th>
|
||||
<th>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for channel in obj.channels.all %}
|
||||
<tr>
|
||||
<td>{{ channel.title }}</td>
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
{# <a href="{% url 'eps:cam_detail' channel.guid %}"#}
|
||||
{# class="btn btn-info"><i#}
|
||||
{# class="fas fa-eye"></i></a>#}
|
||||
{# <a href="" class="btn btn-danger"><i class="fas fa-trash"></i></a>#}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{# <div class="col-xl-4 col-lg-6 col-sm-12">#}
|
||||
{# <div class="card card-primary">#}
|
||||
{# <div class="card-header">#}
|
||||
{# <h3 class="card-title">Редактирование группы</h3>#}
|
||||
{# </div>#}
|
||||
{# <form method="post">#}
|
||||
{# <div class="card-body">#}
|
||||
{# {% csrf_token %}#}
|
||||
{# {{ group_form }}#}
|
||||
{# <button type="submit" class="btn btn-primary mt-3">Сохранить</button>#}
|
||||
{# </div>#}
|
||||
{# </form>#}
|
||||
{# </div>#}
|
||||
{# </div>#}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block nav_footer %}
|
||||
|
||||
{% endblock %}
|
||||
135
app/apps/cam/templates/cam/cam_group_manage.html
Normal file
135
app/apps/cam/templates/cam/cam_group_manage.html
Normal file
@ -0,0 +1,135 @@
|
||||
{% extends 'eps_base.html' %}
|
||||
{% load static %}
|
||||
{% block title %}
|
||||
Управление группами камер
|
||||
{% endblock %}
|
||||
|
||||
{% block nav_header %}
|
||||
{% include 'adminLTE_custom_templates/_header.html' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block nav_btns %} {% endblock %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb p-2" style="margin-bottom: 0;">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="{% url 'eps:main_index' %}" style="text-decoration: none">
|
||||
Система определения местоположения сотрудников
|
||||
</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Управление группами камер</li>
|
||||
</ol>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="p-4">
|
||||
<div class="row mb-3">
|
||||
<div class="menu-btns">
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">
|
||||
Создать группу
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
{% for group in groups %}
|
||||
<div class="col-md-6 col-lg-6 col-sm-12">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Группа: {{ group.title }}</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse">
|
||||
<i class="fas fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-0" style="display: block;">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Наименование камеры</th>
|
||||
<th>
|
||||
<div class="d-flex justify-content-end align-items-center"
|
||||
style="gap: 10px">
|
||||
<a class="btn btn-outline-primary"
|
||||
href="{% url 'eps:cam_group_add' group.id %}">
|
||||
Редактировать
|
||||
</a>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for channel in group.channels.all %}
|
||||
<tr>
|
||||
<td>{{ channel.title }}</td>
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="{% url 'eps:cam_detail' channel.guid %}"
|
||||
class="btn btn-info"><i
|
||||
class="fas fa-eye"></i></a>
|
||||
<a href="{% url 'eps:cam_remove_from_group' group.id channel.id %}"
|
||||
class="btn btn-danger">
|
||||
<i class="fas fa-trash"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tr>
|
||||
<td>
|
||||
{% if group.active %}
|
||||
<a href="{% url 'eps:change_group_visibility' group.id %}"
|
||||
class="btn btn-outline-secondary">Скрыть группу</a>
|
||||
{% else %}
|
||||
<a href="{% url 'eps:change_group_visibility' group.id %}"
|
||||
class="btn btn-outline-primary">Показывать группу</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="d-flex justify-content-end">
|
||||
<a href="{% url 'eps:group_delete' group.id %}"
|
||||
class="btn btn-outline-danger">
|
||||
Удалить группу</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<form class="modal-content" method="post">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">Создание группы</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div>
|
||||
{% csrf_token %}
|
||||
<b>{{ form.title.label }}</b>
|
||||
{{ form.title }}
|
||||
<b>{{ form.channels.label }}</b>
|
||||
<div style="height: 500px">
|
||||
{{ form.channels }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Закрыть</button>
|
||||
<button type="submit" class="btn btn-primary">Создать</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block nav_footer %}
|
||||
|
||||
{% endblock %}
|
||||
{% block extra_js %}
|
||||
<script src="{% static 'eps/bootstrap.bundle.js' %}"></script>
|
||||
{% endblock %}
|
||||
54
app/apps/cam/templates/cam/group_delete_confirm.html
Normal file
54
app/apps/cam/templates/cam/group_delete_confirm.html
Normal file
@ -0,0 +1,54 @@
|
||||
{% extends 'eps_base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block nav_header %}
|
||||
{% include 'adminLTE_custom_templates/_header.html' %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb p-2" style="margin-bottom: 0;">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="{% url 'eps:cam_list' %}" style="text-decoration: none">Список
|
||||
камер</a></li>
|
||||
<li class="breadcrumb-item" aria-current="page">
|
||||
<a href="{% url 'eps:manage_channels' %}" style="text-decoration: none"> Управление группами камер</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Удаление камеры из группы {{ group.title }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
||||
{% block nav_sidebar %}
|
||||
{% include 'adminLTE_custom_templates/_sidebar.html' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="col-6">
|
||||
<div class="card card-danger">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Удаление группы "{{ group.title }}"</h3>
|
||||
</div>
|
||||
<form method="post">
|
||||
{{ form }}
|
||||
{% csrf_token %}
|
||||
<div class="card-body">
|
||||
<div class="card-desc">
|
||||
<p>
|
||||
Вы действительно хотите удалить группу
|
||||
<b>"{{ group.title }}"</b>
|
||||
</p>
|
||||
</div>
|
||||
<div class="">
|
||||
<button type="submit" class="btn btn-danger">Удалить</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
1
app/apps/cam/tests.py
Normal file
1
app/apps/cam/tests.py
Normal file
@ -0,0 +1 @@
|
||||
# Create your tests here.
|
||||
116
app/apps/cam/trassir.py
Normal file
116
app/apps/cam/trassir.py
Normal file
@ -0,0 +1,116 @@
|
||||
import requests
|
||||
import urllib3
|
||||
|
||||
# from apps.general.views.settingsmodule import get_settings
|
||||
from django.http import HttpRequest
|
||||
|
||||
# from sabron.util import logging
|
||||
|
||||
urllib3.disable_warnings()
|
||||
|
||||
# trassir_host = get_settings("trassir_host", "https://192.168.100.249:8080")
|
||||
# trassir_login = get_settings("trassir_login", "Cybercode")
|
||||
# trassir_password = get_settings("trassir_password", "Cybercode")
|
||||
|
||||
Headers = {
|
||||
"Accept": "*/*",
|
||||
# "Host": trassir_host,
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
"Connection": "keep-alive",
|
||||
"verify": "False",
|
||||
}
|
||||
|
||||
|
||||
def check_trassir_session(request: HttpRequest) -> bool:
|
||||
session = request.COOKIES.get("session")
|
||||
if session:
|
||||
pass
|
||||
# response = requests.get(
|
||||
# url=f"{trassir_host}/channels?sid={session}",
|
||||
# headers=Headers,
|
||||
# verify=False,
|
||||
# timeout=5,
|
||||
# )
|
||||
# if response.status_code == 200:
|
||||
# response_json = json.loads(response.text)
|
||||
# if (
|
||||
# "channels" in response_json
|
||||
# ): # Если в ответе есть каналы то сессия валидна
|
||||
# return True
|
||||
return False
|
||||
|
||||
|
||||
def get_trassir_session(request: HttpRequest) -> str | None:
|
||||
if check_trassir_session(request):
|
||||
return request.COOKIES.get("session")
|
||||
else:
|
||||
# response = requests.get(
|
||||
# url=f"{trassir_host}/login?username={trassir_login}&password={trassir_password}",
|
||||
# headers=Headers,
|
||||
# verify=False,
|
||||
# timeout=10,
|
||||
# )
|
||||
# if response.status_code == 200:
|
||||
# response_json = json.loads(response.text)
|
||||
# if response_json["success"] == 1:
|
||||
# session = SessionStore()
|
||||
# session["session_id"] = response_json["sid"]
|
||||
# session.save()
|
||||
# return response_json["sid"]
|
||||
# logging.error(f"Trassir: auth error \n {response.text}")
|
||||
return None
|
||||
|
||||
|
||||
def get_camera_token(session: str, guid: str, stream: str = "main") -> str | None:
|
||||
# response = requests.get(
|
||||
# f"{trassir_host}/get_video?channel={guid}&container=mjpeg&quality=100&stream={stream}&framerate=0&sid={session}",
|
||||
# headers=Headers,
|
||||
# verify=False,
|
||||
# timeout=5,
|
||||
# )
|
||||
# if response.status_code == 200:
|
||||
# response_json = json.loads(response.text)
|
||||
# if response_json["success"] == 1:
|
||||
# return response_json["token"]
|
||||
# # logging.error(f"Trassir: get camera token error \n {response.text}")
|
||||
return None
|
||||
|
||||
|
||||
def get_channels(trassir_session: str) -> list:
|
||||
def get_sort_key(value: dict) -> int | float:
|
||||
try:
|
||||
return int(value["name"].split()[0])
|
||||
except ValueError:
|
||||
return float("inf")
|
||||
|
||||
# response = requests.get(
|
||||
# f"{trassir_host}/channels?sid={trassir_session}",
|
||||
# headers=Headers,
|
||||
# verify=False,
|
||||
# timeout=5,
|
||||
# )
|
||||
# if response.status_code == 200:
|
||||
# response_json = json.loads(response.text)["channels"]
|
||||
# channels_factory_sorted = sorted(response_json, key=get_sort_key)
|
||||
# for channel in channels_factory_sorted:
|
||||
# if channel["have_mainstream"] == "0" and channel["have_substream"] == "0":
|
||||
# channels_factory_sorted.remove(channel)
|
||||
# return channels_factory_sorted
|
||||
return []
|
||||
# logging.error(f"Trassir: get channels list error \n {response.text}")
|
||||
|
||||
|
||||
def get_camera_screenshot(trassir_session: str, guid: str) -> requests.Response | None:
|
||||
# image = requests.get(
|
||||
# f"{trassir_host}/screenshot/{guid}?sid={trassir_session}",
|
||||
# headers=Headers,
|
||||
# verify=False,
|
||||
# timeout=5,
|
||||
# )
|
||||
# if image.status_code == 200:
|
||||
# if image.headers["Content-Type"] == "image/jpeg":
|
||||
# return image
|
||||
# else:
|
||||
# logging.error(f"Trassir: get screenshot \n {image.text}")
|
||||
# pass
|
||||
return None
|
||||
169
app/apps/cam/views.py
Normal file
169
app/apps/cam/views.py
Normal file
@ -0,0 +1,169 @@
|
||||
from apps.cam.forms.form_cam import DeleteForm
|
||||
from apps.cam.forms.form_channel_group import (
|
||||
ChannelGroupAddForm,
|
||||
ChannelGroupCreateForm,
|
||||
)
|
||||
from apps.cam.models.model_channel import Channel
|
||||
from apps.cam.models.model_channelgroup import ChannelGroup
|
||||
from apps.cam.trassir import (
|
||||
get_camera_screenshot,
|
||||
get_camera_token,
|
||||
get_channels,
|
||||
get_trassir_session,
|
||||
)
|
||||
from django.http import (
|
||||
HttpRequest,
|
||||
HttpResponse,
|
||||
HttpResponsePermanentRedirect,
|
||||
HttpResponseRedirect,
|
||||
JsonResponse,
|
||||
)
|
||||
from django.shortcuts import get_object_or_404, redirect, render
|
||||
|
||||
|
||||
def switch_stream(request: HttpRequest, guid: str, stream: str) -> JsonResponse:
|
||||
session = get_trassir_session(request)
|
||||
token = get_camera_token(session, guid, stream)
|
||||
return JsonResponse({"token": token})
|
||||
|
||||
|
||||
def cam_detail(request: HttpRequest, guid: str) -> HttpResponse:
|
||||
session = get_trassir_session(request)
|
||||
current_channel = Channel.objects.get(guid=guid)
|
||||
current_group = ChannelGroup.objects.filter(
|
||||
channels__guid=guid, active=True
|
||||
).first()
|
||||
groups = ChannelGroup.objects.filter(active=True)
|
||||
stream = request.COOKIES.get("stream")
|
||||
camera_token = get_camera_token(session, guid)
|
||||
response = render(
|
||||
request,
|
||||
"cam/cam_detail.html",
|
||||
{
|
||||
"guid": guid,
|
||||
"session_id": session,
|
||||
"camera_token": camera_token,
|
||||
"current_channel": current_channel,
|
||||
"current_group": current_group,
|
||||
"groups": groups,
|
||||
"stream": stream,
|
||||
},
|
||||
)
|
||||
response.set_cookie("session", session)
|
||||
return response
|
||||
|
||||
|
||||
def cam_list(request: HttpRequest) -> HttpResponse | (
|
||||
HttpResponsePermanentRedirect | HttpResponseRedirect
|
||||
):
|
||||
if Channel.objects.first():
|
||||
return redirect("eps:cam_detail", guid="F3anZHZa")
|
||||
else:
|
||||
return render(request, "cam/cam_empty.html", {}) # Временное решение
|
||||
|
||||
|
||||
def get_screenshot(request: HttpRequest, guid: str) -> HttpResponse:
|
||||
session = get_trassir_session(request)
|
||||
image = get_camera_screenshot(session, guid)
|
||||
current_channel = Channel.objects.get(guid=guid)
|
||||
response = HttpResponse(image, content_type="image/jpeg")
|
||||
response["Content-Disposition"] = (
|
||||
f'attachment; filename="{current_channel.guid}.jpg"'
|
||||
)
|
||||
return response
|
||||
|
||||
|
||||
def refresh_channels(
|
||||
request: HttpRequest,
|
||||
) -> HttpResponsePermanentRedirect | HttpResponseRedirect:
|
||||
session = get_trassir_session(request)
|
||||
channels_from_api = get_channels(session)
|
||||
channels_from_db = Channel.objects.all().values_list("guid")
|
||||
|
||||
for channel in channels_from_api:
|
||||
if channel["guid"] in channels_from_db:
|
||||
continue
|
||||
try:
|
||||
Channel.objects.create(
|
||||
title=channel["name"],
|
||||
guid=channel["guid"],
|
||||
codec=channel["codec"],
|
||||
have_mainstream=channel["have_mainstream"],
|
||||
have_substream=channel["have_substream"],
|
||||
active=False,
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
response = redirect("eps:cam_list")
|
||||
response.set_cookie(key="session", value=session)
|
||||
return response
|
||||
|
||||
|
||||
def manage_channels(request: HttpRequest) -> HttpResponse:
|
||||
groups = ChannelGroup.objects.all()
|
||||
form = ChannelGroupCreateForm()
|
||||
if request.method == "POST":
|
||||
form = ChannelGroupCreateForm(request.POST)
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
return render(
|
||||
request, "cam/cam_group_manage.html", {"groups": groups, "form": form}
|
||||
)
|
||||
|
||||
|
||||
def channel_edit(request: HttpRequest, pk: int) -> HttpResponse | (
|
||||
HttpResponsePermanentRedirect | HttpResponseRedirect
|
||||
):
|
||||
groups = ChannelGroup.objects.filter(active=True)
|
||||
group = get_object_or_404(ChannelGroup, pk=pk)
|
||||
channel_add_form = ChannelGroupAddForm(instance=group)
|
||||
|
||||
if request.method == "POST":
|
||||
channel_add_form = ChannelGroupAddForm(request.POST, instance=group)
|
||||
if channel_add_form.is_valid():
|
||||
channel_add_form.save()
|
||||
return redirect("eps:manage_channels")
|
||||
return render(
|
||||
request,
|
||||
"cam/cam_group_add.html",
|
||||
{"groups": groups, "obj": group, "channel_add_form": channel_add_form},
|
||||
)
|
||||
|
||||
|
||||
def cam_remove_from_group(request: HttpRequest, group_id: int, pk: int) -> HttpResponse:
|
||||
groups = ChannelGroup.objects.filter(active=True)
|
||||
group = get_object_or_404(ChannelGroup, id=group_id)
|
||||
channel = get_object_or_404(Channel, id=pk)
|
||||
form = DeleteForm()
|
||||
if request.method == "POST":
|
||||
group.channels.remove(channel)
|
||||
group.save()
|
||||
return redirect("eps:manage_channels")
|
||||
return render(
|
||||
request,
|
||||
"cam/cam_delete_confirm.html",
|
||||
{"groups": groups, "group": group, "channel": channel, "form": form},
|
||||
)
|
||||
|
||||
|
||||
def group_delete(request: HttpRequest, pk: int) -> HttpResponse:
|
||||
group = get_object_or_404(ChannelGroup, id=pk)
|
||||
form = DeleteForm()
|
||||
if request.method == "POST":
|
||||
group.delete()
|
||||
return redirect("eps:manage_channels")
|
||||
return render(
|
||||
request, "cam/group_delete_confirm.html", {"group": group, "form": form}
|
||||
)
|
||||
|
||||
|
||||
def change_group_visibility(
|
||||
request: HttpRequest, pk: int
|
||||
) -> HttpResponsePermanentRedirect | HttpResponseRedirect:
|
||||
group = get_object_or_404(ChannelGroup, id=pk)
|
||||
if group.active:
|
||||
group.active = False
|
||||
else:
|
||||
group.active = True
|
||||
group.save()
|
||||
return redirect("eps:manage_channels")
|
||||
@ -12,7 +12,7 @@ def main() -> None:
|
||||
raise ImportError(
|
||||
"Couldn't import Django. Are you sure it's installed and "
|
||||
"available on your PYTHONPATH environment variable? Did you "
|
||||
"forget to activate a virtual environment?",
|
||||
"forget to activate a virtual environment?"
|
||||
) from exc
|
||||
execute_from_command_line(sys.argv)
|
||||
|
||||
557
positioning/poetry.lock → app/poetry.lock
generated
557
positioning/poetry.lock → app/poetry.lock
generated
@ -6,7 +6,7 @@ version = "3.8.1"
|
||||
description = "ASGI specs, helper code, and adapters"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main", "dev"]
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "asgiref-3.8.1-py3-none-any.whl", hash = "sha256:3e1e3ecc849832fe52ccf2cb6686b7a55f82bb1d6aee72a58826471390335e47"},
|
||||
{file = "asgiref-3.8.1.tar.gz", hash = "sha256:c343bd80a0bec947a9860adb4c432ffa7db769836c64238fc34bdc3fec84d590"},
|
||||
@ -18,6 +18,65 @@ typing-extensions = {version = ">=4", markers = "python_version < \"3.11\""}
|
||||
[package.extras]
|
||||
tests = ["mypy (>=0.800)", "pytest", "pytest-asyncio"]
|
||||
|
||||
[[package]]
|
||||
name = "black"
|
||||
version = "25.1.0"
|
||||
description = "The uncompromising code formatter."
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "black-25.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:759e7ec1e050a15f89b770cefbf91ebee8917aac5c20483bc2d80a6c3a04df32"},
|
||||
{file = "black-25.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0e519ecf93120f34243e6b0054db49c00a35f84f195d5bce7e9f5cfc578fc2da"},
|
||||
{file = "black-25.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:055e59b198df7ac0b7efca5ad7ff2516bca343276c466be72eb04a3bcc1f82d7"},
|
||||
{file = "black-25.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:db8ea9917d6f8fc62abd90d944920d95e73c83a5ee3383493e35d271aca872e9"},
|
||||
{file = "black-25.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a39337598244de4bae26475f77dda852ea00a93bd4c728e09eacd827ec929df0"},
|
||||
{file = "black-25.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:96c1c7cd856bba8e20094e36e0f948718dc688dba4a9d78c3adde52b9e6c2299"},
|
||||
{file = "black-25.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bce2e264d59c91e52d8000d507eb20a9aca4a778731a08cfff7e5ac4a4bb7096"},
|
||||
{file = "black-25.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:172b1dbff09f86ce6f4eb8edf9dede08b1fce58ba194c87d7a4f1a5aa2f5b3c2"},
|
||||
{file = "black-25.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4b60580e829091e6f9238c848ea6750efed72140b91b048770b64e74fe04908b"},
|
||||
{file = "black-25.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1e2978f6df243b155ef5fa7e558a43037c3079093ed5d10fd84c43900f2d8ecc"},
|
||||
{file = "black-25.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3b48735872ec535027d979e8dcb20bf4f70b5ac75a8ea99f127c106a7d7aba9f"},
|
||||
{file = "black-25.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:ea0213189960bda9cf99be5b8c8ce66bb054af5e9e861249cd23471bd7b0b3ba"},
|
||||
{file = "black-25.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8f0b18a02996a836cc9c9c78e5babec10930862827b1b724ddfe98ccf2f2fe4f"},
|
||||
{file = "black-25.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:afebb7098bfbc70037a053b91ae8437c3857482d3a690fefc03e9ff7aa9a5fd3"},
|
||||
{file = "black-25.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:030b9759066a4ee5e5aca28c3c77f9c64789cdd4de8ac1df642c40b708be6171"},
|
||||
{file = "black-25.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:a22f402b410566e2d1c950708c77ebf5ebd5d0d88a6a2e87c86d9fb48afa0d18"},
|
||||
{file = "black-25.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a1ee0a0c330f7b5130ce0caed9936a904793576ef4d2b98c40835d6a65afa6a0"},
|
||||
{file = "black-25.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f3df5f1bf91d36002b0a75389ca8663510cf0531cca8aa5c1ef695b46d98655f"},
|
||||
{file = "black-25.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d9e6827d563a2c820772b32ce8a42828dc6790f095f441beef18f96aa6f8294e"},
|
||||
{file = "black-25.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:bacabb307dca5ebaf9c118d2d2f6903da0d62c9faa82bd21a33eecc319559355"},
|
||||
{file = "black-25.1.0-py3-none-any.whl", hash = "sha256:95e8176dae143ba9097f351d174fdaf0ccd29efb414b362ae3fd72bf0f710717"},
|
||||
{file = "black-25.1.0.tar.gz", hash = "sha256:33496d5cd1222ad73391352b4ae8da15253c5de89b93a80b3e2c8d9a19ec2666"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
click = ">=8.0.0"
|
||||
mypy-extensions = ">=0.4.3"
|
||||
packaging = ">=22.0"
|
||||
pathspec = ">=0.9.0"
|
||||
platformdirs = ">=2"
|
||||
tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}
|
||||
typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""}
|
||||
|
||||
[package.extras]
|
||||
colorama = ["colorama (>=0.4.3)"]
|
||||
d = ["aiohttp (>=3.10)"]
|
||||
jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"]
|
||||
uvloop = ["uvloop (>=0.15.2)"]
|
||||
|
||||
[[package]]
|
||||
name = "certifi"
|
||||
version = "2025.1.31"
|
||||
description = "Python package for providing Mozilla's CA Bundle."
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe"},
|
||||
{file = "certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cfgv"
|
||||
version = "3.4.0"
|
||||
@ -30,13 +89,130 @@ files = [
|
||||
{file = "cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "charset-normalizer"
|
||||
version = "3.4.1"
|
||||
description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "charset_normalizer-3.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de"},
|
||||
{file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176"},
|
||||
{file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e218488cd232553829be0664c2292d3af2eeeb94b32bea483cf79ac6a694e037"},
|
||||
{file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80ed5e856eb7f30115aaf94e4a08114ccc8813e6ed1b5efa74f9f82e8509858f"},
|
||||
{file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b010a7a4fd316c3c484d482922d13044979e78d1861f0e0650423144c616a46a"},
|
||||
{file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4532bff1b8421fd0a320463030c7520f56a79c9024a4e88f01c537316019005a"},
|
||||
{file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d973f03c0cb71c5ed99037b870f2be986c3c05e63622c017ea9816881d2dd247"},
|
||||
{file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3a3bd0dcd373514dcec91c411ddb9632c0d7d92aed7093b8c3bbb6d69ca74408"},
|
||||
{file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:d9c3cdf5390dcd29aa8056d13e8e99526cda0305acc038b96b30352aff5ff2bb"},
|
||||
{file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2bdfe3ac2e1bbe5b59a1a63721eb3b95fc9b6817ae4a46debbb4e11f6232428d"},
|
||||
{file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:eab677309cdb30d047996b36d34caeda1dc91149e4fdca0b1a039b3f79d9a807"},
|
||||
{file = "charset_normalizer-3.4.1-cp310-cp310-win32.whl", hash = "sha256:c0429126cf75e16c4f0ad00ee0eae4242dc652290f940152ca8c75c3a4b6ee8f"},
|
||||
{file = "charset_normalizer-3.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:9f0b8b1c6d84c8034a44893aba5e767bf9c7a211e313a9605d9c617d7083829f"},
|
||||
{file = "charset_normalizer-3.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8bfa33f4f2672964266e940dd22a195989ba31669bd84629f05fab3ef4e2d125"},
|
||||
{file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:28bf57629c75e810b6ae989f03c0828d64d6b26a5e205535585f96093e405ed1"},
|
||||
{file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f08ff5e948271dc7e18a35641d2f11a4cd8dfd5634f55228b691e62b37125eb3"},
|
||||
{file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:234ac59ea147c59ee4da87a0c0f098e9c8d169f4dc2a159ef720f1a61bbe27cd"},
|
||||
{file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd4ec41f914fa74ad1b8304bbc634b3de73d2a0889bd32076342a573e0779e00"},
|
||||
{file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eea6ee1db730b3483adf394ea72f808b6e18cf3cb6454b4d86e04fa8c4327a12"},
|
||||
{file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c96836c97b1238e9c9e3fe90844c947d5afbf4f4c92762679acfe19927d81d77"},
|
||||
{file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4d86f7aff21ee58f26dcf5ae81a9addbd914115cdebcbb2217e4f0ed8982e146"},
|
||||
{file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:09b5e6733cbd160dcc09589227187e242a30a49ca5cefa5a7edd3f9d19ed53fd"},
|
||||
{file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:5777ee0881f9499ed0f71cc82cf873d9a0ca8af166dfa0af8ec4e675b7df48e6"},
|
||||
{file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:237bdbe6159cff53b4f24f397d43c6336c6b0b42affbe857970cefbb620911c8"},
|
||||
{file = "charset_normalizer-3.4.1-cp311-cp311-win32.whl", hash = "sha256:8417cb1f36cc0bc7eaba8ccb0e04d55f0ee52df06df3ad55259b9a323555fc8b"},
|
||||
{file = "charset_normalizer-3.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:d7f50a1f8c450f3925cb367d011448c39239bb3eb4117c36a6d354794de4ce76"},
|
||||
{file = "charset_normalizer-3.4.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:73d94b58ec7fecbc7366247d3b0b10a21681004153238750bb67bd9012414545"},
|
||||
{file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dad3e487649f498dd991eeb901125411559b22e8d7ab25d3aeb1af367df5efd7"},
|
||||
{file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c30197aa96e8eed02200a83fba2657b4c3acd0f0aa4bdc9f6c1af8e8962e0757"},
|
||||
{file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2369eea1ee4a7610a860d88f268eb39b95cb588acd7235e02fd5a5601773d4fa"},
|
||||
{file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc2722592d8998c870fa4e290c2eec2c1569b87fe58618e67d38b4665dfa680d"},
|
||||
{file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffc9202a29ab3920fa812879e95a9e78b2465fd10be7fcbd042899695d75e616"},
|
||||
{file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:804a4d582ba6e5b747c625bf1255e6b1507465494a40a2130978bda7b932c90b"},
|
||||
{file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:0f55e69f030f7163dffe9fd0752b32f070566451afe180f99dbeeb81f511ad8d"},
|
||||
{file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c4c3e6da02df6fa1410a7680bd3f63d4f710232d3139089536310d027950696a"},
|
||||
{file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:5df196eb874dae23dcfb968c83d4f8fdccb333330fe1fc278ac5ceeb101003a9"},
|
||||
{file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e358e64305fe12299a08e08978f51fc21fac060dcfcddd95453eabe5b93ed0e1"},
|
||||
{file = "charset_normalizer-3.4.1-cp312-cp312-win32.whl", hash = "sha256:9b23ca7ef998bc739bf6ffc077c2116917eabcc901f88da1b9856b210ef63f35"},
|
||||
{file = "charset_normalizer-3.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:6ff8a4a60c227ad87030d76e99cd1698345d4491638dfa6673027c48b3cd395f"},
|
||||
{file = "charset_normalizer-3.4.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:aabfa34badd18f1da5ec1bc2715cadc8dca465868a4e73a0173466b688f29dda"},
|
||||
{file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22e14b5d70560b8dd51ec22863f370d1e595ac3d024cb8ad7d308b4cd95f8313"},
|
||||
{file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8436c508b408b82d87dc5f62496973a1805cd46727c34440b0d29d8a2f50a6c9"},
|
||||
{file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d074908e1aecee37a7635990b2c6d504cd4766c7bc9fc86d63f9c09af3fa11b"},
|
||||
{file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:955f8851919303c92343d2f66165294848d57e9bba6cf6e3625485a70a038d11"},
|
||||
{file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:44ecbf16649486d4aebafeaa7ec4c9fed8b88101f4dd612dcaf65d5e815f837f"},
|
||||
{file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0924e81d3d5e70f8126529951dac65c1010cdf117bb75eb02dd12339b57749dd"},
|
||||
{file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2967f74ad52c3b98de4c3b32e1a44e32975e008a9cd2a8cc8966d6a5218c5cb2"},
|
||||
{file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c75cb2a3e389853835e84a2d8fb2b81a10645b503eca9bcb98df6b5a43eb8886"},
|
||||
{file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:09b26ae6b1abf0d27570633b2b078a2a20419c99d66fb2823173d73f188ce601"},
|
||||
{file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:fa88b843d6e211393a37219e6a1c1df99d35e8fd90446f1118f4216e307e48cd"},
|
||||
{file = "charset_normalizer-3.4.1-cp313-cp313-win32.whl", hash = "sha256:eb8178fe3dba6450a3e024e95ac49ed3400e506fd4e9e5c32d30adda88cbd407"},
|
||||
{file = "charset_normalizer-3.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:b1ac5992a838106edb89654e0aebfc24f5848ae2547d22c2c3f66454daa11971"},
|
||||
{file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f30bf9fd9be89ecb2360c7d94a711f00c09b976258846efe40db3d05828e8089"},
|
||||
{file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:97f68b8d6831127e4787ad15e6757232e14e12060bec17091b85eb1486b91d8d"},
|
||||
{file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7974a0b5ecd505609e3b19742b60cee7aa2aa2fb3151bc917e6e2646d7667dcf"},
|
||||
{file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc54db6c8593ef7d4b2a331b58653356cf04f67c960f584edb7c3d8c97e8f39e"},
|
||||
{file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:311f30128d7d333eebd7896965bfcfbd0065f1716ec92bd5638d7748eb6f936a"},
|
||||
{file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:7d053096f67cd1241601111b698f5cad775f97ab25d81567d3f59219b5f1adbd"},
|
||||
{file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:807f52c1f798eef6cf26beb819eeb8819b1622ddfeef9d0977a8502d4db6d534"},
|
||||
{file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:dccbe65bd2f7f7ec22c4ff99ed56faa1e9f785482b9bbd7c717e26fd723a1d1e"},
|
||||
{file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:2fb9bd477fdea8684f78791a6de97a953c51831ee2981f8e4f583ff3b9d9687e"},
|
||||
{file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:01732659ba9b5b873fc117534143e4feefecf3b2078b0a6a2e925271bb6f4cfa"},
|
||||
{file = "charset_normalizer-3.4.1-cp37-cp37m-win32.whl", hash = "sha256:7a4f97a081603d2050bfaffdefa5b02a9ec823f8348a572e39032caa8404a487"},
|
||||
{file = "charset_normalizer-3.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:7b1bef6280950ee6c177b326508f86cad7ad4dff12454483b51d8b7d673a2c5d"},
|
||||
{file = "charset_normalizer-3.4.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ecddf25bee22fe4fe3737a399d0d177d72bc22be6913acfab364b40bce1ba83c"},
|
||||
{file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c60ca7339acd497a55b0ea5d506b2a2612afb2826560416f6894e8b5770d4a9"},
|
||||
{file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b7b2d86dd06bfc2ade3312a83a5c364c7ec2e3498f8734282c6c3d4b07b346b8"},
|
||||
{file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dd78cfcda14a1ef52584dbb008f7ac81c1328c0f58184bf9a84c49c605002da6"},
|
||||
{file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e27f48bcd0957c6d4cb9d6fa6b61d192d0b13d5ef563e5f2ae35feafc0d179c"},
|
||||
{file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:01ad647cdd609225c5350561d084b42ddf732f4eeefe6e678765636791e78b9a"},
|
||||
{file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:619a609aa74ae43d90ed2e89bdd784765de0a25ca761b93e196d938b8fd1dbbd"},
|
||||
{file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:89149166622f4db9b4b6a449256291dc87a99ee53151c74cbd82a53c8c2f6ccd"},
|
||||
{file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:7709f51f5f7c853f0fb938bcd3bc59cdfdc5203635ffd18bf354f6967ea0f824"},
|
||||
{file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:345b0426edd4e18138d6528aed636de7a9ed169b4aaf9d61a8c19e39d26838ca"},
|
||||
{file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0907f11d019260cdc3f94fbdb23ff9125f6b5d1039b76003b5b0ac9d6a6c9d5b"},
|
||||
{file = "charset_normalizer-3.4.1-cp38-cp38-win32.whl", hash = "sha256:ea0d8d539afa5eb2728aa1932a988a9a7af94f18582ffae4bc10b3fbdad0626e"},
|
||||
{file = "charset_normalizer-3.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:329ce159e82018d646c7ac45b01a430369d526569ec08516081727a20e9e4af4"},
|
||||
{file = "charset_normalizer-3.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b97e690a2118911e39b4042088092771b4ae3fc3aa86518f84b8cf6888dbdb41"},
|
||||
{file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:78baa6d91634dfb69ec52a463534bc0df05dbd546209b79a3880a34487f4b84f"},
|
||||
{file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1a2bc9f351a75ef49d664206d51f8e5ede9da246602dc2d2726837620ea034b2"},
|
||||
{file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75832c08354f595c760a804588b9357d34ec00ba1c940c15e31e96d902093770"},
|
||||
{file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0af291f4fe114be0280cdd29d533696a77b5b49cfde5467176ecab32353395c4"},
|
||||
{file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0167ddc8ab6508fe81860a57dd472b2ef4060e8d378f0cc555707126830f2537"},
|
||||
{file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2a75d49014d118e4198bcee5ee0a6f25856b29b12dbf7cd012791f8a6cc5c496"},
|
||||
{file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:363e2f92b0f0174b2f8238240a1a30142e3db7b957a5dd5689b0e75fb717cc78"},
|
||||
{file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:ab36c8eb7e454e34e60eb55ca5d241a5d18b2c6244f6827a30e451c42410b5f7"},
|
||||
{file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:4c0907b1928a36d5a998d72d64d8eaa7244989f7aaaf947500d3a800c83a3fd6"},
|
||||
{file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:04432ad9479fa40ec0f387795ddad4437a2b50417c69fa275e212933519ff294"},
|
||||
{file = "charset_normalizer-3.4.1-cp39-cp39-win32.whl", hash = "sha256:3bed14e9c89dcb10e8f3a29f9ccac4955aebe93c71ae803af79265c9ca5644c5"},
|
||||
{file = "charset_normalizer-3.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:49402233c892a461407c512a19435d1ce275543138294f7ef013f0b63d5d3765"},
|
||||
{file = "charset_normalizer-3.4.1-py3-none-any.whl", hash = "sha256:d98b1668f06378c6dbefec3b92299716b931cd4e6061f3c875a71ced1780ab85"},
|
||||
{file = "charset_normalizer-3.4.1.tar.gz", hash = "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "click"
|
||||
version = "8.1.8"
|
||||
description = "Composable command line interface toolkit"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2"},
|
||||
{file = "click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
colorama = {version = "*", markers = "platform_system == \"Windows\""}
|
||||
|
||||
[[package]]
|
||||
name = "colorama"
|
||||
version = "0.4.6"
|
||||
description = "Cross-platform colored terminal text."
|
||||
optional = false
|
||||
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
|
||||
groups = ["main"]
|
||||
groups = ["main", "dev"]
|
||||
files = [
|
||||
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
|
||||
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
|
||||
@ -60,7 +236,7 @@ version = "4.2.19"
|
||||
description = "A high-level Python web framework that encourages rapid development and clean, pragmatic design."
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main", "dev"]
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "Django-4.2.19-py3-none-any.whl", hash = "sha256:a104e13f219fc55996a4e416ef7d18ab4eeb44e0aa95174c192f16cda9f94e75"},
|
||||
{file = "Django-4.2.19.tar.gz", hash = "sha256:6c833be4b0ca614f0a919472a1028a3bbdeb6f056fa04023aeb923346ba2c306"},
|
||||
@ -75,78 +251,6 @@ tzdata = {version = "*", markers = "sys_platform == \"win32\""}
|
||||
argon2 = ["argon2-cffi (>=19.1.0)"]
|
||||
bcrypt = ["bcrypt"]
|
||||
|
||||
[[package]]
|
||||
name = "django-debug-toolbar"
|
||||
version = "5.2.0"
|
||||
description = "A configurable set of panels that display various debug information about the current request/response."
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "django_debug_toolbar-5.2.0-py3-none-any.whl", hash = "sha256:15627f4c2836a9099d795e271e38e8cf5204ccd79d5dbcd748f8a6c284dcd195"},
|
||||
{file = "django_debug_toolbar-5.2.0.tar.gz", hash = "sha256:9e7f0145e1a1b7d78fcc3b53798686170a5b472d9cf085d88121ff823e900821"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
django = ">=4.2.9"
|
||||
sqlparse = ">=0.2"
|
||||
|
||||
[[package]]
|
||||
name = "django-stubs"
|
||||
version = "5.1.3"
|
||||
description = "Mypy stubs for Django"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "django_stubs-5.1.3-py3-none-any.whl", hash = "sha256:716758ced158b439213062e52de6df3cff7c586f9f9ad7ab59210efbea5dfe78"},
|
||||
{file = "django_stubs-5.1.3.tar.gz", hash = "sha256:8c230bc5bebee6da282ba8a27ad1503c84a0c4cd2f46e63d149e76d2a63e639a"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
asgiref = "*"
|
||||
django = "*"
|
||||
django-stubs-ext = ">=5.1.3"
|
||||
tomli = {version = "*", markers = "python_version < \"3.11\""}
|
||||
types-PyYAML = "*"
|
||||
typing-extensions = ">=4.11.0"
|
||||
|
||||
[package.extras]
|
||||
compatible-mypy = ["mypy (>=1.12,<1.16)"]
|
||||
oracle = ["oracledb"]
|
||||
redis = ["redis"]
|
||||
|
||||
[[package]]
|
||||
name = "django-stubs-ext"
|
||||
version = "5.1.3"
|
||||
description = "Monkey-patching and extensions for django-stubs"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "django_stubs_ext-5.1.3-py3-none-any.whl", hash = "sha256:64561fbc53e963cc1eed2c8eb27e18b8e48dcb90771205180fe29fc8a59e55fd"},
|
||||
{file = "django_stubs_ext-5.1.3.tar.gz", hash = "sha256:3e60f82337f0d40a362f349bf15539144b96e4ceb4dbd0239be1cd71f6a74ad0"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
django = "*"
|
||||
typing-extensions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "django-upgrade"
|
||||
version = "1.24.0"
|
||||
description = "Automatically upgrade your Django project code."
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "django_upgrade-1.24.0-py3-none-any.whl", hash = "sha256:198572f31130cd80b4f30c568aa331351176cccf1455741e45ebca272812271d"},
|
||||
{file = "django_upgrade-1.24.0.tar.gz", hash = "sha256:d761d517f87338291ac73890e15b09775532c5cea8cf794f56ad159da9d63d9b"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
tokenize-rt = ">=4.1"
|
||||
|
||||
[[package]]
|
||||
name = "filelock"
|
||||
version = "3.17.0"
|
||||
@ -165,22 +269,21 @@ testing = ["covdefaults (>=2.3)", "coverage (>=7.6.10)", "diff-cover (>=9.2.1)",
|
||||
typing = ["typing-extensions (>=4.12.2) ; python_version < \"3.11\""]
|
||||
|
||||
[[package]]
|
||||
name = "GDAL"
|
||||
version = "3.6.2"
|
||||
description = "GDAL: Geospatial Data Abstraction Library"
|
||||
name = "flake8"
|
||||
version = "7.1.2"
|
||||
description = "the modular source code checker: pep8 pyflakes and co"
|
||||
optional = false
|
||||
python-versions = ">=3.6.0"
|
||||
python-versions = ">=3.8.1"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "GDAL-3.6.2-cp310-cp310-win_amd64.whl", hash = "sha256:a51f9ee183b9d4b2978ea266e2b85ca4ee50bc6f15a91f56779edd16929e4cff"},
|
||||
{file = "flake8-7.1.2-py2.py3-none-any.whl", hash = "sha256:1cbc62e65536f65e6d754dfe6f1bada7f5cf392d6f5db3c2b85892466c3e7c1a"},
|
||||
{file = "flake8-7.1.2.tar.gz", hash = "sha256:c586ffd0b41540951ae41af572e6790dbd49fc12b3aa2541685d253d9bd504bd"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
numpy = ["numpy (>1.0.0)"]
|
||||
|
||||
[package.source]
|
||||
type = "file"
|
||||
url = "gdal/GDAL-3.6.2-cp310-cp310-win_amd64.whl"
|
||||
[package.dependencies]
|
||||
mccabe = ">=0.7.0,<0.8.0"
|
||||
pycodestyle = ">=2.12.0,<2.13.0"
|
||||
pyflakes = ">=3.2.0,<3.3.0"
|
||||
|
||||
[[package]]
|
||||
name = "gunicorn"
|
||||
@ -219,6 +322,65 @@ files = [
|
||||
[package.extras]
|
||||
license = ["ukkonen"]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "3.10"
|
||||
description = "Internationalized Domain Names in Applications (IDNA)"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"},
|
||||
{file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"]
|
||||
|
||||
[[package]]
|
||||
name = "isort"
|
||||
version = "6.0.1"
|
||||
description = "A Python utility / library to sort Python imports."
|
||||
optional = false
|
||||
python-versions = ">=3.9.0"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "isort-6.0.1-py3-none-any.whl", hash = "sha256:2dc5d7f65c9678d94c88dfc29161a320eec67328bc97aad576874cb4be1e9615"},
|
||||
{file = "isort-6.0.1.tar.gz", hash = "sha256:1cb5df28dfbc742e490c5e41bad6da41b805b0a8be7bc93cd0fb2a8a890ac450"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
colors = ["colorama"]
|
||||
plugins = ["setuptools"]
|
||||
|
||||
[[package]]
|
||||
name = "markdown"
|
||||
version = "3.7"
|
||||
description = "Python implementation of John Gruber's Markdown."
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "Markdown-3.7-py3-none-any.whl", hash = "sha256:7eb6df5690b81a1d7942992c97fad2938e956e79df20cbc6186e9c3a77b1c803"},
|
||||
{file = "markdown-3.7.tar.gz", hash = "sha256:2ae2471477cfd02dbbf038d5d9bc226d40def84b4fe2986e49b59b6b472bbed2"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
docs = ["mdx-gh-links (>=0.2)", "mkdocs (>=1.5)", "mkdocs-gen-files", "mkdocs-literate-nav", "mkdocs-nature (>=0.6)", "mkdocs-section-index", "mkdocstrings[python]"]
|
||||
testing = ["coverage", "pyyaml"]
|
||||
|
||||
[[package]]
|
||||
name = "mccabe"
|
||||
version = "0.7.0"
|
||||
description = "McCabe checker, plugin for flake8"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"},
|
||||
{file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mypy"
|
||||
version = "1.15.0"
|
||||
@ -297,64 +459,30 @@ files = [
|
||||
{file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "numpy"
|
||||
version = "1.26.4"
|
||||
description = "Fundamental package for array computing in Python"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "numpy-1.26.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9ff0f4f29c51e2803569d7a51c2304de5554655a60c5d776e35b4a41413830d0"},
|
||||
{file = "numpy-1.26.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2e4ee3380d6de9c9ec04745830fd9e2eccb3e6cf790d39d7b98ffd19b0dd754a"},
|
||||
{file = "numpy-1.26.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d209d8969599b27ad20994c8e41936ee0964e6da07478d6c35016bc386b66ad4"},
|
||||
{file = "numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ffa75af20b44f8dba823498024771d5ac50620e6915abac414251bd971b4529f"},
|
||||
{file = "numpy-1.26.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:62b8e4b1e28009ef2846b4c7852046736bab361f7aeadeb6a5b89ebec3c7055a"},
|
||||
{file = "numpy-1.26.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a4abb4f9001ad2858e7ac189089c42178fcce737e4169dc61321660f1a96c7d2"},
|
||||
{file = "numpy-1.26.4-cp310-cp310-win32.whl", hash = "sha256:bfe25acf8b437eb2a8b2d49d443800a5f18508cd811fea3181723922a8a82b07"},
|
||||
{file = "numpy-1.26.4-cp310-cp310-win_amd64.whl", hash = "sha256:b97fe8060236edf3662adfc2c633f56a08ae30560c56310562cb4f95500022d5"},
|
||||
{file = "numpy-1.26.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4c66707fabe114439db9068ee468c26bbdf909cac0fb58686a42a24de1760c71"},
|
||||
{file = "numpy-1.26.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:edd8b5fe47dab091176d21bb6de568acdd906d1887a4584a15a9a96a1dca06ef"},
|
||||
{file = "numpy-1.26.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ab55401287bfec946ced39700c053796e7cc0e3acbef09993a9ad2adba6ca6e"},
|
||||
{file = "numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:666dbfb6ec68962c033a450943ded891bed2d54e6755e35e5835d63f4f6931d5"},
|
||||
{file = "numpy-1.26.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:96ff0b2ad353d8f990b63294c8986f1ec3cb19d749234014f4e7eb0112ceba5a"},
|
||||
{file = "numpy-1.26.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:60dedbb91afcbfdc9bc0b1f3f402804070deed7392c23eb7a7f07fa857868e8a"},
|
||||
{file = "numpy-1.26.4-cp311-cp311-win32.whl", hash = "sha256:1af303d6b2210eb850fcf03064d364652b7120803a0b872f5211f5234b399f20"},
|
||||
{file = "numpy-1.26.4-cp311-cp311-win_amd64.whl", hash = "sha256:cd25bcecc4974d09257ffcd1f098ee778f7834c3ad767fe5db785be9a4aa9cb2"},
|
||||
{file = "numpy-1.26.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b3ce300f3644fb06443ee2222c2201dd3a89ea6040541412b8fa189341847218"},
|
||||
{file = "numpy-1.26.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:03a8c78d01d9781b28a6989f6fa1bb2c4f2d51201cf99d3dd875df6fbd96b23b"},
|
||||
{file = "numpy-1.26.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9fad7dcb1aac3c7f0584a5a8133e3a43eeb2fe127f47e3632d43d677c66c102b"},
|
||||
{file = "numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:675d61ffbfa78604709862923189bad94014bef562cc35cf61d3a07bba02a7ed"},
|
||||
{file = "numpy-1.26.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ab47dbe5cc8210f55aa58e4805fe224dac469cde56b9f731a4c098b91917159a"},
|
||||
{file = "numpy-1.26.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:1dda2e7b4ec9dd512f84935c5f126c8bd8b9f2fc001e9f54af255e8c5f16b0e0"},
|
||||
{file = "numpy-1.26.4-cp312-cp312-win32.whl", hash = "sha256:50193e430acfc1346175fcbdaa28ffec49947a06918b7b92130744e81e640110"},
|
||||
{file = "numpy-1.26.4-cp312-cp312-win_amd64.whl", hash = "sha256:08beddf13648eb95f8d867350f6a018a4be2e5ad54c8d8caed89ebca558b2818"},
|
||||
{file = "numpy-1.26.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7349ab0fa0c429c82442a27a9673fc802ffdb7c7775fad780226cb234965e53c"},
|
||||
{file = "numpy-1.26.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:52b8b60467cd7dd1e9ed082188b4e6bb35aa5cdd01777621a1658910745b90be"},
|
||||
{file = "numpy-1.26.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d5241e0a80d808d70546c697135da2c613f30e28251ff8307eb72ba696945764"},
|
||||
{file = "numpy-1.26.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f870204a840a60da0b12273ef34f7051e98c3b5961b61b0c2c1be6dfd64fbcd3"},
|
||||
{file = "numpy-1.26.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:679b0076f67ecc0138fd2ede3a8fd196dddc2ad3254069bcb9faf9a79b1cebcd"},
|
||||
{file = "numpy-1.26.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:47711010ad8555514b434df65f7d7b076bb8261df1ca9bb78f53d3b2db02e95c"},
|
||||
{file = "numpy-1.26.4-cp39-cp39-win32.whl", hash = "sha256:a354325ee03388678242a4d7ebcd08b5c727033fcff3b2f536aea978e15ee9e6"},
|
||||
{file = "numpy-1.26.4-cp39-cp39-win_amd64.whl", hash = "sha256:3373d5d70a5fe74a2c1bb6d2cfd9609ecf686d47a2d7b1d37a8f3b6bf6003aea"},
|
||||
{file = "numpy-1.26.4-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:afedb719a9dcfc7eaf2287b839d8198e06dcd4cb5d276a3df279231138e83d30"},
|
||||
{file = "numpy-1.26.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95a7476c59002f2f6c590b9b7b998306fba6a5aa646b1e22ddfeaf8f78c3a29c"},
|
||||
{file = "numpy-1.26.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7e50d0a0cc3189f9cb0aeb3a6a6af18c16f59f004b866cd2be1c14b36134a4a0"},
|
||||
{file = "numpy-1.26.4.tar.gz", hash = "sha256:2a02aba9ed12e4ac4eb3ea9421c420301a0c6460d9830d74a9df87efa4912010"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "packaging"
|
||||
version = "24.2"
|
||||
description = "Core utilities for Python packages"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main"]
|
||||
groups = ["main", "dev"]
|
||||
files = [
|
||||
{file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"},
|
||||
{file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pathspec"
|
||||
version = "0.12.1"
|
||||
description = "Utility library for gitignore style pattern matching of file paths."
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"},
|
||||
{file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "platformdirs"
|
||||
version = "4.3.6"
|
||||
@ -391,27 +519,6 @@ nodeenv = ">=0.11.1"
|
||||
pyyaml = ">=5.1"
|
||||
virtualenv = ">=20.10.0"
|
||||
|
||||
[[package]]
|
||||
name = "protobuf"
|
||||
version = "5.29.4"
|
||||
description = ""
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "protobuf-5.29.4-cp310-abi3-win32.whl", hash = "sha256:13eb236f8eb9ec34e63fc8b1d6efd2777d062fa6aaa68268fb67cf77f6839ad7"},
|
||||
{file = "protobuf-5.29.4-cp310-abi3-win_amd64.whl", hash = "sha256:bcefcdf3976233f8a502d265eb65ea740c989bacc6c30a58290ed0e519eb4b8d"},
|
||||
{file = "protobuf-5.29.4-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:307ecba1d852ec237e9ba668e087326a67564ef83e45a0189a772ede9e854dd0"},
|
||||
{file = "protobuf-5.29.4-cp38-abi3-manylinux2014_aarch64.whl", hash = "sha256:aec4962f9ea93c431d5714ed1be1c93f13e1a8618e70035ba2b0564d9e633f2e"},
|
||||
{file = "protobuf-5.29.4-cp38-abi3-manylinux2014_x86_64.whl", hash = "sha256:d7d3f7d1d5a66ed4942d4fefb12ac4b14a29028b209d4bfb25c68ae172059922"},
|
||||
{file = "protobuf-5.29.4-cp38-cp38-win32.whl", hash = "sha256:1832f0515b62d12d8e6ffc078d7e9eb06969aa6dc13c13e1036e39d73bebc2de"},
|
||||
{file = "protobuf-5.29.4-cp38-cp38-win_amd64.whl", hash = "sha256:476cb7b14914c780605a8cf62e38c2a85f8caff2e28a6a0bad827ec7d6c85d68"},
|
||||
{file = "protobuf-5.29.4-cp39-cp39-win32.whl", hash = "sha256:fd32223020cb25a2cc100366f1dedc904e2d71d9322403224cdde5fdced0dabe"},
|
||||
{file = "protobuf-5.29.4-cp39-cp39-win_amd64.whl", hash = "sha256:678974e1e3a9b975b8bc2447fca458db5f93a2fb6b0c8db46b6675b5b5346812"},
|
||||
{file = "protobuf-5.29.4-py3-none-any.whl", hash = "sha256:3fde11b505e1597f71b875ef2fc52062b6a9740e5f7c8997ce878b6009145862"},
|
||||
{file = "protobuf-5.29.4.tar.gz", hash = "sha256:4f1dfcd7997b31ef8f53ec82781ff434a28bf71d9102ddde14d076adcfc78c99"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "psycopg2-binary"
|
||||
version = "2.9.10"
|
||||
@ -491,19 +598,28 @@ files = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "python-dotenv"
|
||||
version = "1.0.1"
|
||||
description = "Read key-value pairs from a .env file and set them as environment variables"
|
||||
name = "pycodestyle"
|
||||
version = "2.12.1"
|
||||
description = "Python style guide checker"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main"]
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca"},
|
||||
{file = "python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a"},
|
||||
{file = "pycodestyle-2.12.1-py2.py3-none-any.whl", hash = "sha256:46f0fb92069a7c28ab7bb558f05bfc0110dac69a0cd23c61ea0040283a9d78b3"},
|
||||
{file = "pycodestyle-2.12.1.tar.gz", hash = "sha256:6838eae08bbce4f6accd5d5572075c63626a15ee3e6f842df996bf62f6d73521"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
cli = ["click (>=5.0)"]
|
||||
[[package]]
|
||||
name = "pyflakes"
|
||||
version = "3.2.0"
|
||||
description = "passive checker of Python programs"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"},
|
||||
{file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyyaml"
|
||||
@ -569,33 +685,27 @@ files = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ruff"
|
||||
version = "0.12.2"
|
||||
description = "An extremely fast Python linter and code formatter, written in Rust."
|
||||
name = "requests"
|
||||
version = "2.32.3"
|
||||
description = "Python HTTP for Humans."
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
groups = ["dev"]
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "ruff-0.12.2-py3-none-linux_armv6l.whl", hash = "sha256:093ea2b221df1d2b8e7ad92fc6ffdca40a2cb10d8564477a987b44fd4008a7be"},
|
||||
{file = "ruff-0.12.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:09e4cf27cc10f96b1708100fa851e0daf21767e9709e1649175355280e0d950e"},
|
||||
{file = "ruff-0.12.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:8ae64755b22f4ff85e9c52d1f82644abd0b6b6b6deedceb74bd71f35c24044cc"},
|
||||
{file = "ruff-0.12.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3eb3a6b2db4d6e2c77e682f0b988d4d61aff06860158fdb413118ca133d57922"},
|
||||
{file = "ruff-0.12.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:73448de992d05517170fc37169cbca857dfeaeaa8c2b9be494d7bcb0d36c8f4b"},
|
||||
{file = "ruff-0.12.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3b8b94317cbc2ae4a2771af641739f933934b03555e51515e6e021c64441532d"},
|
||||
{file = "ruff-0.12.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:45fc42c3bf1d30d2008023a0a9a0cfb06bf9835b147f11fe0679f21ae86d34b1"},
|
||||
{file = "ruff-0.12.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce48f675c394c37e958bf229fb5c1e843e20945a6d962cf3ea20b7a107dcd9f4"},
|
||||
{file = "ruff-0.12.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:793d8859445ea47591272021a81391350205a4af65a9392401f418a95dfb75c9"},
|
||||
{file = "ruff-0.12.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6932323db80484dda89153da3d8e58164d01d6da86857c79f1961934354992da"},
|
||||
{file = "ruff-0.12.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:6aa7e623a3a11538108f61e859ebf016c4f14a7e6e4eba1980190cacb57714ce"},
|
||||
{file = "ruff-0.12.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:2a4a20aeed74671b2def096bdf2eac610c7d8ffcbf4fb0e627c06947a1d7078d"},
|
||||
{file = "ruff-0.12.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:71a4c550195612f486c9d1f2b045a600aeba851b298c667807ae933478fcef04"},
|
||||
{file = "ruff-0.12.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:4987b8f4ceadf597c927beee65a5eaf994c6e2b631df963f86d8ad1bdea99342"},
|
||||
{file = "ruff-0.12.2-py3-none-win32.whl", hash = "sha256:369ffb69b70cd55b6c3fc453b9492d98aed98062db9fec828cdfd069555f5f1a"},
|
||||
{file = "ruff-0.12.2-py3-none-win_amd64.whl", hash = "sha256:dca8a3b6d6dc9810ed8f328d406516bf4d660c00caeaef36eb831cf4871b0639"},
|
||||
{file = "ruff-0.12.2-py3-none-win_arm64.whl", hash = "sha256:48d6c6bfb4761df68bc05ae630e24f506755e702d4fb08f08460be778c7ccb12"},
|
||||
{file = "ruff-0.12.2.tar.gz", hash = "sha256:d7b4f55cd6f325cb7621244f19c873c565a08aff5a4ba9c69aa7355f3f7afd3e"},
|
||||
{file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"},
|
||||
{file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
certifi = ">=2017.4.17"
|
||||
charset-normalizer = ">=2,<4"
|
||||
idna = ">=2.5,<4"
|
||||
urllib3 = ">=1.21.1,<3"
|
||||
|
||||
[package.extras]
|
||||
socks = ["PySocks (>=1.5.6,!=1.5.7)"]
|
||||
use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]
|
||||
|
||||
[[package]]
|
||||
name = "setuptools"
|
||||
version = "75.8.2"
|
||||
@ -623,7 +733,7 @@ version = "0.5.3"
|
||||
description = "A non-validating SQL parser."
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main", "dev"]
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "sqlparse-0.5.3-py3-none-any.whl", hash = "sha256:cf2196ed3418f3ba5de6af7e82c694a9fbdbfecccdfc72e281548517081f16ca"},
|
||||
{file = "sqlparse-0.5.3.tar.gz", hash = "sha256:09f67787f56a0b16ecdbde1bfc7f5d9c3371ca683cfeaa8e6ff60b4807ec9272"},
|
||||
@ -633,18 +743,6 @@ files = [
|
||||
dev = ["build", "hatch"]
|
||||
doc = ["sphinx"]
|
||||
|
||||
[[package]]
|
||||
name = "tokenize-rt"
|
||||
version = "6.1.0"
|
||||
description = "A wrapper around the stdlib `tokenize` which roundtrips."
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "tokenize_rt-6.1.0-py2.py3-none-any.whl", hash = "sha256:d706141cdec4aa5f358945abe36b911b8cbdc844545da99e811250c0cee9b6fc"},
|
||||
{file = "tokenize_rt-6.1.0.tar.gz", hash = "sha256:e8ee836616c0877ab7c7b54776d2fefcc3bde714449a206762425ae114b53c86"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tomli"
|
||||
version = "2.2.1"
|
||||
@ -688,17 +786,20 @@ files = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "types-pyyaml"
|
||||
version = "6.0.12.20250402"
|
||||
description = "Typing stubs for PyYAML"
|
||||
name = "types-requests"
|
||||
version = "2.32.0.20250306"
|
||||
description = "Typing stubs for requests"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["dev"]
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "types_pyyaml-6.0.12.20250402-py3-none-any.whl", hash = "sha256:652348fa9e7a203d4b0d21066dfb00760d3cbd5a15ebb7cf8d33c88a49546681"},
|
||||
{file = "types_pyyaml-6.0.12.20250402.tar.gz", hash = "sha256:d7c13c3e6d335b6af4b0122a01ff1d270aba84ab96d1a1a1063ecba3e13ec075"},
|
||||
{file = "types_requests-2.32.0.20250306-py3-none-any.whl", hash = "sha256:25f2cbb5c8710b2022f8bbee7b2b66f319ef14aeea2f35d80f18c9dbf3b60a0b"},
|
||||
{file = "types_requests-2.32.0.20250306.tar.gz", hash = "sha256:0962352694ec5b2f95fda877ee60a159abdf84a0fc6fdace599f20acb41a03d1"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
urllib3 = ">=2"
|
||||
|
||||
[[package]]
|
||||
name = "typing-extensions"
|
||||
version = "4.12.2"
|
||||
@ -714,17 +815,55 @@ markers = {main = "python_version < \"3.11\""}
|
||||
|
||||
[[package]]
|
||||
name = "tzdata"
|
||||
version = "2025.2"
|
||||
version = "2025.1"
|
||||
description = "Provider of IANA time zone data"
|
||||
optional = false
|
||||
python-versions = ">=2"
|
||||
groups = ["main", "dev"]
|
||||
groups = ["main"]
|
||||
markers = "sys_platform == \"win32\""
|
||||
files = [
|
||||
{file = "tzdata-2025.2-py2.py3-none-any.whl", hash = "sha256:1a403fada01ff9221ca8044d701868fa132215d84beb92242d9acd2147f667a8"},
|
||||
{file = "tzdata-2025.2.tar.gz", hash = "sha256:b60a638fcc0daffadf82fe0f57e53d06bdec2f36c4df66280ae79bce6bd6f2b9"},
|
||||
{file = "tzdata-2025.1-py2.py3-none-any.whl", hash = "sha256:7e127113816800496f027041c570f50bcd464a020098a3b6b199517772303639"},
|
||||
{file = "tzdata-2025.1.tar.gz", hash = "sha256:24894909e88cdb28bd1636c6887801df64cb485bd593f2fd83ef29075a81d694"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "urllib3"
|
||||
version = "2.3.0"
|
||||
description = "HTTP library with thread-safe connection pooling, file post, and more."
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df"},
|
||||
{file = "urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""]
|
||||
h2 = ["h2 (>=4,<5)"]
|
||||
socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]
|
||||
zstd = ["zstandard (>=0.18.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "versioning"
|
||||
version = "0.1.0"
|
||||
description = ""
|
||||
optional = false
|
||||
python-versions = "^3.10"
|
||||
groups = ["main"]
|
||||
files = []
|
||||
develop = false
|
||||
|
||||
[package.dependencies]
|
||||
django = "^4.2"
|
||||
markdown = "^3.7"
|
||||
|
||||
[package.source]
|
||||
type = "git"
|
||||
url = "https://git.cybercode.pro/zakhy/versioning.git"
|
||||
reference = "django-4.2"
|
||||
resolved_reference = "2c18550dbe269c159d7ab5f200170ccff9758861"
|
||||
|
||||
[[package]]
|
||||
name = "virtualenv"
|
||||
version = "20.29.2"
|
||||
@ -749,4 +888,4 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess
|
||||
[metadata]
|
||||
lock-version = "2.1"
|
||||
python-versions = "^3.10"
|
||||
content-hash = "f887456108abf263963670c1cd06beb9dbc6d740627d45651b7b58711ecc0796"
|
||||
content-hash = "ae43f1c5f66740a1a900bc991c7d7e67264cf0c4d09309427585e94ff2853cae"
|
||||
18
app/project/settings/__init__.py
Normal file
18
app/project/settings/__init__.py
Normal file
@ -0,0 +1,18 @@
|
||||
"""Модуль формирования окружения и загрузки настроек."""
|
||||
|
||||
from project.settings.app_info import * # noqa: F403
|
||||
from project.settings.base import * # noqa: F403
|
||||
import os
|
||||
|
||||
PROJECT_ENV = os.environ.get("PROJECT_ENV", "local")
|
||||
|
||||
# Вызывается при импорте модуля settings
|
||||
|
||||
if PROJECT_ENV == "local":
|
||||
from project.settings.local import * # noqa: F403
|
||||
|
||||
print("Загружены локальные настройки")
|
||||
elif PROJECT_ENV == "production":
|
||||
from project.settings.production import * # noqa: F403
|
||||
|
||||
print("Загружены боевые настройки")
|
||||
@ -6,21 +6,13 @@ INSTALLED_APPS = [
|
||||
"django.contrib.sessions",
|
||||
"django.contrib.messages",
|
||||
"django.contrib.staticfiles",
|
||||
"django.contrib.gis",
|
||||
"apps.main.apps.MainConfig", # Главное
|
||||
"apps.workers.apps.WorkersConfig", # Сотрудники
|
||||
"apps.street_pos.apps.StreetPosConfig", # Позиционирование улица
|
||||
"apps.eps.apps.EpsConfig", # Позиционирование 3д
|
||||
"apps.settings.apps.SettingsConfig", # Настройки в БД
|
||||
"apps.management.apps.ManagementConfig", # Админка для пользователя
|
||||
"apps.internal_pos.apps.InternalPosConfig", # 3Д позиционирование
|
||||
"debug_toolbar",
|
||||
"apps.cam.apps.CamConfig",
|
||||
]
|
||||
|
||||
# Информация о приложении
|
||||
SITE_TITLE = "МФСБ | Позиционирование"
|
||||
SITE_TITLE_S = "МФСБ | Позиционирование"
|
||||
APP_VERSION = "1.0.00.1"
|
||||
APP_VERSION = "0.0.0.1"
|
||||
APP_VEK = "2023 - 2025гг"
|
||||
APP_COPPIRIGHT = "МФСБ | Позиционирование"
|
||||
|
||||
@ -6,10 +6,8 @@ BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
||||
|
||||
ALLOWED_HOSTS = ["*"]
|
||||
|
||||
INTERNAL_IPS = ["127.0.0.1", "192.168.0.157"]
|
||||
|
||||
MIDDLEWARE = [
|
||||
"debug_toolbar.middleware.DebugToolbarMiddleware",
|
||||
"django.middleware.security.SecurityMiddleware",
|
||||
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||
"django.middleware.common.CommonMiddleware",
|
||||
@ -24,7 +22,7 @@ ROOT_URLCONF = "project.urls"
|
||||
TEMPLATES = [
|
||||
{
|
||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||
"DIRS": [BASE_DIR / "templates"],
|
||||
"DIRS": [],
|
||||
"APP_DIRS": True,
|
||||
"OPTIONS": {
|
||||
"context_processors": [
|
||||
@ -41,7 +39,7 @@ WSGI_APPLICATION = "project.wsgi.application"
|
||||
|
||||
AUTH_PASSWORD_VALIDATORS = [
|
||||
{
|
||||
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", # noqa: E501
|
||||
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
||||
},
|
||||
{
|
||||
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
||||
@ -56,13 +54,15 @@ AUTH_PASSWORD_VALIDATORS = [
|
||||
|
||||
LANGUAGE_CODE = "ru"
|
||||
|
||||
USE_TZ = True
|
||||
USE_I18N = True
|
||||
|
||||
TIME_ZONE = os.environ.get("TZ", "Asia/Krasnoyarsk")
|
||||
TIME_ZONE = os.environ.get("TZ", "UTC")
|
||||
TIME_ZONE_OBJECT = zoneinfo.ZoneInfo(TIME_ZONE)
|
||||
|
||||
STATIC_URL = "/static/"
|
||||
USE_I18N = True
|
||||
|
||||
USE_TZ = True
|
||||
|
||||
STATIC_URL = "static/"
|
||||
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), "static")
|
||||
|
||||
MEDIA_URL = "/media/"
|
||||
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), "media")
|
||||
@ -72,25 +72,5 @@ DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
||||
# Версирование
|
||||
|
||||
VERSION_SETTING_NAME = "APP_VERSION"
|
||||
GET_VERSION_FROM_DB_FUNCTION = "apps.versioning.version.get_version_from_db"
|
||||
ON_UPDATE_FUNCTION = "apps.versioning.version.print_update"
|
||||
|
||||
GDAL_LIBRARY_PATH = os.getenv("GDAL_LIBRARY_PATH")
|
||||
GEOS_LIBRARY_PATH = os.getenv("GEOS_LIBRARY_PATH")
|
||||
|
||||
X_FRAME_OPTIONS = "SAMEORIGIN"
|
||||
|
||||
# Корды для карты
|
||||
|
||||
MAP_CENTER_LAT = float(os.getenv("MAP_CENTER_LAT", "54.034990"))
|
||||
MAP_CENTER_LON = float(os.getenv("MAP_CENTER_LON", "86.643241"))
|
||||
|
||||
# Настройки для деплоя
|
||||
|
||||
SESSION_COOKIE_NAME = "mfss_pos_session"
|
||||
|
||||
CSRF_TRUSTED_ORIGINS = [
|
||||
"http://192.168.10.3:8100",
|
||||
"http://0.0.0.0:8000",
|
||||
"http://localhost:8101",
|
||||
]
|
||||
GET_VERSION_FROM_DB_FUNCTION = "project.versioning.version.get_version_from_db"
|
||||
ON_UPDATE_FUNCTION = "project.versioning.version.print_update"
|
||||
@ -3,7 +3,7 @@ DEBUG = True
|
||||
SECRET_KEY = "django-debug-key"
|
||||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.contrib.gis.db.backends.postgis",
|
||||
"ENGINE": "django.db.backends.postgresql_psycopg2",
|
||||
"HOST": "localhost",
|
||||
"PORT": "5432",
|
||||
"NAME": "mfss-positioning",
|
||||
@ -4,7 +4,7 @@ SECRET_KEY = os.environ.get("SECRET_KEY", "random-secret-key")
|
||||
DEBUG = False
|
||||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.contrib.gis.db.backends.postgis",
|
||||
"ENGINE": "django.db.backends.postgresql_psycopg2",
|
||||
"HOST": os.environ.get("POSTGRES_HOST", ""),
|
||||
"PORT": os.environ.get("POSTGRES_PORT", ""),
|
||||
"NAME": os.environ.get("POSTGRES_DB", ""),
|
||||
9
app/project/urls.py
Normal file
9
app/project/urls.py
Normal file
@ -0,0 +1,9 @@
|
||||
from django.contrib import admin
|
||||
from django.urls import path
|
||||
from versioning.core import Update
|
||||
|
||||
urlpatterns = [
|
||||
path("admin/", admin.site.urls),
|
||||
]
|
||||
|
||||
Update().ready()
|
||||
38
app/project/versioning/version.py
Normal file
38
app/project/versioning/version.py
Normal file
@ -0,0 +1,38 @@
|
||||
# from apps.general.views.settingsmodule import get_settings, set_settings
|
||||
# from apps.util.versions import ver_1_0_11_0
|
||||
# from apps.util.versions.ver_first import install_default_settings
|
||||
|
||||
|
||||
def get_version_from_db(version_name: str) -> str:
|
||||
# res = get_settings(version_name, "")
|
||||
# return res
|
||||
return "1.0.00.0"
|
||||
|
||||
|
||||
def print_update(
|
||||
version_name: str, version_from_file: str, version_from_db: str
|
||||
) -> int:
|
||||
# if version_from_db == "":
|
||||
# install_default_settings()
|
||||
# set_settings(version_name, version_from_file)
|
||||
# return 0
|
||||
#
|
||||
# file_num = int(version_from_file.replace(".", ""))
|
||||
# db_num = int(version_from_db.replace(".", ""))
|
||||
# for version in range(db_num, file_num + 1, 1):
|
||||
# str_version = str(version)
|
||||
# new_version = f"{str_version[0]}.{str_version[1]}.{str_version[2]}{str_version[3]}.{str_version[4]}"
|
||||
#
|
||||
# # Версия 1.0.11.0 Участки для геомеханики
|
||||
# if new_version == "1.0.11.0":
|
||||
# # Вызов модуля при обновлении
|
||||
# ver_1_0_11_0.update()
|
||||
# print(f"Выполнен скрипт для {new_version}")
|
||||
#
|
||||
# print(f"Установлена версия {new_version}")
|
||||
# set_settings(version_name, new_version)
|
||||
|
||||
print(
|
||||
f"version_name: {version_name}, version_from_file: {version_from_file}, version_from_db: {version_from_db}"
|
||||
)
|
||||
return 0
|
||||
@ -12,20 +12,18 @@ django = "^4.2"
|
||||
gunicorn = "^23.0.0"
|
||||
psycopg2-binary = "^2.9.10"
|
||||
colorama = "^0.4.6"
|
||||
python-dotenv = "^1.0.1"
|
||||
protobuf = "^5.29.0"
|
||||
numpy = "^1.26"
|
||||
django-debug-toolbar = "^5.2.0"
|
||||
versioning = { git = "https://git.cybercode.pro/zakhy/versioning.git", branch = "django-4.2" }
|
||||
requests = "^2.32.3"
|
||||
types-requests = "^2.32.0.20250306"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
gdal = { path = "gdal/GDAL-3.6.2-cp310-cp310-win_amd64.whl" }
|
||||
setuptools = "^75.8.2"
|
||||
black = "^25.1.0"
|
||||
flake8 = "^7.1.2"
|
||||
mypy = "^1.15.0"
|
||||
pre-commit = "^4.1.0"
|
||||
isort = "^6.0.1"
|
||||
tomli = "^2.2.1"
|
||||
django-upgrade = "^1.24.0"
|
||||
django-stubs = "^5.1.3"
|
||||
ruff = "^0.12.2"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
@ -1,46 +1,47 @@
|
||||
services:
|
||||
# web:
|
||||
# build: ./app
|
||||
# image: positioning
|
||||
# command: >
|
||||
# sh -c "
|
||||
# python manage.py makemigrations --noinput &&
|
||||
# python manage.py migrate --noinput &&
|
||||
# gunicorn --workers=2 --bind 0.0.0.0:8000 project.wsgi:application
|
||||
# "
|
||||
# ports:
|
||||
# - '8000:8000'
|
||||
# env_file:
|
||||
# - .env
|
||||
## volumes:
|
||||
## - ./app/static:/home/app/web/static/
|
||||
# depends_on:
|
||||
# postgres:
|
||||
# condition: service_healthy
|
||||
version: '3.9'
|
||||
|
||||
# redis:
|
||||
# container_name: redis
|
||||
# image: redis
|
||||
# restart: always
|
||||
# volumes:
|
||||
# - redis_data:/data
|
||||
# ports:
|
||||
# - "6379:6379"
|
||||
# healthcheck:
|
||||
# test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ]
|
||||
# interval: 1s
|
||||
# timeout: 3s
|
||||
# retries: 5
|
||||
services:
|
||||
# web:
|
||||
# build: ./app
|
||||
# image: positioning
|
||||
# command: >
|
||||
# sh -c "
|
||||
# python manage.py makemigrations --noinput &&
|
||||
# python manage.py migrate --noinput &&
|
||||
# gunicorn --workers=2 --bind 0.0.0.0:8000 project.wsgi:application
|
||||
# "
|
||||
# ports:
|
||||
# - '8000:8000'
|
||||
# env_file:
|
||||
# - .env
|
||||
## volumes:
|
||||
## - ./app/static:/home/app/web/static/
|
||||
# depends_on:
|
||||
# postgres:
|
||||
# condition: service_healthy
|
||||
|
||||
# redis:
|
||||
# container_name: redis
|
||||
# image: redis
|
||||
# restart: always
|
||||
# volumes:
|
||||
# - redis_data:/data
|
||||
# ports:
|
||||
# - "6379:6379"
|
||||
# healthcheck:
|
||||
# test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ]
|
||||
# interval: 1s
|
||||
# timeout: 3s
|
||||
# retries: 5
|
||||
|
||||
postgres:
|
||||
image: postgis/postgis:13-3.5
|
||||
image: postgres:15
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data/
|
||||
env_file:
|
||||
- .env
|
||||
ports:
|
||||
# - '5432:5432'
|
||||
- '127.0.0.1:5432:5432'
|
||||
- '5432:5432'
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
|
||||
interval: 10s
|
||||
@ -48,34 +49,6 @@ services:
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
# keycloak-postgres: # Изменяем имя сервиса с postgres на keycloak-postgres
|
||||
# image: postgres
|
||||
# volumes:
|
||||
# - postgres_data:/var/lib/postgresql/data
|
||||
# environment:
|
||||
# POSTGRES_DB: keycloak
|
||||
# POSTGRES_USER: keycloak
|
||||
# POSTGRES_PASSWORD: password
|
||||
#
|
||||
# keycloak:
|
||||
# image: quay.io/keycloak/keycloak:latest
|
||||
# command: start-dev
|
||||
# environment:
|
||||
# KC_DB: postgres
|
||||
# KC_DB_URL: jdbc:postgresql://keycloak-postgres/keycloak # Обновляем URL для подключения к PostgreSQL
|
||||
# KC_DB_USERNAME: keycloak
|
||||
# KC_DB_PASSWORD: password
|
||||
# KC_HTTP_ENABLED: true
|
||||
# KC_HEALTH_ENABLED: true
|
||||
# KEYCLOAK_ADMIN: admin
|
||||
# KEYCLOAK_ADMIN_PASSWORD: admin
|
||||
# ports:
|
||||
# - 8080:8080
|
||||
# restart: always
|
||||
# depends_on:
|
||||
# - keycloak-postgres # Обновляем зависимость
|
||||
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
|
||||
@ -1,59 +1,54 @@
|
||||
version: '3.9'
|
||||
|
||||
services:
|
||||
web:
|
||||
build: ./positioning
|
||||
build: ./app
|
||||
image: positioning
|
||||
command: >
|
||||
sh -c "
|
||||
python manage.py makemigrations --noinput &&
|
||||
python manage.py migrate --noinput &&
|
||||
gunicorn -c project/gunicorn_config.py
|
||||
gunicorn --workers=2 --bind 0.0.0.0:8000 project.wsgi:application
|
||||
"
|
||||
volumes:
|
||||
- media_data:/media
|
||||
- /positioning/logs:/logs
|
||||
expose:
|
||||
- "8000"
|
||||
ports:
|
||||
- '8000:8000'
|
||||
env_file:
|
||||
- .env
|
||||
# volumes:
|
||||
# - ./app/static:/home/app/web/static/
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
restart: always
|
||||
|
||||
# redis:
|
||||
# container_name: redis
|
||||
# image: redis
|
||||
# restart: always
|
||||
# volumes:
|
||||
# - redis_data:/data
|
||||
# ports:
|
||||
# - "6379:6379"
|
||||
# healthcheck:
|
||||
# test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ]
|
||||
# interval: 1s
|
||||
# timeout: 3s
|
||||
# retries: 5
|
||||
|
||||
postgres:
|
||||
image: postgis/postgis:13-3.5
|
||||
image: postgres:15
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data/
|
||||
env_file:
|
||||
- .env
|
||||
ports:
|
||||
- "5443:5432"
|
||||
- '5432:5432'
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
|
||||
interval: 10s
|
||||
timeout: 60s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
restart: always
|
||||
|
||||
nginx:
|
||||
build:
|
||||
context: ./nginx/prod
|
||||
additional_contexts:
|
||||
app_static: ./static
|
||||
args:
|
||||
- UE_STATIC_REPO=${UE_STATIC_REPO}
|
||||
volumes:
|
||||
- media_data:/home/media
|
||||
ports:
|
||||
- "8101:80"
|
||||
depends_on:
|
||||
web:
|
||||
condition: service_started
|
||||
env_file:
|
||||
- .env
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
media_data:
|
||||
|
||||
11
example.env
Normal file
11
example.env
Normal file
@ -0,0 +1,11 @@
|
||||
POSTGRES_PASSWORD=password
|
||||
POSTGRES_USER=user
|
||||
POSTGRES_DB=mfss-positioning
|
||||
POSTGRES_HOST=postgres
|
||||
POSTGRES_PORT=5432
|
||||
|
||||
REDIS_HOST=redis
|
||||
REDIS_PORT=6379
|
||||
|
||||
SECRET_KEY=sample-key
|
||||
DEBUG=0
|
||||
@ -1,28 +0,0 @@
|
||||
# Этап 1: Клонирование репозитория
|
||||
FROM alpine/git as clone-stage
|
||||
ARG UE_STATIC_REPO
|
||||
RUN git clone --depth 1 ${UE_STATIC_REPO} /position
|
||||
|
||||
# Этап 2: Финальный образ
|
||||
FROM nginx:latest as final-stage
|
||||
|
||||
# Удаляем дефолтный конфиг Nginx
|
||||
RUN rm /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Копируем наш конфиг Nginx
|
||||
COPY nginx.conf /etc/nginx/conf.d
|
||||
|
||||
# Создаем директорию для статики
|
||||
RUN mkdir -p /home/static && mkdir -p /home/media
|
||||
|
||||
# Копируем данные из клонированного репозитория
|
||||
COPY --from=clone-stage /position/ /home/static/position/
|
||||
|
||||
# Копируем статику приложения
|
||||
COPY --from=app_static . /home/static/
|
||||
|
||||
# Устанавливаем рабочую директорию
|
||||
WORKDIR /home/static
|
||||
|
||||
# Удаляем каталог .git, если он не нужен
|
||||
RUN rm -rf /home/static/position/.git
|
||||
@ -1,24 +0,0 @@
|
||||
upstream gunicorn {
|
||||
server web:8000;
|
||||
}
|
||||
server {
|
||||
client_max_body_size 0M;
|
||||
proxy_read_timeout 300;
|
||||
|
||||
listen 80;
|
||||
|
||||
location / {
|
||||
proxy_pass http://gunicorn;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $host;
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
location /static/ {
|
||||
alias /home/static/;
|
||||
}
|
||||
|
||||
location /media/ {
|
||||
alias /home/media/;
|
||||
}
|
||||
}
|
||||
@ -1,76 +0,0 @@
|
||||
# Stage 1: Builder
|
||||
FROM python:3.12-slim AS builder
|
||||
|
||||
ENV POETRY_VERSION=1.8.2 \
|
||||
POETRY_NO_INTERACTION=1 \
|
||||
POETRY_VIRTUALENVS_CREATE=false \
|
||||
POETRY_CACHE_DIR=/tmp/poetry_cache
|
||||
|
||||
# Установим зависимости для сборки Python пакетов и GDAL
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
python3-dev \
|
||||
libffi-dev \
|
||||
libpq-dev \
|
||||
libgdal-dev \
|
||||
gdal-bin \
|
||||
curl \
|
||||
git \
|
||||
cargo \
|
||||
proj-bin \
|
||||
proj-data \
|
||||
libproj-dev \
|
||||
libgeos-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Установим Poetry
|
||||
RUN pip install poetry==$POETRY_VERSION
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Кэшируем зависимости
|
||||
COPY pyproject.toml poetry.lock ./
|
||||
RUN --mount=type=cache,target=/tmp/poetry_cache poetry export -f requirements.txt --without dev --without-hashes -o requirements.txt
|
||||
|
||||
# Stage 2: Runtime
|
||||
FROM python:3.12-slim
|
||||
|
||||
# Установим библиотеки для GDAL / PROJ / GEOS и системные зависимости
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libgdal-dev \
|
||||
gdal-bin \
|
||||
libproj-dev \
|
||||
proj-bin \
|
||||
proj-data \
|
||||
libgeos-dev \
|
||||
binutils \
|
||||
python3-pip \
|
||||
python3-venv \
|
||||
tzdata \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Настройки GDAL/PROJ/GEOS
|
||||
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal
|
||||
ENV C_INCLUDE_PATH=/usr/include/gdal
|
||||
ENV PROJ_LIB=/usr/share/proj
|
||||
ENV GDAL_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/libgdal.so
|
||||
ENV GEOS_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/libgeos_c.so
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# Установим virtualenv
|
||||
ENV VIRTUAL_ENV=/opt/venv
|
||||
RUN python3 -m venv $VIRTUAL_ENV
|
||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Копируем зависимости и устанавливаем
|
||||
COPY --from=builder /app/requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
RUN pip install gdal==3.6.2
|
||||
|
||||
COPY . .
|
||||
|
||||
#CMD ["gunicorn", "project_name.wsgi:application", "--bind", "0.0.0.0:8000"]
|
||||
@ -1,63 +0,0 @@
|
||||
from apps.eps.models.hardware.model_anchors import Anchors
|
||||
from apps.eps.models.hardware.model_base_station import BaseStation
|
||||
from apps.eps.models.hardware.model_uspd import Uspd
|
||||
from apps.eps.models.tags.model_checkpoints import Checkpoints
|
||||
from apps.eps.models.tags.model_tagdates import TagDate
|
||||
from apps.eps.models.tags.model_tags import Tag
|
||||
from apps.eps.models.zone.model_coordinates_zone import CoordinatesZone
|
||||
from apps.eps.models.zone.model_zones import Zone
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
from django.contrib.gis.admin import GISModelAdmin
|
||||
|
||||
|
||||
@admin.register(Anchors)
|
||||
class AnchorsAdmin(admin.ModelAdmin):
|
||||
list_display = ["sn", "ip_address", "label", "status", "status_time", "disabled"]
|
||||
list_filter = ["disabled", "status"]
|
||||
|
||||
|
||||
@admin.register(Uspd)
|
||||
class UspdAdmin(admin.ModelAdmin):
|
||||
list_display = ["name", "ip_address", "sn"]
|
||||
|
||||
|
||||
@admin.register(Checkpoints)
|
||||
class CheckpointsAdmin(admin.ModelAdmin):
|
||||
list_display = ["tag", "zone", "checkin", "verifycode"]
|
||||
list_filter = ["tag", "zone", "checkin", "verifycode"]
|
||||
|
||||
|
||||
@admin.register(TagDate)
|
||||
class TagDateAdmin(admin.ModelAdmin):
|
||||
list_display = ["tag", "time", "le_status"]
|
||||
list_filter = ["tag", "time", "le_status"]
|
||||
|
||||
|
||||
@admin.register(Tag)
|
||||
class TagAdmin(GISModelAdmin):
|
||||
gis_widget_kwargs = {
|
||||
"attrs": {
|
||||
"default_lat": settings.MAP_CENTER_LAT,
|
||||
"default_lon": settings.MAP_CENTER_LON,
|
||||
},
|
||||
}
|
||||
list_display = ["sn", "date_time", "active", "is_street"]
|
||||
list_filter = ["is_street", "active", "date_time"]
|
||||
|
||||
|
||||
@admin.register(CoordinatesZone)
|
||||
class CoordinatesZoneAdmin(admin.ModelAdmin):
|
||||
list_display = ["zone", "x", "y", "z"]
|
||||
|
||||
|
||||
@admin.register(Zone)
|
||||
class ZoneAdmin(admin.ModelAdmin):
|
||||
list_display = ["name"]
|
||||
|
||||
|
||||
@admin.register(BaseStation)
|
||||
class BaseStationAdmin(GISModelAdmin):
|
||||
list_display = ["uid", "name", "date_time", "description"]
|
||||
list_filter = ["date_time"]
|
||||
search_fields = ["uid", "name"]
|
||||
@ -1,7 +0,0 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class EpsConfig(AppConfig):
|
||||
default_auto_field = "django.db.models.BigAutoField"
|
||||
name = "apps.eps"
|
||||
verbose_name = "Система позиционирования"
|
||||
@ -1,438 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-04-03 08:27
|
||||
|
||||
import django.core.validators
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="Zone",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"name",
|
||||
models.CharField(
|
||||
default=" ", max_length=60, verbose_name="Наименование"
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "зона",
|
||||
"verbose_name_plural": "зоны",
|
||||
"ordering": ("name",),
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="Uspd",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"name",
|
||||
models.CharField(
|
||||
help_text="Уникальное название устройства",
|
||||
max_length=128,
|
||||
unique=True,
|
||||
validators=[django.core.validators.MinLengthValidator(3)],
|
||||
verbose_name="Наименование",
|
||||
),
|
||||
),
|
||||
(
|
||||
"ip_address",
|
||||
models.CharField(
|
||||
help_text="IPv4 или IPv6 адрес устройства",
|
||||
max_length=20,
|
||||
unique=True,
|
||||
validators=[django.core.validators.validate_ipv46_address],
|
||||
verbose_name="IP адрес",
|
||||
),
|
||||
),
|
||||
(
|
||||
"sn",
|
||||
models.CharField(
|
||||
help_text="Уникальный серийный номер производителя",
|
||||
max_length=128,
|
||||
unique=True,
|
||||
verbose_name="Серийный номер",
|
||||
),
|
||||
),
|
||||
("x", models.FloatField(default=0.0, verbose_name="x")),
|
||||
("y", models.FloatField(default=0.0, verbose_name="y")),
|
||||
("z", models.FloatField(default=0.0, verbose_name="z")),
|
||||
(
|
||||
"description",
|
||||
models.TextField(
|
||||
blank=True,
|
||||
help_text="Дополнительная информация об устройстве",
|
||||
null=True,
|
||||
verbose_name="Описание",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "УСПД",
|
||||
"verbose_name_plural": "УСПД",
|
||||
"ordering": ("name",),
|
||||
"indexes": [
|
||||
models.Index(fields=["name"], name="eps_uspd_name_2a010a_idx")
|
||||
],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="Tag",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"name",
|
||||
models.CharField(
|
||||
default=" ", max_length=160, verbose_name="Наименование"
|
||||
),
|
||||
),
|
||||
(
|
||||
"sn",
|
||||
models.CharField(
|
||||
default=" ", max_length=60, verbose_name="Серийный номер"
|
||||
),
|
||||
),
|
||||
(
|
||||
"descr",
|
||||
models.CharField(default=" ", max_length=100, verbose_name="descr"),
|
||||
),
|
||||
(
|
||||
"origin",
|
||||
models.CharField(
|
||||
blank=True, default=" ", max_length=100, verbose_name="origin"
|
||||
),
|
||||
),
|
||||
(
|
||||
"le_status",
|
||||
models.CharField(
|
||||
blank=True, default=" ", max_length=60, verbose_name="Статус"
|
||||
),
|
||||
),
|
||||
("x", models.FloatField(default=0.0, verbose_name="x")),
|
||||
("y", models.FloatField(default=0.0, verbose_name="y")),
|
||||
("z", models.FloatField(default=0.0, verbose_name="z")),
|
||||
("lat", models.FloatField(default=0.0, verbose_name="lat")),
|
||||
("lon", models.FloatField(default=0.0, verbose_name="lon")),
|
||||
("alt", models.FloatField(default=0.0, verbose_name="alt")),
|
||||
(
|
||||
"date_time",
|
||||
models.DateTimeField(
|
||||
blank=True,
|
||||
default=django.utils.timezone.now,
|
||||
null=True,
|
||||
verbose_name="Время (3d)",
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_time_street",
|
||||
models.DateTimeField(
|
||||
blank=True,
|
||||
default=django.utils.timezone.now,
|
||||
null=True,
|
||||
verbose_name="Время (Улица)",
|
||||
),
|
||||
),
|
||||
(
|
||||
"active",
|
||||
models.BooleanField(
|
||||
blank=True, default=True, verbose_name="Активный"
|
||||
),
|
||||
),
|
||||
("charge", models.FloatField(default=0.0, verbose_name="Зарядка")),
|
||||
(
|
||||
"is_street",
|
||||
models.BooleanField(default=False, verbose_name="Уличный тэг?"),
|
||||
),
|
||||
(
|
||||
"zone",
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
to="eps.zone",
|
||||
verbose_name="Зона",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "тэг",
|
||||
"verbose_name_plural": "тэги",
|
||||
"ordering": ("name",),
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="CoordinatesZone",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("x", models.FloatField(default=0.0, verbose_name="x")),
|
||||
("y", models.FloatField(default=0.0, verbose_name="y")),
|
||||
("z", models.FloatField(default=0.0, verbose_name="z")),
|
||||
(
|
||||
"zone",
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
to="eps.zone",
|
||||
verbose_name="Зона",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "координаты зоны",
|
||||
"verbose_name_plural": "координаты зоны",
|
||||
"ordering": ("zone",),
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="Checkpoints",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"checkin",
|
||||
models.DateTimeField(blank=True, verbose_name="Время отметки"),
|
||||
),
|
||||
(
|
||||
"verifycode",
|
||||
models.IntegerField(
|
||||
blank=True,
|
||||
choices=[(0, "Вход"), (1, "Выход")],
|
||||
default=0,
|
||||
verbose_name="Статус отметки",
|
||||
),
|
||||
),
|
||||
(
|
||||
"tag",
|
||||
models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
to="eps.tag",
|
||||
verbose_name="Тэг",
|
||||
),
|
||||
),
|
||||
(
|
||||
"zone",
|
||||
models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
to="eps.zone",
|
||||
verbose_name="Зона",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "место нахождения тэга",
|
||||
"verbose_name_plural": "места нахождения тэгов",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="Anchors",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"rls_id",
|
||||
models.CharField(
|
||||
default=" ", max_length=160, verbose_name="id rls"
|
||||
),
|
||||
),
|
||||
(
|
||||
"sn",
|
||||
models.CharField(
|
||||
default=" ", max_length=60, verbose_name="Серийный номер"
|
||||
),
|
||||
),
|
||||
(
|
||||
"origin",
|
||||
models.CharField(
|
||||
default=" ", max_length=100, verbose_name="origin"
|
||||
),
|
||||
),
|
||||
(
|
||||
"disabled",
|
||||
models.BooleanField(default=False, verbose_name="disabled"),
|
||||
),
|
||||
(
|
||||
"descr",
|
||||
models.CharField(default=" ", max_length=100, verbose_name="descr"),
|
||||
),
|
||||
(
|
||||
"label",
|
||||
models.CharField(default=" ", max_length=100, verbose_name="label"),
|
||||
),
|
||||
("x", models.FloatField(default=0.0, verbose_name="x")),
|
||||
("y", models.FloatField(default=0.0, verbose_name="y")),
|
||||
("z", models.FloatField(default=0.0, verbose_name="z")),
|
||||
(
|
||||
"device_type",
|
||||
models.CharField(
|
||||
default=" ", max_length=50, verbose_name="device_type"
|
||||
),
|
||||
),
|
||||
(
|
||||
"status",
|
||||
models.CharField(default=" ", max_length=20, verbose_name="status"),
|
||||
),
|
||||
(
|
||||
"ip_address",
|
||||
models.CharField(
|
||||
default=" ", max_length=20, verbose_name="ip_address"
|
||||
),
|
||||
),
|
||||
(
|
||||
"coap_resource",
|
||||
models.CharField(
|
||||
default=" ", max_length=20, verbose_name="coap_resource"
|
||||
),
|
||||
),
|
||||
(
|
||||
"subscribed",
|
||||
models.BooleanField(default=False, verbose_name="subscribed"),
|
||||
),
|
||||
(
|
||||
"message_time",
|
||||
models.DateTimeField(blank=True, verbose_name="message_time"),
|
||||
),
|
||||
(
|
||||
"status_time",
|
||||
models.DateTimeField(blank=True, verbose_name="status_time"),
|
||||
),
|
||||
("total_packets", models.IntegerField(default=0)),
|
||||
("invalid_packets", models.IntegerField(default=0)),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "анкер",
|
||||
"verbose_name_plural": "анкера",
|
||||
"ordering": ("label",),
|
||||
"indexes": [
|
||||
models.Index(fields=["label"], name="eps_anchors_label_e816e3_idx")
|
||||
],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="TagDate",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"time",
|
||||
models.DateTimeField(blank=True, verbose_name="Время отметки"),
|
||||
),
|
||||
(
|
||||
"le_status",
|
||||
models.CharField(default=" ", max_length=60, verbose_name="Статус"),
|
||||
),
|
||||
("x", models.FloatField(default=0.0, verbose_name="x")),
|
||||
("y", models.FloatField(default=0.0, verbose_name="y")),
|
||||
("z", models.FloatField(default=0.0, verbose_name="z")),
|
||||
("street", models.BooleanField(default=False, verbose_name="Уличные")),
|
||||
(
|
||||
"tag",
|
||||
models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
to="eps.tag",
|
||||
verbose_name="Тег",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "отметка",
|
||||
"verbose_name_plural": "отметки",
|
||||
"indexes": [
|
||||
models.Index(fields=["tag"], name="eps_tagdate_tag_id_ecfebf_idx")
|
||||
],
|
||||
"unique_together": {("tag", "time")},
|
||||
},
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="tag",
|
||||
index=models.Index(fields=["name"], name="eps_tag_name_e51b1a_idx"),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="coordinateszone",
|
||||
index=models.Index(fields=["zone"], name="eps_coordin_zone_id_12dab7_idx"),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="checkpoints",
|
||||
index=models.Index(
|
||||
fields=["tag", "checkin"], name="eps_checkpo_tag_id_22af56_idx"
|
||||
),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="checkpoints",
|
||||
index=models.Index(
|
||||
fields=["checkin"], name="eps_checkpo_checkin_6c59bd_idx"
|
||||
),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="checkpoints",
|
||||
index=models.Index(fields=["tag"], name="eps_checkpo_tag_id_7ba436_idx"),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name="checkpoints",
|
||||
unique_together={("zone", "tag", "checkin")},
|
||||
),
|
||||
]
|
||||
@ -1,48 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-04-03 09:09
|
||||
|
||||
import django.contrib.gis.db.models.fields
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("eps", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="BaseStation",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("uid", models.CharField(max_length=128, verbose_name="Идентификатор")),
|
||||
("name", models.CharField(max_length=128, verbose_name="Наименование")),
|
||||
(
|
||||
"description",
|
||||
models.CharField(max_length=256, verbose_name="Комментарий"),
|
||||
),
|
||||
(
|
||||
"date_time",
|
||||
models.DateTimeField(
|
||||
blank=True, null=True, verbose_name="Дата связи"
|
||||
),
|
||||
),
|
||||
("point", django.contrib.gis.db.models.fields.PointField(srid=4326)),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "базовая станция",
|
||||
"verbose_name_plural": "базовая станции",
|
||||
"ordering": ("name",),
|
||||
"indexes": [
|
||||
models.Index(fields=["name"], name="eps_basesta_name_126184_idx")
|
||||
],
|
||||
},
|
||||
),
|
||||
]
|
||||
@ -1,28 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-04-04 02:23
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("eps", "0002_basestation"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="basestation",
|
||||
options={
|
||||
"ordering": ("name",),
|
||||
"verbose_name": "базовая станция",
|
||||
"verbose_name_plural": "базовые станции",
|
||||
},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="basestation",
|
||||
name="description",
|
||||
field=models.CharField(
|
||||
blank=True, max_length=256, null=True, verbose_name="Комментарий"
|
||||
),
|
||||
),
|
||||
]
|
||||
@ -1,18 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-04-07 03:22
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("eps", "0003_alter_basestation_options_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="basestation",
|
||||
name="active",
|
||||
field=models.BooleanField(default=True),
|
||||
),
|
||||
]
|
||||
@ -1,31 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-04-08 02:18
|
||||
|
||||
import django.contrib.gis.db.models.fields
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("eps", "0004_basestation_active"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name="tag",
|
||||
name="alt",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="tag",
|
||||
name="lat",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="tag",
|
||||
name="lon",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="tag",
|
||||
name="geo_point",
|
||||
field=django.contrib.gis.db.models.fields.PointField(null=True, srid=4326),
|
||||
),
|
||||
]
|
||||
@ -1,27 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-04-08 02:24
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("eps", "0005_remove_tag_alt_remove_tag_lat_remove_tag_lon_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="tag",
|
||||
name="date_time",
|
||||
field=models.DateTimeField(
|
||||
blank=True, null=True, verbose_name="Время (3d)"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="tag",
|
||||
name="date_time_street",
|
||||
field=models.DateTimeField(
|
||||
blank=True, null=True, verbose_name="Время (Улица)"
|
||||
),
|
||||
),
|
||||
]
|
||||
@ -1,18 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-04-29 07:51
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("eps", "0006_alter_tag_date_time_alter_tag_date_time_street"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="tag",
|
||||
name="charge",
|
||||
field=models.FloatField(blank=True, null=True, verbose_name="Зарядка"),
|
||||
),
|
||||
]
|
||||
@ -1,77 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-04-29 09:45
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("eps", "0007_alter_tag_charge"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name="tag",
|
||||
name="geo_point",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="tag",
|
||||
name="alt",
|
||||
field=models.FloatField(blank=True, null=True, verbose_name="Высота"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="tag",
|
||||
name="lat",
|
||||
field=models.FloatField(blank=True, null=True, verbose_name="Широта"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="tag",
|
||||
name="lon",
|
||||
field=models.FloatField(blank=True, null=True, verbose_name="Долгота"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="tag",
|
||||
name="charge",
|
||||
field=models.FloatField(blank=True, null=True, verbose_name="Заряд"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="tag",
|
||||
name="descr",
|
||||
field=models.CharField(max_length=100, verbose_name="Описание"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="tag",
|
||||
name="le_status",
|
||||
field=models.CharField(blank=True, max_length=60, verbose_name="Статус"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="tag",
|
||||
name="name",
|
||||
field=models.CharField(max_length=160, verbose_name="Наименование"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="tag",
|
||||
name="origin",
|
||||
field=models.CharField(blank=True, max_length=100, verbose_name="origin"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="tag",
|
||||
name="sn",
|
||||
field=models.CharField(max_length=60, verbose_name="Серийный номер"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="tag",
|
||||
name="x",
|
||||
field=models.FloatField(blank=True, null=True, verbose_name="x"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="tag",
|
||||
name="y",
|
||||
field=models.FloatField(blank=True, null=True, verbose_name="y"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="tag",
|
||||
name="z",
|
||||
field=models.FloatField(blank=True, null=True, verbose_name="z"),
|
||||
),
|
||||
]
|
||||
@ -1,21 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-04-29 10:04
|
||||
|
||||
import django.contrib.gis.db.models.fields
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("eps", "0008_remove_tag_geo_point_tag_alt_tag_lat_tag_lon_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="tag",
|
||||
name="geo_point",
|
||||
field=django.contrib.gis.db.models.fields.PointField(
|
||||
blank=True, geography=True, null=True, srid=4326
|
||||
),
|
||||
),
|
||||
]
|
||||
@ -1,39 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-04-30 02:13
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("eps", "0009_tag_geo_point"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="tag",
|
||||
options={
|
||||
"ordering": ("sn",),
|
||||
"verbose_name": "тэг",
|
||||
"verbose_name_plural": "тэги",
|
||||
},
|
||||
),
|
||||
migrations.RemoveIndex(
|
||||
model_name="tag",
|
||||
name="eps_tag_name_e51b1a_idx",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="tag",
|
||||
name="name",
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="tag",
|
||||
index=models.Index(fields=["date_time"], name="eps_tag_date_ti_67f76b_idx"),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="tag",
|
||||
index=models.Index(
|
||||
fields=["date_time_street"], name="eps_tag_date_ti_487e0a_idx"
|
||||
),
|
||||
),
|
||||
]
|
||||
@ -1,18 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-07-07 02:52
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("eps", "0010_alter_tag_options_remove_tag_eps_tag_name_e51b1a_idx_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="tagdate",
|
||||
name="street",
|
||||
field=models.BooleanField(default=False, null=True, verbose_name="Уличные"),
|
||||
),
|
||||
]
|
||||
@ -1,30 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-07-09 07:41
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("eps", "0011_alter_tagdate_street"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="tag",
|
||||
name="sn",
|
||||
field=models.CharField(
|
||||
max_length=60, unique=True, verbose_name="Серийный номер"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="uspd",
|
||||
name="description",
|
||||
field=models.TextField(
|
||||
blank=True,
|
||||
default="",
|
||||
help_text="Дополнительная информация об устройстве",
|
||||
verbose_name="Описание",
|
||||
),
|
||||
),
|
||||
]
|
||||
@ -1,96 +0,0 @@
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Anchors(models.Model):
|
||||
"""
|
||||
Модель Анкеров.
|
||||
"""
|
||||
|
||||
rls_id = models.CharField(
|
||||
max_length=160,
|
||||
help_text="",
|
||||
default=" ",
|
||||
verbose_name="id rls",
|
||||
)
|
||||
sn = models.CharField(
|
||||
max_length=60,
|
||||
help_text="",
|
||||
default=" ",
|
||||
verbose_name="Серийный номер",
|
||||
)
|
||||
origin = models.CharField(
|
||||
max_length=100,
|
||||
help_text="",
|
||||
default=" ",
|
||||
verbose_name="origin",
|
||||
)
|
||||
disabled = models.BooleanField(blank=False, default=False, verbose_name="disabled")
|
||||
descr = models.CharField(
|
||||
max_length=100,
|
||||
help_text="",
|
||||
default=" ",
|
||||
verbose_name="descr",
|
||||
)
|
||||
label = models.CharField(
|
||||
max_length=100,
|
||||
help_text="",
|
||||
default=" ",
|
||||
verbose_name="label",
|
||||
)
|
||||
x = models.FloatField(default=0.0, help_text="", verbose_name="x")
|
||||
y = models.FloatField(default=0.0, help_text="", verbose_name="y")
|
||||
z = models.FloatField(default=0.0, help_text="", verbose_name="z")
|
||||
device_type = models.CharField(
|
||||
max_length=50,
|
||||
help_text="",
|
||||
default=" ",
|
||||
verbose_name="device_type",
|
||||
)
|
||||
status = models.CharField(
|
||||
max_length=20,
|
||||
help_text="",
|
||||
default=" ",
|
||||
verbose_name="status",
|
||||
)
|
||||
ip_address = models.CharField(
|
||||
max_length=20,
|
||||
help_text="",
|
||||
default=" ",
|
||||
verbose_name="ip_address",
|
||||
)
|
||||
coap_resource = models.CharField(
|
||||
max_length=20,
|
||||
help_text="",
|
||||
default=" ",
|
||||
verbose_name="coap_resource",
|
||||
)
|
||||
subscribed = models.BooleanField(
|
||||
blank=False,
|
||||
default=False,
|
||||
verbose_name="subscribed",
|
||||
)
|
||||
message_time = models.DateTimeField(
|
||||
auto_now=False,
|
||||
auto_now_add=False,
|
||||
blank=True,
|
||||
verbose_name="message_time",
|
||||
)
|
||||
status_time = models.DateTimeField(
|
||||
auto_now=False,
|
||||
auto_now_add=False,
|
||||
blank=True,
|
||||
verbose_name="status_time",
|
||||
)
|
||||
total_packets = models.IntegerField(default=0)
|
||||
invalid_packets = models.IntegerField(default=0)
|
||||
|
||||
class Meta:
|
||||
ordering = ("label",)
|
||||
verbose_name = "анкер"
|
||||
verbose_name_plural = "анкера"
|
||||
indexes = [
|
||||
models.Index(fields=["label"]),
|
||||
]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.label
|
||||
@ -1,64 +0,0 @@
|
||||
from base.base_service import BaseService
|
||||
from django.contrib.gis.db import models
|
||||
|
||||
|
||||
class BaseStation(models.Model):
|
||||
uid = models.CharField(max_length=128, verbose_name="Идентификатор")
|
||||
name = models.CharField(max_length=128, verbose_name="Наименование")
|
||||
description = models.CharField(
|
||||
max_length=256,
|
||||
verbose_name="Комментарий",
|
||||
null=True,
|
||||
blank=True,
|
||||
)
|
||||
date_time = models.DateTimeField(verbose_name="Дата связи", null=True, blank=True)
|
||||
active = models.BooleanField(default=True)
|
||||
point = models.PointField()
|
||||
|
||||
def to_dict(self) -> dict:
|
||||
if self.date_time:
|
||||
bs_date_time = BaseService.convert_to_local_time(self.date_time).strftime(
|
||||
"%d.%m:%Y %H:%M:%S",
|
||||
)
|
||||
else:
|
||||
bs_date_time = "Не было"
|
||||
return {
|
||||
"uid": self.uid,
|
||||
"name": self.name,
|
||||
"description": self.description,
|
||||
"date_time": bs_date_time,
|
||||
"lat": self.point.coords[1],
|
||||
"lon": self.point.coords[0],
|
||||
}
|
||||
|
||||
@property
|
||||
def lat(self) -> str:
|
||||
return self.point.coords[1]
|
||||
|
||||
@property
|
||||
def lon(self) -> str:
|
||||
return self.point.coords[0]
|
||||
|
||||
@property
|
||||
def formatted_date_time(self) -> str:
|
||||
if self.date_time:
|
||||
formatted_date_time = BaseService.convert_to_local_time(
|
||||
self.date_time,
|
||||
).strftime("%d.%m.%Y %H:%M:%S")
|
||||
return formatted_date_time
|
||||
return "Не было"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.name
|
||||
|
||||
class Meta:
|
||||
ordering = ("name",)
|
||||
verbose_name = "базовая станция"
|
||||
verbose_name_plural = "базовые станции"
|
||||
indexes = [
|
||||
models.Index(
|
||||
fields=[
|
||||
"name",
|
||||
],
|
||||
),
|
||||
]
|
||||
@ -1,54 +0,0 @@
|
||||
from django.core.validators import MinLengthValidator, validate_ipv46_address
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Uspd(models.Model):
|
||||
"""Модель УСПД (Устройство Сбора и Передачи Данных)."""
|
||||
|
||||
name = models.CharField(
|
||||
max_length=128,
|
||||
verbose_name="Наименование",
|
||||
help_text="Уникальное название устройства",
|
||||
unique=True,
|
||||
validators=[MinLengthValidator(3)],
|
||||
)
|
||||
|
||||
ip_address = models.CharField(
|
||||
max_length=20,
|
||||
verbose_name="IP адрес",
|
||||
validators=[validate_ipv46_address],
|
||||
unique=True,
|
||||
help_text="IPv4 или IPv6 адрес устройства",
|
||||
)
|
||||
|
||||
sn = models.CharField(
|
||||
max_length=128,
|
||||
verbose_name="Серийный номер",
|
||||
unique=True,
|
||||
help_text="Уникальный серийный номер производителя",
|
||||
)
|
||||
# Внутренние координаты
|
||||
x = models.FloatField(default=0.0, help_text="", verbose_name="x")
|
||||
y = models.FloatField(default=0.0, help_text="", verbose_name="y")
|
||||
z = models.FloatField(default=0.0, help_text="", verbose_name="z")
|
||||
description = models.TextField(
|
||||
blank=True,
|
||||
default="",
|
||||
verbose_name="Описание",
|
||||
help_text="Дополнительная информация об устройстве",
|
||||
)
|
||||
|
||||
class Meta:
|
||||
ordering = ("name",)
|
||||
verbose_name = "УСПД"
|
||||
verbose_name_plural = "УСПД"
|
||||
indexes = [
|
||||
models.Index(
|
||||
fields=[
|
||||
"name",
|
||||
],
|
||||
),
|
||||
]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.name
|
||||
@ -1,54 +0,0 @@
|
||||
from apps.eps.models.tags.model_tags import Tag
|
||||
from apps.eps.models.zone.model_zones import Zone
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Checkpoints(models.Model): # Отметки
|
||||
verifycode_list = (
|
||||
(0, "Вход"),
|
||||
(1, "Выход"),
|
||||
)
|
||||
"""
|
||||
История перемещений тега по зонам.
|
||||
Расшифровка verifycode:
|
||||
0 -> Вход 1 -> Выход 2 -> Out
|
||||
3 -> Return from an out 4 -> Вход вне смены 5 -> Выход вне смены
|
||||
8 -> На обед 9 -> С обеда
|
||||
"""
|
||||
|
||||
zone = models.ForeignKey(
|
||||
Zone,
|
||||
on_delete=models.SET_NULL,
|
||||
null=True,
|
||||
verbose_name="Зона",
|
||||
)
|
||||
tag = models.ForeignKey(Tag, on_delete=models.SET_NULL, null=True, verbose_name="Тэг")
|
||||
checkin = models.DateTimeField(
|
||||
auto_now=False,
|
||||
auto_now_add=False,
|
||||
blank=True,
|
||||
verbose_name="Время отметки",
|
||||
)
|
||||
verifycode = models.IntegerField(
|
||||
choices=verifycode_list,
|
||||
blank=True,
|
||||
default=0,
|
||||
verbose_name="Статус отметки",
|
||||
)
|
||||
|
||||
class Meta:
|
||||
unique_together = (
|
||||
"zone",
|
||||
"tag",
|
||||
"checkin",
|
||||
)
|
||||
verbose_name = "место нахождения тэга"
|
||||
verbose_name_plural = "места нахождения тэгов"
|
||||
indexes = [
|
||||
models.Index(fields=["tag", "checkin"]),
|
||||
models.Index(fields=["checkin"]),
|
||||
models.Index(fields=["tag"]),
|
||||
]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"{self.tag.sn} {self.zone.name} {self.checkin.strftime('%d.%m.%Y: %H:%M:%S')}" # noqa: E501
|
||||
@ -1,43 +0,0 @@
|
||||
from django.db import models
|
||||
|
||||
from .model_tags import Tag
|
||||
|
||||
|
||||
class TagDate(models.Model):
|
||||
"""
|
||||
История перемещений тэга по координатам.
|
||||
Если street = True
|
||||
x = lat
|
||||
y = lon
|
||||
z = alt
|
||||
"""
|
||||
|
||||
tag = models.ForeignKey(Tag, on_delete=models.SET_NULL, null=True, verbose_name="Тег")
|
||||
time = models.DateTimeField(
|
||||
auto_now=False,
|
||||
auto_now_add=False,
|
||||
blank=True,
|
||||
verbose_name="Время отметки",
|
||||
)
|
||||
le_status = models.CharField(
|
||||
max_length=60,
|
||||
help_text="",
|
||||
default=" ",
|
||||
verbose_name="Статус",
|
||||
)
|
||||
x = models.FloatField(default=0.0, help_text="", verbose_name="x")
|
||||
y = models.FloatField(default=0.0, help_text="", verbose_name="y")
|
||||
z = models.FloatField(default=0.0, help_text="", verbose_name="z")
|
||||
street = models.BooleanField(default=False, verbose_name="Уличные", null=True)
|
||||
|
||||
class Meta:
|
||||
unique_together = ("tag", "time")
|
||||
verbose_name = "отметка"
|
||||
verbose_name_plural = "отметки"
|
||||
indexes = [
|
||||
models.Index(fields=["tag"]),
|
||||
]
|
||||
|
||||
def __str__(self) -> str:
|
||||
record_time = self.time.strftime("%d.%m.%Y: %H:%M:%S")
|
||||
return f"{self.tag.sn} {record_time}"
|
||||
@ -1,119 +0,0 @@
|
||||
from typing import Any
|
||||
|
||||
from apps.eps.models.zone.model_zones import Zone
|
||||
from apps.main.models.model_street_zone import StreetZone
|
||||
from base.base_service import BaseService
|
||||
from django.contrib.gis.db import models
|
||||
|
||||
|
||||
class Tag(models.Model):
|
||||
"""
|
||||
Модель тэга.
|
||||
"""
|
||||
|
||||
sn = models.CharField(max_length=60, verbose_name="Серийный номер", unique=True)
|
||||
descr = models.CharField(max_length=100, verbose_name="Описание")
|
||||
origin = models.CharField(max_length=100, verbose_name="origin", blank=True)
|
||||
le_status = models.CharField(max_length=60, verbose_name="Статус", blank=True)
|
||||
|
||||
# Внутренние координаты
|
||||
x = models.FloatField(null=True, blank=True, verbose_name="x")
|
||||
y = models.FloatField(null=True, blank=True, verbose_name="y")
|
||||
z = models.FloatField(null=True, blank=True, verbose_name="z")
|
||||
# Уличные координаты
|
||||
lat = models.FloatField(null=True, blank=True, verbose_name="Широта")
|
||||
lon = models.FloatField(null=True, blank=True, verbose_name="Долгота")
|
||||
alt = models.FloatField(null=True, blank=True, verbose_name="Высота")
|
||||
geo_point = models.PointField(null=True, blank=True, geography=True)
|
||||
|
||||
date_time = models.DateTimeField(
|
||||
auto_now=False,
|
||||
verbose_name="Время (3d)",
|
||||
null=True,
|
||||
blank=True,
|
||||
)
|
||||
date_time_street = models.DateTimeField(
|
||||
auto_now=False,
|
||||
verbose_name="Время (Улица)",
|
||||
null=True,
|
||||
blank=True,
|
||||
)
|
||||
active = models.BooleanField(
|
||||
verbose_name="Активный",
|
||||
null=False,
|
||||
default=True,
|
||||
blank=True,
|
||||
)
|
||||
charge = models.FloatField(verbose_name="Заряд", default=0.0, blank=True)
|
||||
is_street = models.BooleanField(default=False, verbose_name="Уличный тэг?")
|
||||
zone = models.ForeignKey(
|
||||
Zone,
|
||||
on_delete=models.SET_NULL,
|
||||
null=True,
|
||||
verbose_name="Зона",
|
||||
blank=True,
|
||||
)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.sn
|
||||
|
||||
def save(self, *args: Any, **kwargs: Any) -> None:
|
||||
descr = str(self.descr).replace(" ", "")
|
||||
if len(descr) == 0:
|
||||
self.descr = self.sn
|
||||
if self.geo_point:
|
||||
self.lat = self.geo_point.coords[1]
|
||||
self.lon = self.geo_point.coords[0]
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
@property
|
||||
def worker_name(self) -> str:
|
||||
if hasattr(self, "worker") and self.worker:
|
||||
return self.worker.name
|
||||
else:
|
||||
return "Не назначен"
|
||||
|
||||
def to_dict(self) -> dict:
|
||||
return {
|
||||
"id": self.id,
|
||||
"name": self.worker_name,
|
||||
"sn": self.sn,
|
||||
"lat": self.lat,
|
||||
"lon": self.lon,
|
||||
"date_time": (
|
||||
BaseService.convert_to_local_time(self.date_time_street).strftime(
|
||||
"%d.%m.%Y %H:%M:%S",
|
||||
)
|
||||
if self.date_time_street
|
||||
else ""
|
||||
),
|
||||
"iso_time": BaseService.convert_to_local_time(
|
||||
self.date_time_street,
|
||||
).isoformat(),
|
||||
}
|
||||
|
||||
def get_zone(self) -> str:
|
||||
if self.is_street and self.geo_point is not None:
|
||||
zone = StreetZone.objects.filter(
|
||||
polygon__contains=self.geo_point, active=True
|
||||
).first()
|
||||
return "На улице" if zone is None else zone.name
|
||||
else:
|
||||
return "Не определена" if self.zone is None else self.zone.name
|
||||
|
||||
class Meta:
|
||||
ordering = ("sn",)
|
||||
verbose_name = "тэг"
|
||||
verbose_name_plural = "тэги"
|
||||
indexes = [
|
||||
models.Index(
|
||||
fields=[
|
||||
"date_time",
|
||||
],
|
||||
),
|
||||
models.Index(
|
||||
fields=[
|
||||
"date_time_street",
|
||||
],
|
||||
),
|
||||
]
|
||||
@ -1,34 +0,0 @@
|
||||
from django.db import models
|
||||
|
||||
from .model_zones import Zone
|
||||
|
||||
|
||||
class CoordinatesZone(models.Model):
|
||||
"""Модель координат зоны"""
|
||||
|
||||
zone = models.ForeignKey(
|
||||
Zone,
|
||||
on_delete=models.SET_NULL,
|
||||
null=True,
|
||||
blank=True,
|
||||
help_text="",
|
||||
verbose_name="Зона",
|
||||
)
|
||||
|
||||
x = models.FloatField(default=0.0, help_text="", verbose_name="x")
|
||||
y = models.FloatField(default=0.0, help_text="", verbose_name="y")
|
||||
z = models.FloatField(default=0.0, help_text="", verbose_name="z")
|
||||
|
||||
class Meta: # отображение в админики
|
||||
ordering = ("zone",)
|
||||
verbose_name = "координаты зоны"
|
||||
verbose_name_plural = "координаты зоны"
|
||||
indexes = [
|
||||
models.Index(fields=["zone"]),
|
||||
]
|
||||
|
||||
def __str__(self) -> str:
|
||||
"""
|
||||
String for representing the Model object (in Admin site etc.)
|
||||
"""
|
||||
return self.zone.name
|
||||
@ -1,22 +0,0 @@
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Zone(models.Model): # Зоны
|
||||
"""
|
||||
Модель справочника зоны
|
||||
"""
|
||||
|
||||
name = models.CharField(
|
||||
max_length=60,
|
||||
help_text="",
|
||||
default=" ",
|
||||
verbose_name="Наименование",
|
||||
)
|
||||
|
||||
class Meta:
|
||||
ordering = ("name",)
|
||||
verbose_name = "зона"
|
||||
verbose_name_plural = "зоны"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.name
|
||||
@ -1,7 +0,0 @@
|
||||
from apps.eps.models.tags.model_tags import Tag
|
||||
from base.base_repository import BaseRepository
|
||||
|
||||
|
||||
class TagRepository(BaseRepository):
|
||||
def __init__(self, model: Tag = Tag) -> None:
|
||||
super().__init__(model)
|
||||
@ -1,7 +0,0 @@
|
||||
from apps.workers.models.model_workers import Worker
|
||||
from base.base_repository import BaseRepository
|
||||
|
||||
|
||||
class WorkerRepository(BaseRepository):
|
||||
def __init__(self, model: Worker = Worker) -> None:
|
||||
super().__init__(model)
|
||||
@ -1,11 +0,0 @@
|
||||
from apps.eps.models.hardware.model_base_station import BaseStation
|
||||
from base.base_repository import BaseRepository
|
||||
from django.db.models import Model, QuerySet
|
||||
|
||||
|
||||
class BaseStationRepository(BaseRepository):
|
||||
def __init__(self, model: Model = BaseStation):
|
||||
super().__init__(model)
|
||||
|
||||
def all(self) -> QuerySet[BaseStation]:
|
||||
return self.model.objects.all()
|
||||
@ -1,17 +0,0 @@
|
||||
from apps.eps.services.hardware.repository import BaseStationRepository
|
||||
from base.base_service import BaseService
|
||||
|
||||
|
||||
class HardwareService(BaseService):
|
||||
def __init__(self, bs_repository: BaseStationRepository = None) -> None:
|
||||
self.bs_repository = bs_repository or BaseStationRepository()
|
||||
|
||||
def get_base_stations(self) -> dict:
|
||||
data = self.bs_repository.all()
|
||||
res = {
|
||||
"error": "",
|
||||
"status": 0,
|
||||
"total": data.count(),
|
||||
"items": [bs.to_dict() for bs in data],
|
||||
}
|
||||
return res
|
||||
@ -1,6 +0,0 @@
|
||||
from apps.eps.services.hardware.views.views_api import BaseStationApiView
|
||||
from django.urls import path
|
||||
|
||||
urlpatterns = [
|
||||
path("base_stations/", BaseStationApiView.as_view(), name="base_stations_list"),
|
||||
]
|
||||
@ -1,25 +0,0 @@
|
||||
import logging
|
||||
import traceback
|
||||
from typing import Any
|
||||
|
||||
from apps.eps.services.hardware.service import HardwareService
|
||||
from django.conf import settings
|
||||
from django.http import HttpRequest, JsonResponse
|
||||
from mixins.base_view import BaseView
|
||||
|
||||
logger = logging.getLogger("mfss")
|
||||
|
||||
|
||||
class BaseStationApiView(BaseView):
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
||||
super().__init__(*args, **kwargs)
|
||||
self.service = HardwareService()
|
||||
|
||||
def get(self, request: HttpRequest) -> JsonResponse:
|
||||
try:
|
||||
data = self.service.get_base_stations()
|
||||
return JsonResponse(data)
|
||||
except Exception:
|
||||
logger.error(traceback.format_exc())
|
||||
error_msg = traceback.format_exc() if settings.DEBUG else "Server error"
|
||||
return self._error_response(error_msg)
|
||||
@ -1,30 +0,0 @@
|
||||
from datetime import datetime, time
|
||||
|
||||
from apps.workers.models.model_workers import Worker
|
||||
from django.forms import (
|
||||
DateTimeField,
|
||||
Form,
|
||||
HiddenInput,
|
||||
ModelMultipleChoiceField,
|
||||
SelectMultiple,
|
||||
)
|
||||
|
||||
|
||||
class StreetHistoryReportForm(Form):
|
||||
workers = ModelMultipleChoiceField( # type: ignore
|
||||
queryset=Worker.objects.filter(tag__isnull=False),
|
||||
widget=SelectMultiple(attrs={"id": "id_workers"}),
|
||||
required=False,
|
||||
)
|
||||
date_start = DateTimeField(widget=HiddenInput)
|
||||
date_end = DateTimeField(widget=HiddenInput)
|
||||
|
||||
def clean_date_end(self) -> datetime:
|
||||
date_end = self.cleaned_data["date_end"].date()
|
||||
time_end = time(23, 59)
|
||||
return datetime.combine(date_end, time_end)
|
||||
|
||||
def clean_date_start(self) -> datetime:
|
||||
date_start = self.cleaned_data["date_start"].date()
|
||||
time_start = time(0, 0)
|
||||
return datetime.combine(date_start, time_start)
|
||||
@ -1,45 +0,0 @@
|
||||
from datetime import datetime
|
||||
|
||||
from apps.eps.models.tags.model_tagdates import TagDate
|
||||
from apps.workers.models.model_workers import Worker
|
||||
from base.base_service import BaseService
|
||||
from django.conf import settings
|
||||
from django.db.models import Prefetch, QuerySet
|
||||
|
||||
|
||||
class HistoryReportService(BaseService):
|
||||
def get_report_data(
|
||||
self,
|
||||
workers: QuerySet[Worker],
|
||||
date_start: datetime,
|
||||
date_end: datetime,
|
||||
) -> list[dict]:
|
||||
qs = workers.select_related("tag").prefetch_related(
|
||||
Prefetch(
|
||||
"tag__tagdate_set",
|
||||
queryset=TagDate.objects.filter(
|
||||
time__gte=date_start,
|
||||
time__lte=date_end,
|
||||
).order_by("time"),
|
||||
to_attr="filtered_tag_dates",
|
||||
),
|
||||
)
|
||||
items: list = []
|
||||
for worker in qs:
|
||||
items.append(
|
||||
{
|
||||
"worker_name": worker.name,
|
||||
"tag_sn": worker.tag.sn,
|
||||
"points": [
|
||||
{
|
||||
"lat": tag_date.x,
|
||||
"lon": tag_date.y,
|
||||
"time": tag_date.time.astimezone(
|
||||
settings.TIME_ZONE_OBJECT,
|
||||
).strftime("%d.%m.%Y %H:%M"),
|
||||
}
|
||||
for tag_date in worker.tag.filtered_tag_dates
|
||||
],
|
||||
},
|
||||
)
|
||||
return items
|
||||
@ -1,12 +0,0 @@
|
||||
from apps.eps.services.report.views.views_page import (
|
||||
ReportIndexView,
|
||||
StreetHistoryPageView,
|
||||
)
|
||||
from django.urls import path
|
||||
|
||||
app_name = "report"
|
||||
|
||||
urlpatterns = [
|
||||
path("", ReportIndexView.as_view(), name="index"),
|
||||
path("street_history/", StreetHistoryPageView.as_view(), name="street_history"),
|
||||
]
|
||||
@ -1,44 +0,0 @@
|
||||
import json
|
||||
from typing import Any
|
||||
|
||||
from apps.eps.services.report.forms.street_history_report_form import (
|
||||
StreetHistoryReportForm,
|
||||
)
|
||||
from apps.eps.services.report.service import HistoryReportService
|
||||
from apps.settings.models.model_settings import Settings
|
||||
from django.core.serializers.json import DjangoJSONEncoder
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.views.generic import FormView, TemplateView
|
||||
from mixins.settings_context import SettingsContextMixin
|
||||
|
||||
|
||||
class ReportIndexView(SettingsContextMixin, TemplateView):
|
||||
template_name = "eps/report/report_index.html"
|
||||
|
||||
|
||||
class StreetHistoryPageView(FormView):
|
||||
template_name = "eps/report/street_history.html"
|
||||
form_class = StreetHistoryReportForm
|
||||
service = HistoryReportService()
|
||||
|
||||
def get_context_data(self, **kwargs: Any) -> dict:
|
||||
context = super().get_context_data(**kwargs)
|
||||
settings_list = Settings.objects.all()
|
||||
for setting in settings_list:
|
||||
context[setting.name] = setting.value
|
||||
return context
|
||||
|
||||
def form_valid(self, form: StreetHistoryReportForm) -> HttpResponse:
|
||||
if form.is_valid():
|
||||
workers = form.cleaned_data["workers"]
|
||||
date_start = form.cleaned_data["date_start"]
|
||||
date_end = form.cleaned_data["date_end"]
|
||||
data = self.service.get_report_data(workers, date_start, date_end)
|
||||
context = self.get_context_data()
|
||||
context["data_json"] = mark_safe(json.dumps(data, cls=DjangoJSONEncoder))
|
||||
context["date_start"] = date_start.isoformat()
|
||||
context["date_end"] = date_end.isoformat()
|
||||
return render(self.request, "eps/report/street_history.html", context)
|
||||
return super().form_valid(form)
|
||||
@ -1,20 +0,0 @@
|
||||
import datetime
|
||||
|
||||
from apps.eps.models.tags.model_tags import Tag
|
||||
from apps.eps.repositories.worker_repository import WorkerRepository
|
||||
from apps.workers.models.model_workers import Worker
|
||||
from django.db.models import Q, QuerySet
|
||||
|
||||
|
||||
class WorkerStatisticRepository(WorkerRepository):
|
||||
def get_workers_with_threshold(
|
||||
self, internal_threshold: datetime.datetime, street_threshold: datetime.datetime
|
||||
) -> QuerySet[Worker]:
|
||||
condition = Q(date_time__gte=internal_threshold) | Q(
|
||||
date_time_street__gte=street_threshold
|
||||
)
|
||||
active_tags = Tag.objects.filter(condition)
|
||||
workers_with_active_tags = Worker.objects.filter(
|
||||
tag__in=active_tags
|
||||
).select_related("tag", "tag__zone")
|
||||
return workers_with_active_tags
|
||||
@ -1,43 +0,0 @@
|
||||
from datetime import timedelta
|
||||
|
||||
from apps.eps.services.statistic.repository import WorkerStatisticRepository
|
||||
from apps.settings.models.model_settings import Settings
|
||||
from base.base_service import BaseService
|
||||
from django.utils import timezone
|
||||
|
||||
|
||||
class EpsStatisticService(BaseService):
|
||||
def __init__(self, repository: WorkerStatisticRepository = None) -> None:
|
||||
if repository is None:
|
||||
self.repository = WorkerStatisticRepository()
|
||||
else:
|
||||
self.repository = repository
|
||||
|
||||
def get_workers(self) -> dict:
|
||||
internal_tag_timeout = int(Settings.get_settings("internal_tag_timeout", "300"))
|
||||
street_tag_timeout = int(Settings.get_settings("street_tag_timeout", "172800"))
|
||||
|
||||
internal_time_threshold = timezone.now() - timedelta(seconds=internal_tag_timeout)
|
||||
street_time_threshold = timezone.now() - timedelta(seconds=street_tag_timeout)
|
||||
|
||||
workers_qs = self.repository.get_workers_with_threshold(
|
||||
internal_time_threshold, street_time_threshold
|
||||
)
|
||||
workers_mas = []
|
||||
for worker in workers_qs:
|
||||
workers_mas.append(
|
||||
{
|
||||
"fio": worker.name,
|
||||
"sn": worker.tag.sn,
|
||||
"charge": worker.tag.charge,
|
||||
"location": worker.tag.get_zone(),
|
||||
}
|
||||
)
|
||||
res = {
|
||||
"error": "",
|
||||
"status": 0,
|
||||
"total": len(workers_mas),
|
||||
"items": workers_mas,
|
||||
}
|
||||
|
||||
return res
|
||||
@ -1,8 +0,0 @@
|
||||
from apps.eps.services.statistic.views.views_api import EpsStatisticApiView
|
||||
from apps.eps.services.statistic.views.views_page import EpsStatisticTemplateView
|
||||
from django.urls import path
|
||||
|
||||
urlpatterns = [
|
||||
path("", EpsStatisticTemplateView.as_view(), name="statistic"),
|
||||
path("workers/", EpsStatisticApiView.as_view(), name="workers_list"),
|
||||
]
|
||||
@ -1,28 +0,0 @@
|
||||
import logging
|
||||
import traceback
|
||||
from typing import Any
|
||||
|
||||
from apps.eps.services.statistic.service import EpsStatisticService
|
||||
from django.http import HttpRequest, JsonResponse
|
||||
from django.views import View
|
||||
|
||||
logger = logging.getLogger("mfss")
|
||||
|
||||
|
||||
class EpsStatisticApiView(View):
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
||||
super().__init__(*args, **kwargs)
|
||||
self.service = EpsStatisticService()
|
||||
|
||||
def get(self, request: HttpRequest) -> JsonResponse:
|
||||
try:
|
||||
data = self.service.get_workers()
|
||||
return JsonResponse(data)
|
||||
except Exception:
|
||||
logger.error(traceback.format_exc())
|
||||
return {
|
||||
"error": "server error",
|
||||
"status": -100,
|
||||
"total": 0,
|
||||
"items": [],
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
from django.views.generic import TemplateView
|
||||
from mixins.settings_context import SettingsContextMixin
|
||||
|
||||
|
||||
class EpsStatisticTemplateView(SettingsContextMixin, TemplateView):
|
||||
template_name = "eps/statistic/statistic.html"
|
||||
@ -1,34 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block nav_links %}
|
||||
<style>
|
||||
.card-title {
|
||||
font-size: 24px !important;
|
||||
}
|
||||
.card-text {
|
||||
font-size: 18px !important;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-4 col-sm-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title mb-3">История перемещения (улица)</h3>
|
||||
|
||||
<p class="card-text">
|
||||
Показывает перемещения уличного тега по глобальной карте
|
||||
</p>
|
||||
|
||||
<a href="{% url 'eps:report:street_history' %}" class="btn btn-lg btn-primary">Открыть</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-4 col-sm-6"></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
@ -1,494 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
{% load settings_tag %}
|
||||
|
||||
{% block header_link %}
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'js/duallistbox/bootstrap-duallistbox.min.css' %}?ver={% settings_value 'APP_VERSION' %}">
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'lte/plugins/daterangepicker/daterangepicker.css' %}?ver={% settings_value 'APP_VERSION' %}">
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="{% static '/openLayers/theme/default/ol.css' %}?ver={% settings_value 'APP_VERSION' %}">
|
||||
<link rel="stylesheet"
|
||||
href="{% static '/openLayers/theme/map-widgets.css' %}?ver={% settings_value 'APP_VERSION' %}">
|
||||
<link rel="stylesheet" href="{% static '/main/main.css' %}?ver={% settings_value 'APP_VERSION' %}">
|
||||
<link rel="stylesheet"
|
||||
href="{% static '/openLayers/ol-ext/ol-ext.min.css' %}?ver={% settings_value 'APP_VERSION' %}">
|
||||
<link rel="stylesheet"
|
||||
href="{% static '/openLayers/ol-ext/ol-layer-theme.css' %}?ver={% settings_value 'APP_VERSION' %}">
|
||||
<style>
|
||||
.is-invalid ~ .invalid-feedback {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.is-invalid .bootstrap-duallistbox-container {
|
||||
border: 1px solid #dc3545;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row h-100">
|
||||
<div class="col-md-5 col-sm-12">
|
||||
<form method="post" class="card card-outline h-100" novalidate>
|
||||
{% csrf_token %}
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Формирование отчета</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="verificationDateInput">Период</label>
|
||||
<input type="text" class="form-control" id="verificationDateInput">
|
||||
{{ form.date_start }}
|
||||
{{ form.date_end }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="id_workers">Сотрудники</label>
|
||||
{{ form.workers }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="submit" class="btn btn-primary" id="saveButton">
|
||||
Загрузить историю
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-7 col-sm-12">
|
||||
<div class="card card-outline h-100">
|
||||
<div class="card-body p-0" style="height: 600px;">
|
||||
<div id="map" class="w-100 h-100">
|
||||
<button type="button" id="toStart" class="btn">
|
||||
К центру
|
||||
</button>
|
||||
<div id="popup"></div>
|
||||
<div id="LayerSwitcher">
|
||||
<div class="layers-btn-container">
|
||||
<div id="layers-btn"></div>
|
||||
</div>
|
||||
<div id="LayerSwitcherInner"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block script_footer %}
|
||||
<script src="{% static 'js/duallistbox/jquery.bootstrap-duallistbox.min.js' %}"></script>
|
||||
<script src="{% static 'lte/plugins/moment/moment.min.js' %}?ver={% settings_value 'APP_VERSION' %}"></script>
|
||||
<script src="{% static 'lte/plugins/daterangepicker/daterangepicker.js' %}?ver={% settings_value 'APP_VERSION' %}"></script>
|
||||
<script src="{% static '/openLayers/lib/OpenLayers.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static '/openLayers/ol-ext/ol-ext.min.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static '/openLayers/map/map-core.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static '/openLayers/map/map-layer-switcher.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static '/openLayers/map/map-marker-manager.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static '/openLayers/map/map-created-layer-manager.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script>
|
||||
const tagDate = {% if data_json %} {{ data_json|safe }} {% else %} undefined {% endif %}
|
||||
let buildingsLayer
|
||||
let streetZonesLayer
|
||||
let historyLayer
|
||||
let historySource
|
||||
document.addEventListener("DOMContentLoaded", async () => {
|
||||
// Инициализация карты
|
||||
const mapCore = new MapCore('map', {
|
||||
center: ['{{map_center_lon}}', '{{map_center_lat}}'],
|
||||
zoom: 16
|
||||
});
|
||||
|
||||
await mapCore.initialize();
|
||||
|
||||
buildingsLayer = new ol.layer.Vector({
|
||||
source: new ol.source.Vector({
|
||||
url: '{% url 'main:building_list_api' %}',
|
||||
format: new ol.format.GeoJSON(),
|
||||
}),
|
||||
style: polygonBrownStyleFunction,
|
||||
});
|
||||
buildingsLayer.set('title', 'Здания')
|
||||
mapCore.addLayer(buildingsLayer, 'static')
|
||||
|
||||
streetZonesLayer = new ol.layer.Vector({
|
||||
source: new ol.source.Vector({
|
||||
url: '{% url 'main:sz_list_api' %}',
|
||||
format: new ol.format.GeoJSON(),
|
||||
}),
|
||||
style: polygonGrayStyleFunction,
|
||||
});
|
||||
streetZonesLayer.set('title', 'Зоны')
|
||||
mapCore.addLayer(streetZonesLayer, 'static')
|
||||
|
||||
// Кнопка возврата
|
||||
document.getElementById('toStart').addEventListener('click', () => {
|
||||
mapCore.map.getView().animate({
|
||||
center: ol.proj.fromLonLat(['{{map_center_lon}}', '{{map_center_lat}}']),
|
||||
zoom: 12
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Инициализация переключателя слоев
|
||||
const LayerSwitcherInner = document.getElementById('LayerSwitcherInner')
|
||||
const layerSwitcher = new LayerSwitcher(mapCore, LayerSwitcherInner);
|
||||
|
||||
historySource = new ol.source.Vector()
|
||||
historyLayer = new ol.layer.Vector({source: historySource, style: styleFunction});
|
||||
historyLayer.set('title', 'История перемещения')
|
||||
|
||||
if (tagDate) {
|
||||
tagDate.forEach((workerData, index) => {
|
||||
const {worker_name, tag_sn, points} = workerData;
|
||||
|
||||
if (!points || points.length === 0) return;
|
||||
|
||||
const coordinates = [];
|
||||
const colorIndex = index
|
||||
points.forEach((point) => {
|
||||
const coord = ol.proj.fromLonLat([point.lat, point.lon]);
|
||||
coordinates.push(coord);
|
||||
|
||||
const pointFeature = new ol.Feature({
|
||||
geometry: new ol.geom.Point(coord)
|
||||
});
|
||||
|
||||
// Устанавливаем атрибуты
|
||||
pointFeature.setProperties({
|
||||
name: worker_name,
|
||||
tag_sn: tag_sn,
|
||||
time: point.time // Можно также сохранить время точки
|
||||
});
|
||||
|
||||
pointFeature.set("colorIndex", colorIndex)
|
||||
|
||||
historySource.addFeature(pointFeature);
|
||||
});
|
||||
|
||||
// Создаем линию между точками
|
||||
const lineFeature = new ol.Feature({
|
||||
geometry: new ol.geom.LineString(coordinates)
|
||||
});
|
||||
|
||||
// Устанавливаем атрибуты для линии
|
||||
lineFeature.setProperties({
|
||||
name: worker_name,
|
||||
tag_sn: tag_sn
|
||||
});
|
||||
lineFeature.set("colorIndex", colorIndex)
|
||||
|
||||
historySource.addFeature(lineFeature);
|
||||
});
|
||||
|
||||
const extent = historySource.getExtent();
|
||||
if (!ol.extent.isEmpty(extent)) {
|
||||
mapCore.map.getView().fit(extent, {padding: [50, 50, 50, 50]});
|
||||
}
|
||||
}
|
||||
|
||||
mapCore.addLayer(historyLayer, 'static');
|
||||
|
||||
|
||||
function getColorByColorIndex(colorIndex) {
|
||||
const colors = ["#0d6efd", "#6f42c1", "#dc3545", "#fd7e14", "#d63384",
|
||||
"#ffc107", "#198754", "#20c997", "#0dcaf0", "#6610f2"];
|
||||
let numIndex = Number(colorIndex);
|
||||
while (numIndex >= colors.length) numIndex -= colors.length;
|
||||
return colors[numIndex];
|
||||
}
|
||||
|
||||
function styleFunction(feature) {
|
||||
const geometry = feature.getGeometry();
|
||||
const styles = [];
|
||||
const colorIndex = feature.get('colorIndex');
|
||||
const fillColor = getColorByColorIndex(colorIndex);
|
||||
|
||||
if (geometry.getType() === 'LineString') {
|
||||
// Стиль для линии
|
||||
styles.push(
|
||||
new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: fillColor,
|
||||
width: 2,
|
||||
}),
|
||||
})
|
||||
);
|
||||
|
||||
geometry.forEachSegment(function (start, end) {
|
||||
const dx = end[0] - start[0];
|
||||
const dy = end[1] - start[1];
|
||||
const rotation = Math.atan2(dy, dx);
|
||||
|
||||
// Динамически создаём SVG с нужным цветом
|
||||
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24">` +
|
||||
`<path d="M7.293 4.707 14.586 12l-7.293 7.293 1.414 1.414L17.414 12 8.707 3.293 7.293 4.707z" ` +
|
||||
`fill="${fillColor}"/></svg>`;
|
||||
|
||||
// Правильно кодируем SVG для data URI
|
||||
const encodedSvg = encodeURIComponent(svg);
|
||||
|
||||
styles.push(
|
||||
new ol.style.Style({
|
||||
geometry: new ol.geom.Point(end),
|
||||
image: new ol.style.Icon({
|
||||
src: 'data:image/svg+xml;utf8,' + encodedSvg,
|
||||
anchor: [0.9, 0.5],
|
||||
rotateWithView: true,
|
||||
rotation: -rotation,
|
||||
scale: 0.8 // Можно добавить масштаб при необходимости
|
||||
}),
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
// Стиль для текста
|
||||
styles.push(
|
||||
new ol.style.Style({
|
||||
text: new ol.style.Text({
|
||||
text: feature.get("name"),
|
||||
font: '12px Calibri,sans-serif',
|
||||
fill: new ol.style.Fill({color: '#000'}),
|
||||
stroke: new ol.style.Stroke({color: '#fff', width: 2}),
|
||||
placement: 'line',
|
||||
}),
|
||||
})
|
||||
);
|
||||
} else if (geometry.getType() === 'Point') {
|
||||
// Стиль для точки
|
||||
styles.push(
|
||||
new ol.style.Style({
|
||||
image: new ol.style.Circle({
|
||||
radius: 5,
|
||||
fill: new ol.style.Fill({color: 'white'}),
|
||||
stroke: new ol.style.Stroke({color: fillColor, width: 1}),
|
||||
}),
|
||||
})
|
||||
);
|
||||
|
||||
if (feature.get('time')) {
|
||||
styles.push(
|
||||
new ol.style.Style({
|
||||
text: new ol.style.Text({
|
||||
text: feature.get('time'),
|
||||
font: '12px Calibri,sans-serif',
|
||||
fill: new ol.style.Fill({color: '#000'}),
|
||||
stroke: new ol.style.Stroke({color: '#fff', width: 2}),
|
||||
offsetY: -15,
|
||||
}),
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return styles;
|
||||
}
|
||||
|
||||
|
||||
function polygonGrayStyleFunction(feature, resolution) {
|
||||
return new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'rgb(179,179,179)',
|
||||
width: 2,
|
||||
}),
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(202,202,202,0.6)',
|
||||
}),
|
||||
text: createStreetZoneTextStyle(feature, resolution)
|
||||
});
|
||||
}
|
||||
|
||||
function polygonBrownStyleFunction(feature, resolution) {
|
||||
return new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'rgb(199,136,10)',
|
||||
width: 2,
|
||||
}),
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(199,136,10, 0.6)',
|
||||
}),
|
||||
text: createBuildingTextStyle(feature, resolution)
|
||||
});
|
||||
}
|
||||
|
||||
function getBuildingText(feature) {
|
||||
return feature.get('name');
|
||||
}
|
||||
|
||||
function getStreetZoneText(feature) {
|
||||
return feature.get('name');
|
||||
}
|
||||
|
||||
function createBuildingTextStyle(feature, resolution) {
|
||||
const zoom = mapCore.map.getView().getZoom();
|
||||
const font = 'bold' + ' ' + zoom + 'px' + '/' + '1' + ' ' + 'Arial';
|
||||
return new ol.style.Text({
|
||||
textAlign: 'center',
|
||||
textBaseline: 'middle',
|
||||
font: font,
|
||||
text: getBuildingText(feature),
|
||||
fill: new ol.style.Fill({color: '#000'}),
|
||||
placement: 'point',
|
||||
scale: 1,
|
||||
overflow: 'false',
|
||||
});
|
||||
}
|
||||
|
||||
function createStreetZoneTextStyle(feature, resolution) {
|
||||
const zoom = mapCore.map.getView().getZoom();
|
||||
const font = 'bold' + ' ' + zoom + 'px' + '/' + '1' + ' ' + 'Arial';
|
||||
return new ol.style.Text({
|
||||
textAlign: 'center',
|
||||
textBaseline: 'middle',
|
||||
font: font,
|
||||
text: getStreetZoneText(feature),
|
||||
fill: new ol.style.Fill({color: '#000'}),
|
||||
placement: 'point',
|
||||
scale: 1,
|
||||
overflow: 'false',
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
// Initialize dual listbox
|
||||
if (typeof $.fn.bootstrapDualListbox !== 'undefined') {
|
||||
var workersListbox = $('#id_workers').bootstrapDualListbox({
|
||||
nonSelectedListLabel: 'Доступные сотрудники',
|
||||
selectedListLabel: 'Выбранные сотрудники',
|
||||
preserveSelectionOnMove: 'moved',
|
||||
moveOnSelect: false,
|
||||
infoText: 'Выбрано {0} сотрудников',
|
||||
infoTextFiltered: '<span class="badge bg-warning text-dark">Отфильтровано</span> {0} из {1}',
|
||||
filterPlaceHolder: 'Фильтр',
|
||||
filterTextClear: 'показать все',
|
||||
moveSelectedLabel: 'Выбрать',
|
||||
moveAllLabel: 'Выбрать все',
|
||||
removeSelectedLabel: 'Удалить',
|
||||
removeAllLabel: 'Удалить все',
|
||||
infoTextEmpty: 'Пусто',
|
||||
});
|
||||
|
||||
$('form').on('submit', function (e) {
|
||||
var selectedWorkers = $('#id_workers').val();
|
||||
var $dualListboxContainer = $('.bootstrap-duallistbox-container');
|
||||
|
||||
if (!selectedWorkers || selectedWorkers.length === 0) {
|
||||
e.preventDefault();
|
||||
$dualListboxContainer.addClass('is-invalid');
|
||||
if (!$dualListboxContainer.siblings('.invalid-feedback').length) {
|
||||
$dualListboxContainer.after(
|
||||
'<div class="invalid-feedback">Пожалуйста, выберите хотя бы одного сотрудника.</div>'
|
||||
);
|
||||
}
|
||||
// Scroll to the dual listbox for better UX
|
||||
$('html, body').animate({
|
||||
scrollTop: $dualListboxContainer.offset().top - 20
|
||||
}, 300);
|
||||
} else {
|
||||
// Remove invalid styling if valid
|
||||
$dualListboxContainer.removeClass('is-invalid');
|
||||
$dualListboxContainer.siblings('.invalid-feedback').remove();
|
||||
}
|
||||
});
|
||||
|
||||
$('#id_workers').on('change', function () {
|
||||
var $dualListboxContainer = $('.bootstrap-duallistbox-container');
|
||||
if ($(this).val() && $(this).val().length > 0) {
|
||||
$dualListboxContainer.removeClass('is-invalid');
|
||||
$dualListboxContainer.siblings('.invalid-feedback').remove();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.error('Плагин Dual Listbox не загружен!');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
let defaultStartDate, defaultEndDate
|
||||
{% if date_start and date_end %}
|
||||
defaultStartDate = moment('{{ date_start }}');
|
||||
defaultEndDate = moment('{{ date_end }}');
|
||||
{% else %}
|
||||
defaultStartDate = moment().subtract(3, 'days');
|
||||
defaultEndDate = moment();
|
||||
{% endif %}
|
||||
console.log(defaultStartDate)
|
||||
|
||||
$('#verificationDateInput').daterangepicker({
|
||||
startDate: defaultStartDate,
|
||||
endDate: defaultEndDate,
|
||||
maxSpan: {
|
||||
days: 7
|
||||
},
|
||||
maxDate: moment(),
|
||||
locale: {
|
||||
format: 'DD.MM.YYYY',
|
||||
applyLabel: 'Применить',
|
||||
cancelLabel: 'Отмена',
|
||||
daysOfWeek: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
|
||||
monthNames: [
|
||||
'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь',
|
||||
'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'
|
||||
],
|
||||
firstDay: 1
|
||||
},
|
||||
drops: 'auto',
|
||||
showDropdowns: true
|
||||
}, function (start, end, label) {
|
||||
// Update hidden fields when a new date range is selected
|
||||
$('#id_date_start').val(start.format('YYYY-MM-DD'));
|
||||
$('#id_date_end').val(end.format('YYYY-MM-DD'));
|
||||
console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
|
||||
});
|
||||
|
||||
// Set initial values for hidden fields on page load
|
||||
$('#id_date_start').val(defaultStartDate.format('YYYY-MM-DD'));
|
||||
$('#id_date_end').val(defaultEndDate.format('YYYY-MM-DD'));
|
||||
|
||||
// Optional: Update hidden fields when the user applies the date range
|
||||
$('#verificationDateInput').on('apply.daterangepicker', function (ev, picker) {
|
||||
$('#id_date_start').val(picker.startDate.format('YYYY-MM-DD'));
|
||||
$('#id_date_end').val(picker.endDate.format('YYYY-MM-DD'));
|
||||
console.log('Applied date range: ' + picker.startDate.format('YYYY-MM-DD') + ' to ' + picker.endDate.format('YYYY-MM-DD'));
|
||||
});
|
||||
|
||||
// Optional: Form validation to ensure dates are set
|
||||
$('form').on('submit', function (e) {
|
||||
var dateStart = $('#id_date_start').val();
|
||||
var dateEnd = $('#id_date_end').val();
|
||||
if (!dateStart || !dateEnd) {
|
||||
e.preventDefault();
|
||||
$('#verificationDateInput').addClass('is-invalid');
|
||||
if (!$('#verificationDateInput').siblings('.invalid-feedback').length) {
|
||||
$('#verificationDateInput').after(
|
||||
'<div class="invalid-feedback">Пожалуйста, выберите период.</div>'
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$('#verificationDateInput').removeClass('is-invalid');
|
||||
$('#verificationDateInput').siblings('.invalid-feedback').remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
@ -1,77 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load settings_tag %}
|
||||
|
||||
|
||||
{% block header_link %}
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'lte/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'lte/plugins/datatables-responsive/css/responsive.bootstrap4.min.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'lte/plugins/datatables-buttons/css/buttons.bootstrap4.min.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
<link rel="stylesheet" href="{% static 'eps/style.css' %}?ver={% settings_value 'APP_VERSION' %}">
|
||||
{% endblock header_link %}
|
||||
{% block form %}{% endblock %}
|
||||
{% block content_header %}{% endblock %}
|
||||
{% block manage_links %} {% endblock %}
|
||||
{% block nav_heading %}{% endblock %}
|
||||
{% block content %}
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row d-flex justify-content-center w-100 p-4">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Сотрудники ( <span id="totalWorkers">0</span>
|
||||
чел. )</h3>
|
||||
</div>
|
||||
<div class="card-body p-0 pt-2">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table id="workersTable"
|
||||
class="table table-bordered table-striped dataTable dtr-inline"
|
||||
aria-describedby="workersTable_info">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>SN</th>
|
||||
<th>ФИО</th>
|
||||
<th>Заряд</th>
|
||||
<th>Местонахождение</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-5">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
{% block script_footer %}
|
||||
<script src="{% static 'lte/plugins/datatables/jquery.dataTables.min.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static 'lte/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static 'lte/plugins/datatables-responsive/js/dataTables.responsive.min.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static 'lte/plugins/datatables-responsive/js/responsive.bootstrap4.min.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static 'lte/plugins/datatables-buttons/js/dataTables.buttons.min.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static 'lte/plugins/datatables-buttons/js/buttons.bootstrap4.min.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static 'lte/plugins/jszip/jszip.min.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static 'lte/plugins/pdfmake/pdfmake.min.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static 'lte/plugins/pdfmake/vfs_fonts.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static 'lte/plugins/datatables-buttons/js/buttons.html5.min.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static 'lte/plugins/datatables-buttons/js/buttons.print.min.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static 'lte/plugins/datatables-buttons/js/buttons.colVis.min.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<!--start Tag table configuration-->
|
||||
<script src="{% static 'js/highlight.js' %}?ver={% settings_value 'APP_VERSION' %}"></script>
|
||||
<script src="{% static 'eps/statistic/tableConfig.js' %}?ver={% settings_value 'APP_VERSION' %}"></script>
|
||||
<script src="{% static 'eps/statistic/ajax.js' %}?ver={% settings_value 'APP_VERSION' %}"></script>
|
||||
<!--end Tag table configuration-->
|
||||
{% endblock script_footer %}
|
||||
@ -1,9 +0,0 @@
|
||||
from django.urls import include, path
|
||||
|
||||
app_name = "eps"
|
||||
|
||||
urlpatterns = [
|
||||
path("statistic/", include("apps.eps.services.statistic.urls")),
|
||||
path("hardware/", include("apps.eps.services.hardware.urls")),
|
||||
path("report/", include("apps.eps.services.report.urls"), name="report"),
|
||||
]
|
||||
@ -1,6 +0,0 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class InternalPosConfig(AppConfig):
|
||||
default_auto_field = "django.db.models.BigAutoField"
|
||||
name = "apps.internal_pos"
|
||||
@ -1,17 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load settings_tag %}
|
||||
{% block header_link %}
|
||||
<link rel="stylesheet" href="{% static 'internal_pos/style.css' %}?ver={% settings_value 'APP_VERSION' %}">
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content_wrapper %}
|
||||
<div class="content-wrapper h-100">
|
||||
<iframe src="/static/position/index.html"
|
||||
tabindex=0 class="w-100" id="Position">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@ -1,5 +0,0 @@
|
||||
from apps.internal_pos.views import InternalPositioningView
|
||||
from django.urls import path
|
||||
|
||||
app_name = "internal_pos"
|
||||
urlpatterns = [path("", InternalPositioningView.as_view(), name="index")]
|
||||
@ -1,5 +0,0 @@
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
|
||||
class InternalPositioningView(TemplateView):
|
||||
template_name = "internal_pos/index.html"
|
||||
@ -1,20 +0,0 @@
|
||||
from apps.main.models.model_building import Building
|
||||
from apps.main.models.model_ortho import Ortho
|
||||
from apps.main.models.model_street_zone import StreetZone
|
||||
from django.contrib.gis import admin
|
||||
from django.contrib.gis.admin import GISModelAdmin
|
||||
|
||||
|
||||
@admin.register(Building)
|
||||
class BuildingAdmin(GISModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
@admin.register(StreetZone)
|
||||
class StreetZoneAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
@admin.register(Ortho)
|
||||
class OrtoAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
@ -1,7 +0,0 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class MainConfig(AppConfig):
|
||||
default_auto_field = "django.db.models.BigAutoField"
|
||||
name = "apps.main"
|
||||
verbose_name = "Главная"
|
||||
@ -1,44 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-04-03 08:27
|
||||
|
||||
import django.contrib.gis.db.models.fields
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
("eps", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="Building",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=128)),
|
||||
(
|
||||
"polygon",
|
||||
django.contrib.gis.db.models.fields.PolygonField(srid=4326),
|
||||
),
|
||||
("active", models.BooleanField(default=True)),
|
||||
("zones", models.ManyToManyField(blank=True, to="eps.zone")),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "здание",
|
||||
"verbose_name_plural": "здания",
|
||||
"ordering": ["name"],
|
||||
"indexes": [
|
||||
models.Index(fields=["name"], name="main_buildi_name_fa2f31_idx")
|
||||
],
|
||||
},
|
||||
),
|
||||
]
|
||||
@ -1,42 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-04-07 09:12
|
||||
|
||||
import django.contrib.gis.db.models.fields
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("main", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="StreetZone",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=128)),
|
||||
(
|
||||
"polygon",
|
||||
django.contrib.gis.db.models.fields.PolygonField(srid=4326),
|
||||
),
|
||||
("active", models.BooleanField(default=True)),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "уличная зона",
|
||||
"verbose_name_plural": "уличные зоны",
|
||||
"ordering": ["name"],
|
||||
"indexes": [
|
||||
models.Index(fields=["name"], name="main_street_name_1a1e69_idx")
|
||||
],
|
||||
},
|
||||
),
|
||||
]
|
||||
@ -1,53 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-05-05 10:17
|
||||
|
||||
import django.contrib.gis.db.models.fields
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("main", "0002_streetzone"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="Orto",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=128, verbose_name="Наименование")),
|
||||
(
|
||||
"raster",
|
||||
django.contrib.gis.db.models.fields.RasterField(
|
||||
srid=4326, verbose_name=".tif файл"
|
||||
),
|
||||
),
|
||||
(
|
||||
"tiles_path",
|
||||
models.FilePathField(
|
||||
allow_files=False,
|
||||
allow_folders=True,
|
||||
blank=True,
|
||||
null=True,
|
||||
verbose_name="Каталог",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "ортофотоплан",
|
||||
"verbose_name_plural": "ортофотопланы",
|
||||
"ordering": ["name"],
|
||||
"indexes": [
|
||||
models.Index(fields=["name"], name="main_orto_name_39c2d3_idx")
|
||||
],
|
||||
},
|
||||
),
|
||||
]
|
||||
@ -1,58 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-05-06 02:15
|
||||
|
||||
import django.contrib.gis.db.models.fields
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("main", "0003_orto"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="Ortho",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=128, verbose_name="Наименование")),
|
||||
(
|
||||
"raster",
|
||||
django.contrib.gis.db.models.fields.RasterField(
|
||||
srid=4326, verbose_name=".tif файл"
|
||||
),
|
||||
),
|
||||
(
|
||||
"tiles_path",
|
||||
models.FilePathField(
|
||||
allow_files=False,
|
||||
allow_folders=True,
|
||||
blank=True,
|
||||
null=True,
|
||||
path="D:\\Projects\\positioning\\media\\ortos",
|
||||
verbose_name="Каталог",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "ортофотоплан",
|
||||
"verbose_name_plural": "ортофотопланы",
|
||||
"ordering": ["name"],
|
||||
},
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name="Orto",
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="ortho",
|
||||
index=models.Index(fields=["name"], name="main_ortho_name_ff77f0_idx"),
|
||||
),
|
||||
]
|
||||
@ -1,30 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-05-06 02:48
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("main", "0004_ortho_delete_orto_ortho_main_ortho_name_ff77f0_idx"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="ortho",
|
||||
name="active",
|
||||
field=models.BooleanField(default=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="ortho",
|
||||
name="tiles_path",
|
||||
field=models.FilePathField(
|
||||
allow_files=False,
|
||||
allow_folders=True,
|
||||
blank=True,
|
||||
null=True,
|
||||
path="D:\\Projects\\positioning\\media\\orthos",
|
||||
verbose_name="Каталог",
|
||||
),
|
||||
),
|
||||
]
|
||||
@ -1,18 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-05-06 05:50
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("main", "0005_ortho_active_alter_ortho_tiles_path"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="ortho",
|
||||
name="tiles_path",
|
||||
field=models.CharField(blank=True, null=True, verbose_name="Путь"),
|
||||
),
|
||||
]
|
||||
@ -1,45 +0,0 @@
|
||||
# Generated by Django 4.2.19 on 2025-05-06 05:54
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("main", "0006_alter_ortho_tiles_path"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name="ortho",
|
||||
name="raster",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="ortho",
|
||||
name="max_lat",
|
||||
field=models.FloatField(
|
||||
blank=True, null=True, verbose_name="Extent (max_lat)"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="ortho",
|
||||
name="max_lon",
|
||||
field=models.FloatField(
|
||||
blank=True, null=True, verbose_name="Extent (max_lon)"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="ortho",
|
||||
name="min_lat",
|
||||
field=models.FloatField(
|
||||
blank=True, null=True, verbose_name="Extent (min_lat)"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="ortho",
|
||||
name="min_lon",
|
||||
field=models.FloatField(
|
||||
blank=True, null=True, verbose_name="Extent (min_lon)"
|
||||
),
|
||||
),
|
||||
]
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user