@echothink-ui/admin 0.1.0
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.
- package/README.md +5 -0
- package/dist/components/AdminHealthTemplate.d.ts +5 -0
- package/dist/components/AdminShell.d.ts +8 -0
- package/dist/components/AuditLogViewer.d.ts +9 -0
- package/dist/components/BillingUsagePanel.d.ts +7 -0
- package/dist/components/FeatureFlagPanel.d.ts +8 -0
- package/dist/components/IntegrationHealthTable.d.ts +6 -0
- package/dist/components/JobQueuePanel.d.ts +7 -0
- package/dist/components/PolicyConfigPanel.d.ts +9 -0
- package/dist/components/QueueDepthChart.d.ts +6 -0
- package/dist/components/RateLimitPanel.d.ts +7 -0
- package/dist/components/RuntimeLogViewer.d.ts +10 -0
- package/dist/components/ServiceStatusCard.d.ts +7 -0
- package/dist/components/SystemHealthDashboard.d.ts +8 -0
- package/dist/components/TenantSettingsPanel.d.ts +11 -0
- package/dist/components/WorkerPoolPanel.d.ts +7 -0
- package/dist/components/types.d.ts +114 -0
- package/dist/index.cjs +1835 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +1711 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +1812 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -0
- package/src/components/AdminHealthTemplate.tsx +25 -0
- package/src/components/AdminShell.tsx +48 -0
- package/src/components/AuditLogViewer.tsx +96 -0
- package/src/components/BillingUsagePanel.tsx +171 -0
- package/src/components/FeatureFlagPanel.tsx +178 -0
- package/src/components/IntegrationHealthTable.tsx +196 -0
- package/src/components/JobQueuePanel.tsx +171 -0
- package/src/components/PolicyConfigPanel.test.tsx +45 -0
- package/src/components/PolicyConfigPanel.tsx +131 -0
- package/src/components/QueueDepthChart.tsx +70 -0
- package/src/components/RateLimitPanel.test.tsx +29 -0
- package/src/components/RateLimitPanel.tsx +249 -0
- package/src/components/RuntimeLogViewer.test.tsx +60 -0
- package/src/components/RuntimeLogViewer.tsx +185 -0
- package/src/components/ServiceStatusCard.tsx +91 -0
- package/src/components/SystemHealthDashboard.tsx +214 -0
- package/src/components/TenantSettingsPanel.test.tsx +38 -0
- package/src/components/TenantSettingsPanel.tsx +44 -0
- package/src/components/WorkerPoolPanel.test.tsx +32 -0
- package/src/components/WorkerPoolPanel.tsx +281 -0
- package/src/components/types.ts +131 -0
- package/src/index.tsx +37 -0
- package/src/styles.css +2024 -0
package/README.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# @echothink-ui/admin
|
|
2
|
+
|
|
3
|
+
Admin package for EchoThink app-domain websites.
|
|
4
|
+
|
|
5
|
+
This package is part of the EchoThink-UI app-domain library. It is designed for normal website app domains rendered inside EchoThink Studio's Chromium shell, not for implementing the studio browser chrome itself.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SurfaceComponentProps } from "@echothink-ui/core";
|
|
2
|
+
import { type SystemHealthDashboardProps } from "./SystemHealthDashboard";
|
|
3
|
+
export interface AdminHealthTemplateProps extends Omit<SystemHealthDashboardProps, "services" | "incidents" | "metrics">, Pick<Partial<SystemHealthDashboardProps>, "services" | "incidents" | "metrics">, Omit<SurfaceComponentProps, "children"> {
|
|
4
|
+
}
|
|
5
|
+
export declare function AdminHealthTemplate({ services, incidents, metrics, ...props }: AdminHealthTemplateProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { SurfaceComponentProps } from "@echothink-ui/core";
|
|
3
|
+
export interface AdminShellProps extends Omit<SurfaceComponentProps, "children"> {
|
|
4
|
+
sideNav: React.ReactNode;
|
|
5
|
+
header?: React.ReactNode;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function AdminShell({ sideNav, header, children, className, title: _title, subtitle: _subtitle, description: _description, eyebrow: _eyebrow, density: _density, status: _status, severity: _severity, loading: _loading, empty: _empty, error: _error, items: _items, actions: _actions, metadata: _metadata, footer: _footer, ...props }: AdminShellProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SurfaceComponentProps } from "@echothink-ui/core";
|
|
3
|
+
import type { AuditLogEntry } from "./types";
|
|
4
|
+
export interface AuditLogViewerProps extends Omit<SurfaceComponentProps, "children"> {
|
|
5
|
+
entries: AuditLogEntry[];
|
|
6
|
+
filters?: React.ReactNode;
|
|
7
|
+
onExport?: (format: "csv" | "json" | "xlsx") => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function AuditLogViewer({ entries, filters, onExport, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy }: AuditLogViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type SurfaceComponentProps } from "@echothink-ui/core";
|
|
2
|
+
import type { BillingUsageMetric } from "./types";
|
|
3
|
+
export interface BillingUsagePanelProps extends Omit<SurfaceComponentProps, "children"> {
|
|
4
|
+
metrics: BillingUsageMetric[];
|
|
5
|
+
period: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function BillingUsagePanel({ metrics, period, title, className, ...props }: BillingUsagePanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type SurfaceComponentProps } from "@echothink-ui/core";
|
|
2
|
+
import type { FeatureFlag } from "./types";
|
|
3
|
+
export interface FeatureFlagPanelProps extends Omit<SurfaceComponentProps, "children" | "onToggle"> {
|
|
4
|
+
flags: FeatureFlag[];
|
|
5
|
+
onToggle?: (id: string) => void;
|
|
6
|
+
onUpdate?: (id: string, update: Partial<FeatureFlag>) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function FeatureFlagPanel({ flags, onToggle, onUpdate, className, title, subtitle, description, actions, density, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, eyebrow: _eyebrow, status: _status, severity: _severity, loading: _loading, empty: _empty, error: _error, items: _items, metadata: _metadata, footer: _footer, ...sectionProps }: FeatureFlagPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type SurfaceComponentProps } from "@echothink-ui/core";
|
|
2
|
+
import type { IntegrationHealth } from "./types";
|
|
3
|
+
export interface IntegrationHealthTableProps extends Omit<SurfaceComponentProps, "children"> {
|
|
4
|
+
integrations: IntegrationHealth[];
|
|
5
|
+
}
|
|
6
|
+
export declare function IntegrationHealthTable({ integrations, className, title, subtitle, description, actions, density, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, eyebrow: _eyebrow, status: _status, severity: _severity, loading: _loading, empty: _empty, error: _error, items: _items, metadata: _metadata, footer: _footer, ...sectionProps }: IntegrationHealthTableProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type EthAction, type SurfaceComponentProps } from "@echothink-ui/core";
|
|
2
|
+
import type { JobQueue } from "./types";
|
|
3
|
+
export interface JobQueuePanelProps extends Omit<SurfaceComponentProps, "children" | "actions"> {
|
|
4
|
+
queues: JobQueue[];
|
|
5
|
+
actions?: EthAction[];
|
|
6
|
+
}
|
|
7
|
+
export declare function JobQueuePanel({ queues, actions, title, subtitle, description, density, className, "aria-labelledby": ariaLabelledBy, eyebrow: _eyebrow, status: _status, severity: _severity, loading: _loading, empty: _empty, error: _error, items: _items, metadata: _metadata, footer: _footer, ...props }: JobQueuePanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SurfaceComponentProps } from "@echothink-ui/core";
|
|
2
|
+
import type { AdminPolicyConfig, JsonSchema } from "./types";
|
|
3
|
+
export interface PolicyConfigPanelProps extends Omit<SurfaceComponentProps, "children" | "onChange"> {
|
|
4
|
+
policy: AdminPolicyConfig;
|
|
5
|
+
schema: JsonSchema;
|
|
6
|
+
onChange?: (policy: AdminPolicyConfig) => void;
|
|
7
|
+
onSave?: (policy: AdminPolicyConfig) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function PolicyConfigPanel({ policy, schema, onChange, onSave, title, description, density, className, ...props }: PolicyConfigPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SurfaceComponentProps } from "@echothink-ui/core";
|
|
2
|
+
import type { QueueDepthPoint } from "./types";
|
|
3
|
+
export interface QueueDepthChartProps extends Omit<SurfaceComponentProps, "children"> {
|
|
4
|
+
points: QueueDepthPoint[];
|
|
5
|
+
}
|
|
6
|
+
export declare function QueueDepthChart({ points, title, metadata, className, ...props }: QueueDepthChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type SurfaceComponentProps } from "@echothink-ui/core";
|
|
2
|
+
import type { RateLimit } from "./types";
|
|
3
|
+
export interface RateLimitPanelProps extends Omit<SurfaceComponentProps, "children"> {
|
|
4
|
+
limits: RateLimit[];
|
|
5
|
+
onUpdate?: (id: string, update: Partial<RateLimit>) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function RateLimitPanel({ limits, onUpdate, title, subtitle, description, actions, density, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, eyebrow: _eyebrow, status: _status, severity: _severity, loading: _loading, empty: _empty, error: _error, items: _items, metadata: _metadata, footer: _footer, ...sectionProps }: RateLimitPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SurfaceComponentProps } from "@echothink-ui/core";
|
|
3
|
+
import type { LogEntry } from "./types";
|
|
4
|
+
export interface RuntimeLogViewerProps extends Omit<SurfaceComponentProps, "children"> {
|
|
5
|
+
entries: LogEntry[];
|
|
6
|
+
filters?: React.ReactNode;
|
|
7
|
+
onPause?: () => void;
|
|
8
|
+
streaming?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function RuntimeLogViewer({ entries, filters, onPause, streaming, className, title, subtitle, description, density, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy }: RuntimeLogViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type EthSeverity, type SurfaceComponentProps } from "@echothink-ui/core";
|
|
2
|
+
import type { ServiceHealthStatus, ServiceStatusSummary } from "./types";
|
|
3
|
+
export interface ServiceStatusCardProps extends Omit<SurfaceComponentProps, "children"> {
|
|
4
|
+
service: ServiceStatusSummary;
|
|
5
|
+
}
|
|
6
|
+
export declare function ServiceStatusCard({ service, className, ...props }: ServiceStatusCardProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function severityForStatus(status: ServiceHealthStatus): EthSeverity;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type SurfaceComponentProps } from "@echothink-ui/core";
|
|
2
|
+
import type { AdminIncident, AdminMetric, HealthService } from "./types";
|
|
3
|
+
export interface SystemHealthDashboardProps extends Omit<SurfaceComponentProps, "children"> {
|
|
4
|
+
services: HealthService[];
|
|
5
|
+
incidents?: AdminIncident[];
|
|
6
|
+
metrics?: AdminMetric[];
|
|
7
|
+
}
|
|
8
|
+
export declare function SystemHealthDashboard({ services, incidents, metrics, title, description, severity, status, className, ...props }: SystemHealthDashboardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type FormValues } from "@echothink-ui/forms";
|
|
2
|
+
import type { SurfaceComponentProps } from "@echothink-ui/core";
|
|
3
|
+
import type { TenantSettingsSection } from "./types";
|
|
4
|
+
export interface TenantSettingsPanelProps extends Omit<SurfaceComponentProps, "children" | "onChange" | "onSubmit"> {
|
|
5
|
+
sections: TenantSettingsSection[];
|
|
6
|
+
values: FormValues;
|
|
7
|
+
onChange?: (values: FormValues) => void;
|
|
8
|
+
onSubmit?: (values: FormValues) => void;
|
|
9
|
+
submitLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function TenantSettingsPanel({ sections, values, onChange, onSubmit, submitLabel, title, description, className, ...props }: TenantSettingsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type SurfaceComponentProps } from "@echothink-ui/core";
|
|
2
|
+
import type { WorkerPool } from "./types";
|
|
3
|
+
export interface WorkerPoolPanelProps extends Omit<SurfaceComponentProps, "children"> {
|
|
4
|
+
pools: WorkerPool[];
|
|
5
|
+
onScale?: (id: string, delta: number) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function WorkerPoolPanel({ pools, onScale, title, subtitle, description, actions, density, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, eyebrow: _eyebrow, status: _status, severity: _severity, loading: _loading, empty: _empty, error: _error, items: _items, metadata: _metadata, footer: _footer, ...sectionProps }: WorkerPoolPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import type { Condition, FieldSchema, FormValues, JsonSchema, RuleDefinition } from "@echothink-ui/forms";
|
|
3
|
+
export type ServiceHealthStatus = "healthy" | "degraded" | "down";
|
|
4
|
+
export interface HealthService {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
status: ServiceHealthStatus;
|
|
8
|
+
latencyMs?: number;
|
|
9
|
+
incidentsCount?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ServiceStatusSummary {
|
|
12
|
+
name: string;
|
|
13
|
+
status: ServiceHealthStatus;
|
|
14
|
+
latencyMs?: number;
|
|
15
|
+
incidentsCount?: number;
|
|
16
|
+
lastIncidentAt?: string;
|
|
17
|
+
uptimePercent?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface AdminIncident {
|
|
20
|
+
id: string;
|
|
21
|
+
title: string;
|
|
22
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
23
|
+
startedAt: string;
|
|
24
|
+
}
|
|
25
|
+
export interface AdminMetric {
|
|
26
|
+
label: string;
|
|
27
|
+
value: React.ReactNode;
|
|
28
|
+
trend?: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export interface WorkerPool {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
active: number;
|
|
34
|
+
total: number;
|
|
35
|
+
idle: number;
|
|
36
|
+
failed: number;
|
|
37
|
+
}
|
|
38
|
+
export interface JobQueue {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
depth: number;
|
|
42
|
+
processing: number;
|
|
43
|
+
failed: number;
|
|
44
|
+
retryRate?: number;
|
|
45
|
+
}
|
|
46
|
+
export interface QueueDepthPoint {
|
|
47
|
+
id?: string;
|
|
48
|
+
label?: string;
|
|
49
|
+
timestamp?: string;
|
|
50
|
+
depth: number;
|
|
51
|
+
}
|
|
52
|
+
export interface LogEntry {
|
|
53
|
+
id: string;
|
|
54
|
+
timestamp: string;
|
|
55
|
+
level?: "debug" | "info" | "warning" | "error";
|
|
56
|
+
source?: string;
|
|
57
|
+
message: string;
|
|
58
|
+
meta?: Record<string, unknown>;
|
|
59
|
+
}
|
|
60
|
+
export interface AuditLogEntry {
|
|
61
|
+
id: string;
|
|
62
|
+
timestamp: string;
|
|
63
|
+
actor: string;
|
|
64
|
+
action: string;
|
|
65
|
+
resource: string;
|
|
66
|
+
outcome: "success" | "failure" | string;
|
|
67
|
+
ip?: string;
|
|
68
|
+
userAgent?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface AdminPolicyConfig {
|
|
71
|
+
id?: string;
|
|
72
|
+
name?: string;
|
|
73
|
+
description?: string;
|
|
74
|
+
rules?: RuleDefinition[];
|
|
75
|
+
variables?: string[];
|
|
76
|
+
condition?: Condition;
|
|
77
|
+
[key: string]: unknown;
|
|
78
|
+
}
|
|
79
|
+
export interface TenantSettingsSection {
|
|
80
|
+
id: string;
|
|
81
|
+
title: string;
|
|
82
|
+
description?: React.ReactNode;
|
|
83
|
+
fields: FieldSchema[];
|
|
84
|
+
}
|
|
85
|
+
export interface BillingUsageMetric {
|
|
86
|
+
label: string;
|
|
87
|
+
current: number;
|
|
88
|
+
limit: number;
|
|
89
|
+
unit: string;
|
|
90
|
+
trend?: number;
|
|
91
|
+
}
|
|
92
|
+
export interface FeatureFlag {
|
|
93
|
+
id: string;
|
|
94
|
+
name: string;
|
|
95
|
+
enabled: boolean;
|
|
96
|
+
rolloutPercent?: number;
|
|
97
|
+
environments?: string[];
|
|
98
|
+
}
|
|
99
|
+
export interface RateLimit {
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
current: number;
|
|
103
|
+
limit: number;
|
|
104
|
+
windowSeconds: number;
|
|
105
|
+
}
|
|
106
|
+
export interface IntegrationHealth {
|
|
107
|
+
id: string;
|
|
108
|
+
name: string;
|
|
109
|
+
status: ServiceHealthStatus;
|
|
110
|
+
incidentsCount?: number;
|
|
111
|
+
latencyMs?: number;
|
|
112
|
+
lastCheckedAt?: string;
|
|
113
|
+
}
|
|
114
|
+
export type { FormValues, JsonSchema };
|