Compare commits

3 Commits

4 changed files with 13 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ from __future__ import annotations
from govoplan_core.core.access import CAPABILITY_AUTH_PERMISSION_EVALUATOR, CAPABILITY_AUTH_PRINCIPAL_RESOLVER from govoplan_core.core.access import CAPABILITY_AUTH_PERMISSION_EVALUATOR, CAPABILITY_AUTH_PRINCIPAL_RESOLVER
from govoplan_core.core.modules import FrontendModule, FrontendRoute, ModuleContext, ModuleManifest, NavItem, PermissionDefinition, RoleTemplate from govoplan_core.core.modules import FrontendModule, FrontendRoute, ModuleContext, ModuleManifest, NavItem, PermissionDefinition, RoleTemplate
from govoplan_core.core.views import ViewSurface
OPS_READ_SCOPE = "ops:operations:read" OPS_READ_SCOPE = "ops:operations:read"
OPS_READ_SCOPES = (OPS_READ_SCOPE, "system:settings:read", "admin:settings:read") OPS_READ_SCOPES = (OPS_READ_SCOPE, "system:settings:read", "admin:settings:read")
@@ -57,6 +58,9 @@ manifest = ModuleManifest(
package_name="@govoplan/ops-webui", package_name="@govoplan/ops-webui",
routes=(FrontendRoute(path="/ops", component="OpsPage", required_any=OPS_READ_SCOPES, order=890),), routes=(FrontendRoute(path="/ops", component="OpsPage", required_any=OPS_READ_SCOPES, order=890),),
nav_items=(NavItem(path="/ops", label="Ops", icon="activity", required_any=OPS_READ_SCOPES, order=890),), nav_items=(NavItem(path="/ops", label="Ops", icon="activity", required_any=OPS_READ_SCOPES, order=890),),
view_surfaces=(
ViewSurface(id="ops.widget.health", module_id="ops", kind="section", label="Operations health widget", order=100),
),
), ),
) )

View File

@@ -17,7 +17,7 @@
"lucide-react": "^1.23.0", "lucide-react": "^1.23.0",
"react": "^19.0.0", "react": "^19.0.0",
"react-dom": "^19.0.0", "react-dom": "^19.0.0",
"react-router-dom": "^7.1.1", "react-router-dom": ">=7.18.2 <8",
"@vitejs/plugin-react": "^4.3.4", "@vitejs/plugin-react": "^4.3.4",
"typescript": "^5.7.2", "typescript": "^5.7.2",
"vite": "^6.0.6" "vite": "^6.0.6"

View File

@@ -7,6 +7,7 @@ import {
DismissibleAlert, DismissibleAlert,
LoadingFrame, LoadingFrame,
MetricCard, MetricCard,
PageScrollViewport,
PageTitle, PageTitle,
StatusBadge, StatusBadge,
adminErrorMessage, adminErrorMessage,
@@ -40,6 +41,7 @@ export default function OpsPage({ settings }: {settings: ApiSettings;}) {
const ready = status?.readiness.ready ?? false; const ready = status?.readiness.ready ?? false;
return ( return (
<PageScrollViewport>
<div className="content-pad workspace-data-page"> <div className="content-pad workspace-data-page">
<div className="page-heading split workspace-heading"> <div className="page-heading split workspace-heading">
<div> <div>
@@ -77,7 +79,8 @@ export default function OpsPage({ settings }: {settings: ApiSettings;}) {
</Card> </Card>
</div> </div>
</LoadingFrame> </LoadingFrame>
</div>); </div>
</PageScrollViewport>);
} }

View File

@@ -14,6 +14,7 @@ const dashboardWidgets: DashboardWidgetsUiCapability = {
widgets: [ widgets: [
{ {
id: "ops.health", id: "ops.health",
surfaceId: "ops.widget.health",
title: "Operations health", title: "Operations health",
description: "Readiness, worker mode, and current warning count.", description: "Readiness, worker mode, and current warning count.",
moduleId: "ops", moduleId: "ops",
@@ -34,6 +35,9 @@ export const opsModule: PlatformWebModule = {
dependencies: ["access"], dependencies: ["access"],
optionalDependencies: ["audit", "docs", "notifications"], optionalDependencies: ["audit", "docs", "notifications"],
translations, translations,
viewSurfaces: [
{ id: "ops.widget.health", moduleId: "ops", kind: "section", label: "Operations health widget", order: 100 }
],
navItems: [{ to: "/ops", label: "i18n:govoplan-ops.ops.907a54c2", iconName: "activity", anyOf: opsReadScopes, order: 890 }], navItems: [{ to: "/ops", label: "i18n:govoplan-ops.ops.907a54c2", iconName: "activity", anyOf: opsReadScopes, order: 890 }],
routes: [ routes: [
{ path: "/ops", anyOf: opsReadScopes, order: 890, render: ({ settings }) => createElement(OpsPage, { settings }) }], { path: "/ops", anyOf: opsReadScopes, order: 890, render: ({ settings }) => createElement(OpsPage, { settings }) }],