fix: resolve static files and import issues
- Fix static files not loading due to volume mount conflict - Remove problematic volume mount from docker-compose.yml - Add __init__.py files to make Python packages - Fix all import statements to use relative imports - Update start.sh to use correct module name - Update config.py with correct default paths and values - Ensure all environment variables are properly loaded from .env file
This commit is contained in:
7
app/api/__init__.py
Normal file
7
app/api/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
LogBoard+ - API модули приложения
|
||||
Автор: Сергей Антропов
|
||||
Сайт: https://devops.org.ru
|
||||
"""
|
||||
7
app/api/v1/__init__.py
Normal file
7
app/api/v1/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
LogBoard+ - API v1 модули приложения
|
||||
Автор: Сергей Антропов
|
||||
Сайт: https://devops.org.ru
|
||||
"""
|
||||
7
app/api/v1/endpoints/__init__.py
Normal file
7
app/api/v1/endpoints/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
LogBoard+ - API endpoints модули приложения
|
||||
Автор: Сергей Антропов
|
||||
Сайт: https://devops.org.ru
|
||||
"""
|
||||
@@ -12,14 +12,14 @@ from typing import Optional
|
||||
from fastapi import APIRouter, Depends, HTTPException, status, Response
|
||||
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
||||
|
||||
from app.core.auth import (
|
||||
from core.auth import (
|
||||
authenticate_user,
|
||||
create_access_token,
|
||||
verify_token,
|
||||
get_current_user,
|
||||
ACCESS_TOKEN_EXPIRE_MINUTES
|
||||
)
|
||||
from app.models.auth import UserLogin, Token
|
||||
from models.auth import UserLogin, Token
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ from typing import List, Optional
|
||||
from fastapi import APIRouter, Depends, HTTPException, Query, Body
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
from app.core.auth import get_current_user
|
||||
from app.core.docker import (
|
||||
from core.auth import get_current_user
|
||||
from core.docker import (
|
||||
load_excluded_containers,
|
||||
save_excluded_containers,
|
||||
get_all_projects,
|
||||
|
||||
@@ -15,9 +15,9 @@ from fastapi.responses import JSONResponse
|
||||
|
||||
import docker
|
||||
|
||||
from app.core.auth import get_current_user
|
||||
from app.core.docker import docker_client, DEFAULT_TAIL
|
||||
from app.core.logger import api_logger
|
||||
from core.auth import get_current_user
|
||||
from core.docker import docker_client, DEFAULT_TAIL
|
||||
from core.logger import api_logger
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -206,7 +206,7 @@ def api_snapshot(
|
||||
):
|
||||
"""Сохранить снимок логов"""
|
||||
import os
|
||||
from app.core.config import SNAP_DIR
|
||||
from core.config import SNAP_DIR
|
||||
|
||||
# Save posted content as a snapshot file
|
||||
safe_service = re.sub(r"[^a-zA-Z0-9_.-]+", "_", service or container_id[:12])
|
||||
|
||||
@@ -9,8 +9,8 @@ LogBoard+ - Страницы API
|
||||
from fastapi import APIRouter, Request, Depends, HTTPException
|
||||
from fastapi.responses import HTMLResponse, RedirectResponse, PlainTextResponse
|
||||
|
||||
from app.core.auth import verify_token, get_current_user
|
||||
from app.core.config import templates, AJAX_UPDATE_INTERVAL, DEFAULT_TAIL, SKIP_UNHEALTHY
|
||||
from core.auth import verify_token, get_current_user
|
||||
from core.config import templates, AJAX_UPDATE_INTERVAL, DEFAULT_TAIL, SKIP_UNHEALTHY
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ LogBoard+ - Настройки API
|
||||
|
||||
from fastapi import APIRouter, Depends
|
||||
|
||||
from app.core.auth import get_current_user
|
||||
from app.core.config import AJAX_UPDATE_INTERVAL, DEFAULT_TAIL, SKIP_UNHEALTHY
|
||||
from core.auth import get_current_user
|
||||
from core.config import AJAX_UPDATE_INTERVAL, DEFAULT_TAIL, SKIP_UNHEALTHY
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -12,9 +12,9 @@ from typing import Optional
|
||||
from fastapi import APIRouter, WebSocket, WebSocketDisconnect, Query, Depends
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
from app.core.auth import verify_token, get_current_user
|
||||
from app.core.docker import docker_client, DEFAULT_TAIL
|
||||
from app.core.logger import websocket_logger
|
||||
from core.auth import verify_token, get_current_user
|
||||
from core.docker import docker_client, DEFAULT_TAIL
|
||||
from core.logger import websocket_logger
|
||||
from datetime import datetime
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
Reference in New Issue
Block a user