simple-module-dashboard 0.0.43__tar.gz → 0.0.44__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/PKG-INFO +4 -4
- simple_module_dashboard-0.0.44/dashboard/core/__init__.py +1 -0
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/dashboard/module.py +4 -4
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/dashboard/pages/Doctor.tsx +9 -9
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/dashboard/pages/Home.tsx +2 -2
- simple_module_dashboard-0.0.44/dashboard/web/__init__.py +1 -0
- {simple_module_dashboard-0.0.43/dashboard → simple_module_dashboard-0.0.44/dashboard/web}/endpoints/api.py +2 -2
- {simple_module_dashboard-0.0.43/dashboard → simple_module_dashboard-0.0.44/dashboard/web}/endpoints/views.py +3 -3
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/package.json +1 -1
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/pyproject.toml +4 -4
- {simple_module_dashboard-0.0.43/tests → simple_module_dashboard-0.0.44/tests/core/module}/test_dashboard.py +2 -2
- {simple_module_dashboard-0.0.43/tests → simple_module_dashboard-0.0.44/tests/web/doctor}/test_doctor_migration_chips.py +1 -1
- {simple_module_dashboard-0.0.43/tests → simple_module_dashboard-0.0.44/tests/web/doctor}/test_doctor_props.py +2 -2
- {simple_module_dashboard-0.0.43/tests → simple_module_dashboard-0.0.44/tests/web/endpoints}/test_dashboard_permission.py +2 -2
- {simple_module_dashboard-0.0.43/tests → simple_module_dashboard-0.0.44/tests/web/stats}/test_dashboard_month_delta.py +1 -1
- {simple_module_dashboard-0.0.43/tests → simple_module_dashboard-0.0.44/tests/web/stats}/test_dashboard_single_tenant.py +3 -3
- {simple_module_dashboard-0.0.43/tests → simple_module_dashboard-0.0.44/tests/web/stats}/test_dashboard_user_directory.py +2 -2
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/tests-js/dashboard_Doctor.test.tsx +1 -1
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/tests-js/doctor-stats.test.tsx +3 -3
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/.gitignore +0 -0
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/LICENSE +0 -0
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/README.md +0 -0
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/dashboard/__init__.py +0 -0
- {simple_module_dashboard-0.0.43/dashboard → simple_module_dashboard-0.0.44/dashboard/core}/constants.py +0 -0
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/dashboard/locales/de.json +0 -0
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/dashboard/locales/en.json +0 -0
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/dashboard/locales/es.json +0 -0
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/dashboard/py.typed +0 -0
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/dashboard/styles.css +0 -0
- {simple_module_dashboard-0.0.43/dashboard/pages → simple_module_dashboard-0.0.44/dashboard/ui}/components/ModuleTile.tsx +0 -0
- {simple_module_dashboard-0.0.43/dashboard/pages → simple_module_dashboard-0.0.44/dashboard/ui}/components/doctor/ChecksCard.tsx +0 -0
- {simple_module_dashboard-0.0.43/dashboard/pages → simple_module_dashboard-0.0.44/dashboard/ui}/components/doctor/DevServerCard.tsx +0 -0
- {simple_module_dashboard-0.0.43/dashboard/pages → simple_module_dashboard-0.0.44/dashboard/ui}/components/doctor/MigrationsCard.tsx +0 -0
- {simple_module_dashboard-0.0.43/dashboard/pages → simple_module_dashboard-0.0.44/dashboard/ui}/components/doctor/StatsRow.tsx +0 -0
- {simple_module_dashboard-0.0.43/dashboard/pages → simple_module_dashboard-0.0.44/dashboard/ui}/components/doctor/TerminalPanel.tsx +0 -0
- {simple_module_dashboard-0.0.43/dashboard/pages → simple_module_dashboard-0.0.44/dashboard/ui}/components/doctor/check-copy.ts +0 -0
- {simple_module_dashboard-0.0.43/dashboard/pages → simple_module_dashboard-0.0.44/dashboard/ui}/components/doctor/copy.ts +0 -0
- {simple_module_dashboard-0.0.43/dashboard/pages → simple_module_dashboard-0.0.44/dashboard/ui}/components/doctor/report.ts +0 -0
- {simple_module_dashboard-0.0.43/dashboard/pages → simple_module_dashboard-0.0.44/dashboard/ui}/components/doctor/types.ts +0 -0
- {simple_module_dashboard-0.0.43/dashboard/pages → simple_module_dashboard-0.0.44/dashboard/ui}/components/module-target.ts +0 -0
- {simple_module_dashboard-0.0.43/dashboard → simple_module_dashboard-0.0.44/dashboard/web}/doctor.py +0 -0
- {simple_module_dashboard-0.0.43/dashboard → simple_module_dashboard-0.0.44/dashboard/web}/endpoints/__init__.py +0 -0
- {simple_module_dashboard-0.0.43/dashboard → simple_module_dashboard-0.0.44/dashboard/web}/stats.py +0 -0
- /simple_module_dashboard-0.0.43/tests/test_view_routes.py → /simple_module_dashboard-0.0.44/tests/web/endpoints/test_dashboard_view_routes.py +0 -0
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/tests-js/dashboard_Doctor_errors.test.tsx +0 -0
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/tests-js/dashboard_Home.test.tsx +0 -0
- {simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/tsconfig.json +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: simple_module_dashboard
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.44
|
|
4
4
|
Summary: Admin landing page and sidebar menu host for authenticated users of a simple_module app
|
|
5
5
|
Project-URL: Homepage, https://github.com/antosubash/simple_module_python
|
|
6
6
|
Project-URL: Repository, https://github.com/antosubash/simple_module_python
|
|
@@ -21,9 +21,9 @@ Classifier: Topic :: Internet :: WWW/HTTP
|
|
|
21
21
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
22
22
|
Classifier: Typing :: Typed
|
|
23
23
|
Requires-Python: >=3.12
|
|
24
|
-
Requires-Dist: simple-module-core==0.0.
|
|
25
|
-
Requires-Dist: simple-module-db==0.0.
|
|
26
|
-
Requires-Dist: simple-module-hosting==0.0.
|
|
24
|
+
Requires-Dist: simple-module-core==0.0.44
|
|
25
|
+
Requires-Dist: simple-module-db==0.0.44
|
|
26
|
+
Requires-Dist: simple-module-hosting==0.0.44
|
|
27
27
|
Description-Content-Type: text/markdown
|
|
28
28
|
|
|
29
29
|
# simple_module_dashboard
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""What the dashboard builds on: its constants."""
|
|
@@ -10,7 +10,7 @@ from simple_module_core.menu import MenuItem, MenuRegistry, MenuSection
|
|
|
10
10
|
from simple_module_core.module import ModuleBase, ModuleMeta
|
|
11
11
|
from simple_module_core.permissions import PermissionRegistry
|
|
12
12
|
|
|
13
|
-
from dashboard.constants import PERM_GROUP, PERM_VIEW
|
|
13
|
+
from dashboard.core.constants import PERM_GROUP, PERM_VIEW
|
|
14
14
|
|
|
15
15
|
_URL_DASHBOARD = "/dashboard/"
|
|
16
16
|
_URL_DOCTOR = "/admin/doctor/"
|
|
@@ -29,14 +29,14 @@ class DashboardModule(ModuleBase):
|
|
|
29
29
|
)
|
|
30
30
|
|
|
31
31
|
def register_routes(self, api_router: APIRouter, view_router: APIRouter) -> None:
|
|
32
|
-
from dashboard.endpoints.api import router as api
|
|
33
|
-
from dashboard.endpoints.views import router as views
|
|
32
|
+
from dashboard.web.endpoints.api import router as api
|
|
33
|
+
from dashboard.web.endpoints.views import router as views
|
|
34
34
|
|
|
35
35
|
api_router.include_router(api)
|
|
36
36
|
view_router.include_router(views)
|
|
37
37
|
|
|
38
38
|
def register_admin_routes(self, admin_router: APIRouter) -> None:
|
|
39
|
-
from dashboard.endpoints.views import admin_router as doctor_views
|
|
39
|
+
from dashboard.web.endpoints.views import admin_router as doctor_views
|
|
40
40
|
|
|
41
41
|
admin_router.include_router(doctor_views)
|
|
42
42
|
|
{simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/dashboard/pages/Doctor.tsx
RENAMED
|
@@ -5,15 +5,15 @@ import { Button } from '@simple-module-py/ui/components/ui/button';
|
|
|
5
5
|
import { AdminLayout } from '@simple-module-py/ui/layouts/AdminLayout';
|
|
6
6
|
import { RefreshCw } from 'lucide-react';
|
|
7
7
|
import { toast } from 'sonner';
|
|
8
|
-
import { ChecksCard } from '
|
|
9
|
-
import { useCheckLabels } from '
|
|
10
|
-
import { copyToClipboard } from '
|
|
11
|
-
import { DevServerCard } from '
|
|
12
|
-
import { MigrationsCard } from '
|
|
13
|
-
import { buildDoctorReport } from '
|
|
14
|
-
import { StatsRow } from '
|
|
15
|
-
import { TerminalPanel } from '
|
|
16
|
-
import type { DoctorProps } from '
|
|
8
|
+
import { ChecksCard } from '../ui/components/doctor/ChecksCard';
|
|
9
|
+
import { useCheckLabels } from '../ui/components/doctor/check-copy';
|
|
10
|
+
import { copyToClipboard } from '../ui/components/doctor/copy';
|
|
11
|
+
import { DevServerCard } from '../ui/components/doctor/DevServerCard';
|
|
12
|
+
import { MigrationsCard } from '../ui/components/doctor/MigrationsCard';
|
|
13
|
+
import { buildDoctorReport } from '../ui/components/doctor/report';
|
|
14
|
+
import { StatsRow } from '../ui/components/doctor/StatsRow';
|
|
15
|
+
import { TerminalPanel } from '../ui/components/doctor/TerminalPanel';
|
|
16
|
+
import type { DoctorProps } from '../ui/components/doctor/types';
|
|
17
17
|
|
|
18
18
|
const RERUN_URL = '/admin/doctor/rerun';
|
|
19
19
|
|
|
@@ -6,8 +6,8 @@ import { Card, CardContent } from '@simple-module-py/ui/components/ui/card';
|
|
|
6
6
|
import { usePageProps } from '@simple-module-py/ui/hooks/usePageProps';
|
|
7
7
|
import { AuthenticatedLayout } from '@simple-module-py/ui/layouts/AuthenticatedLayout';
|
|
8
8
|
import { Activity, Box, Stethoscope, Users } from 'lucide-react';
|
|
9
|
-
import { type ModuleHealth, ModuleTile } from '
|
|
10
|
-
import { moduleTargetResolver } from '
|
|
9
|
+
import { type ModuleHealth, ModuleTile } from '../ui/components/ModuleTile';
|
|
10
|
+
import { moduleTargetResolver } from '../ui/components/module-target';
|
|
11
11
|
|
|
12
12
|
interface SystemModule {
|
|
13
13
|
name: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""The HTTP side: the home and doctor endpoints and the stats and doctor reads they share."""
|
|
@@ -7,8 +7,8 @@ from simple_module_db.deps import get_db
|
|
|
7
7
|
from simple_module_hosting.permissions import RequiresPermission
|
|
8
8
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
9
9
|
|
|
10
|
-
from dashboard.constants import PERM_VIEW
|
|
11
|
-
from dashboard.stats import fetch_dashboard_stats
|
|
10
|
+
from dashboard.core.constants import PERM_VIEW
|
|
11
|
+
from dashboard.web.stats import fetch_dashboard_stats
|
|
12
12
|
|
|
13
13
|
router = APIRouter()
|
|
14
14
|
|
|
@@ -18,8 +18,8 @@ from simple_module_inertia import InertiaResponse
|
|
|
18
18
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
19
19
|
from starlette.responses import RedirectResponse
|
|
20
20
|
|
|
21
|
-
from dashboard.constants import PERM_VIEW
|
|
22
|
-
from dashboard.stats import fetch_dashboard_stats
|
|
21
|
+
from dashboard.core.constants import PERM_VIEW
|
|
22
|
+
from dashboard.web.stats import fetch_dashboard_stats
|
|
23
23
|
|
|
24
24
|
router = APIRouter()
|
|
25
25
|
|
|
@@ -66,7 +66,7 @@ async def dashboard(
|
|
|
66
66
|
@admin_router.get("/", response_model=None)
|
|
67
67
|
async def doctor(request: Request, inertia: InertiaDep) -> InertiaResponse:
|
|
68
68
|
"""`make doctor` mirror — checks, migrations, dev server, all live."""
|
|
69
|
-
from dashboard.doctor import doctor_props
|
|
69
|
+
from dashboard.web.doctor import doctor_props
|
|
70
70
|
|
|
71
71
|
# doctor_props walks the alembic script directory and every module's pages
|
|
72
72
|
# dir, so it is blocking filesystem work: keep it off the event loop rather
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "simple_module_dashboard"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.44"
|
|
4
4
|
description = "Admin landing page and sidebar menu host for authenticated users of a simple_module app"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
@@ -21,9 +21,9 @@ classifiers = [
|
|
|
21
21
|
"Typing :: Typed",
|
|
22
22
|
]
|
|
23
23
|
dependencies = [
|
|
24
|
-
"simple_module_core==0.0.
|
|
25
|
-
"simple_module_db==0.0.
|
|
26
|
-
"simple_module_hosting==0.0.
|
|
24
|
+
"simple_module_core==0.0.44",
|
|
25
|
+
"simple_module_db==0.0.44",
|
|
26
|
+
"simple_module_hosting==0.0.44",
|
|
27
27
|
]
|
|
28
28
|
|
|
29
29
|
[project.entry-points.simple_module]
|
|
@@ -5,7 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
import httpx
|
|
6
6
|
import pytest
|
|
7
7
|
from dashboard.module import DashboardModule
|
|
8
|
-
from dashboard.stats import invalidate_stats_cache
|
|
8
|
+
from dashboard.web.stats import invalidate_stats_cache
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
@pytest.fixture(autouse=True)
|
|
@@ -35,7 +35,7 @@ class TestDashboardModuleRegistration:
|
|
|
35
35
|
class TestFetchDashboardStats:
|
|
36
36
|
@pytest.fixture
|
|
37
37
|
async def stats(self, app):
|
|
38
|
-
from dashboard.stats import fetch_dashboard_stats
|
|
38
|
+
from dashboard.web.stats import fetch_dashboard_stats
|
|
39
39
|
|
|
40
40
|
async with app.state.sm.db.session_factory() as db:
|
|
41
41
|
return await fetch_dashboard_stats(db, app)
|
|
@@ -13,8 +13,8 @@ from types import SimpleNamespace
|
|
|
13
13
|
|
|
14
14
|
import httpx
|
|
15
15
|
import pytest
|
|
16
|
-
from dashboard.doctor import CHECKS, MIGRATION_CHECK_ID
|
|
17
|
-
from dashboard.stats import invalidate_stats_cache
|
|
16
|
+
from dashboard.web.doctor import CHECKS, MIGRATION_CHECK_ID
|
|
17
|
+
from dashboard.web.stats import invalidate_stats_cache
|
|
18
18
|
from simple_module_core.diagnostics import Diagnostic, DiagnosticLevel
|
|
19
19
|
from simple_module_test.fixtures import forge_session_cookie
|
|
20
20
|
|
|
@@ -8,8 +8,8 @@ stats therefore need ``dashboard.view``, which only the platform ``admin``
|
|
|
8
8
|
from __future__ import annotations
|
|
9
9
|
|
|
10
10
|
import pytest
|
|
11
|
-
from dashboard.constants import PERM_VIEW
|
|
12
|
-
from dashboard.stats import invalidate_stats_cache
|
|
11
|
+
from dashboard.core.constants import PERM_VIEW
|
|
12
|
+
from dashboard.web.stats import invalidate_stats_cache
|
|
13
13
|
from simple_module_core.tenancy import TenantRole, tenant_role
|
|
14
14
|
|
|
15
15
|
_STATS = "/api/dashboard/stats"
|
|
@@ -12,7 +12,7 @@ from datetime import UTC, datetime, timedelta
|
|
|
12
12
|
|
|
13
13
|
import httpx
|
|
14
14
|
import pytest
|
|
15
|
-
from dashboard.stats import fetch_dashboard_stats, invalidate_stats_cache
|
|
15
|
+
from dashboard.web.stats import fetch_dashboard_stats, invalidate_stats_cache
|
|
16
16
|
from users.models import User
|
|
17
17
|
|
|
18
18
|
|
|
@@ -9,8 +9,8 @@ dashboard still renders for everyone as the post-login landing page.
|
|
|
9
9
|
from __future__ import annotations
|
|
10
10
|
|
|
11
11
|
import pytest
|
|
12
|
-
from dashboard.constants import PERM_VIEW
|
|
13
|
-
from dashboard.stats import invalidate_stats_cache
|
|
12
|
+
from dashboard.core.constants import PERM_VIEW
|
|
13
|
+
from dashboard.web.stats import invalidate_stats_cache
|
|
14
14
|
from simple_module_hosting.settings import Settings
|
|
15
15
|
from simple_module_test.tenant_client import session_client
|
|
16
16
|
|
|
@@ -35,7 +35,7 @@ def test_user_role_is_not_mapped_to_dashboard_view(app):
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
async def _plain_user(app) -> str:
|
|
38
|
-
from users.bootstrap import create_standard_user
|
|
38
|
+
from users.core.bootstrap import create_standard_user
|
|
39
39
|
|
|
40
40
|
async with app.state.sm.db.session_factory() as session:
|
|
41
41
|
result = await create_standard_user(session, email="plain@example.com", password="x" * 12)
|
|
@@ -15,7 +15,7 @@ from simple_module_core.user_directory import (
|
|
|
15
15
|
|
|
16
16
|
@pytest.fixture(autouse=True)
|
|
17
17
|
def _fresh_cache():
|
|
18
|
-
from dashboard.stats import invalidate_stats_cache
|
|
18
|
+
from dashboard.web.stats import invalidate_stats_cache
|
|
19
19
|
|
|
20
20
|
invalidate_stats_cache()
|
|
21
21
|
yield
|
|
@@ -34,7 +34,7 @@ class _KeycloakLike(NullUserDirectory):
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
async def _stats(app) -> dict:
|
|
37
|
-
from dashboard.stats import fetch_dashboard_stats
|
|
37
|
+
from dashboard.web.stats import fetch_dashboard_stats
|
|
38
38
|
|
|
39
39
|
async with app.state.sm.db.session_factory() as db:
|
|
40
40
|
return await fetch_dashboard_stats(db, app)
|
{simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/tests-js/dashboard_Doctor.test.tsx
RENAMED
|
@@ -10,8 +10,8 @@ vi.mock('@inertiajs/react', () => ({
|
|
|
10
10
|
usePage: () => ({ props: {} }),
|
|
11
11
|
}));
|
|
12
12
|
|
|
13
|
-
import type { DoctorProps } from '../dashboard/pages/components/doctor/types';
|
|
14
13
|
import Doctor from '../dashboard/pages/Doctor';
|
|
14
|
+
import type { DoctorProps } from '../dashboard/ui/components/doctor/types';
|
|
15
15
|
|
|
16
16
|
const props: DoctorProps = {
|
|
17
17
|
checks: [{ id: 'pages', status: 'pass', command: null, findings: [] }],
|
{simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/tests-js/doctor-stats.test.tsx
RENAMED
|
@@ -15,9 +15,9 @@ configureI18n({
|
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
import { buildDoctorReport } from '../dashboard/
|
|
19
|
-
import { StatsRow } from '../dashboard/
|
|
20
|
-
import type { DoctorProps } from '../dashboard/
|
|
18
|
+
import { buildDoctorReport } from '../dashboard/ui/components/doctor/report';
|
|
19
|
+
import { StatsRow } from '../dashboard/ui/components/doctor/StatsRow';
|
|
20
|
+
import type { DoctorProps } from '../dashboard/ui/components/doctor/types';
|
|
21
21
|
|
|
22
22
|
const STATS = {
|
|
23
23
|
checks_passing: 0,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_module_dashboard-0.0.43/dashboard → simple_module_dashboard-0.0.44/dashboard/web}/doctor.py
RENAMED
|
File without changes
|
|
File without changes
|
{simple_module_dashboard-0.0.43/dashboard → simple_module_dashboard-0.0.44/dashboard/web}/stats.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_module_dashboard-0.0.43 → simple_module_dashboard-0.0.44}/tests-js/dashboard_Home.test.tsx
RENAMED
|
File without changes
|
|
File without changes
|