Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 38 additions & 17 deletions apps/cloud/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

import { Route as rootRouteImport } from './routes/__root'
import { Route as ToolsRouteImport } from './routes/tools'
import { Route as TeamRouteImport } from './routes/team'
import { Route as SecretsRouteImport } from './routes/secrets'
import { Route as OrgRouteImport } from './routes/org'
import { Route as PoliciesRouteImport } from './routes/policies'
import { Route as BillingRouteImport } from './routes/billing'
import { Route as IndexRouteImport } from './routes/index'
import { Route as SourcesNamespaceRouteImport } from './routes/sources.$namespace'
Expand All @@ -23,14 +24,19 @@ const ToolsRoute = ToolsRouteImport.update({
path: '/tools',
getParentRoute: () => rootRouteImport,
} as any)
const TeamRoute = TeamRouteImport.update({
id: '/team',
path: '/team',
getParentRoute: () => rootRouteImport,
} as any)
const SecretsRoute = SecretsRouteImport.update({
id: '/secrets',
path: '/secrets',
getParentRoute: () => rootRouteImport,
} as any)
const OrgRoute = OrgRouteImport.update({
id: '/org',
path: '/org',
const PoliciesRoute = PoliciesRouteImport.update({
id: '/policies',
path: '/policies',
getParentRoute: () => rootRouteImport,
} as any)
const BillingRoute = BillingRouteImport.update({
Expand Down Expand Up @@ -62,8 +68,9 @@ const SourcesAddPluginKeyRoute = SourcesAddPluginKeyRouteImport.update({
export interface FileRoutesByFullPath {
'/': typeof IndexRoute
'/billing': typeof BillingRoute
'/org': typeof OrgRoute
'/policies': typeof PoliciesRoute
'/secrets': typeof SecretsRoute
'/team': typeof TeamRoute
'/tools': typeof ToolsRoute
'/billing/plans': typeof BillingPlansRoute
'/sources/$namespace': typeof SourcesNamespaceRoute
Expand All @@ -72,8 +79,9 @@ export interface FileRoutesByFullPath {
export interface FileRoutesByTo {
'/': typeof IndexRoute
'/billing': typeof BillingRoute
'/org': typeof OrgRoute
'/policies': typeof PoliciesRoute
'/secrets': typeof SecretsRoute
'/team': typeof TeamRoute
'/tools': typeof ToolsRoute
'/billing/plans': typeof BillingPlansRoute
'/sources/$namespace': typeof SourcesNamespaceRoute
Expand All @@ -83,8 +91,9 @@ export interface FileRoutesById {
__root__: typeof rootRouteImport
'/': typeof IndexRoute
'/billing': typeof BillingRoute
'/org': typeof OrgRoute
'/policies': typeof PoliciesRoute
'/secrets': typeof SecretsRoute
'/team': typeof TeamRoute
'/tools': typeof ToolsRoute
'/billing_/plans': typeof BillingPlansRoute
'/sources/$namespace': typeof SourcesNamespaceRoute
Expand All @@ -95,8 +104,9 @@ export interface FileRouteTypes {
fullPaths:
| '/'
| '/billing'
| '/org'
| '/policies'
| '/secrets'
| '/team'
| '/tools'
| '/billing/plans'
| '/sources/$namespace'
Expand All @@ -105,8 +115,9 @@ export interface FileRouteTypes {
to:
| '/'
| '/billing'
| '/org'
| '/policies'
| '/secrets'
| '/team'
| '/tools'
| '/billing/plans'
| '/sources/$namespace'
Expand All @@ -115,8 +126,9 @@ export interface FileRouteTypes {
| '__root__'
| '/'
| '/billing'
| '/org'
| '/policies'
| '/secrets'
| '/team'
| '/tools'
| '/billing_/plans'
| '/sources/$namespace'
Expand All @@ -126,8 +138,9 @@ export interface FileRouteTypes {
export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
BillingRoute: typeof BillingRoute
OrgRoute: typeof OrgRoute
PoliciesRoute: typeof PoliciesRoute
SecretsRoute: typeof SecretsRoute
TeamRoute: typeof TeamRoute
ToolsRoute: typeof ToolsRoute
BillingPlansRoute: typeof BillingPlansRoute
SourcesNamespaceRoute: typeof SourcesNamespaceRoute
Expand All @@ -143,18 +156,25 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof ToolsRouteImport
parentRoute: typeof rootRouteImport
}
'/team': {
id: '/team'
path: '/team'
fullPath: '/team'
preLoaderRoute: typeof TeamRouteImport
parentRoute: typeof rootRouteImport
}
'/secrets': {
id: '/secrets'
path: '/secrets'
fullPath: '/secrets'
preLoaderRoute: typeof SecretsRouteImport
parentRoute: typeof rootRouteImport
}
'/org': {
id: '/org'
path: '/org'
fullPath: '/org'
preLoaderRoute: typeof OrgRouteImport
'/policies': {
id: '/policies'
path: '/policies'
fullPath: '/policies'
preLoaderRoute: typeof PoliciesRouteImport
parentRoute: typeof rootRouteImport
}
'/billing': {
Expand Down Expand Up @@ -198,8 +218,9 @@ declare module '@tanstack/react-router' {
const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
BillingRoute: BillingRoute,
OrgRoute: OrgRoute,
PoliciesRoute: PoliciesRoute,
SecretsRoute: SecretsRoute,
TeamRoute: TeamRoute,
ToolsRoute: ToolsRoute,
BillingPlansRoute: BillingPlansRoute,
SourcesNamespaceRoute: SourcesNamespaceRoute,
Expand Down
6 changes: 6 additions & 0 deletions apps/cloud/src/routes/policies.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { createFileRoute } from "@tanstack/react-router";
import { PoliciesPage } from "@executor/react/pages/policies";

export const Route = createFileRoute("/policies")({
component: PoliciesPage,
});
40 changes: 38 additions & 2 deletions apps/cloud/src/web/shell.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Link, Outlet, useLocation } from "@tanstack/react-router";
import { useEffect, useRef, useState } from "react";
import { useEffect, useRef, useState, type ReactNode } from "react";
import { useAtomValue, Result } from "@effect-atom/atom-react";
import { sourcesAtom } from "@executor/react/api/atoms";
import { useScope } from "@executor/react/api/scope-context";
Expand All @@ -22,7 +22,13 @@ const sourcePlugins = [

// ── NavItem ──────────────────────────────────────────────────────────────

function NavItem(props: { to: string; label: string; active: boolean; onNavigate?: () => void }) {
function NavItem(props: {
to: string;
label: string;
active: boolean;
onNavigate?: () => void;
icon?: ReactNode;
}) {
return (
<Link
to={props.to}
Expand All @@ -34,11 +40,33 @@ function NavItem(props: { to: string; label: string; active: boolean; onNavigate
: "text-sidebar-foreground hover:bg-sidebar-active/60 hover:text-foreground",
].join(" ")}
>
{props.icon}
{props.label}
</Link>
);
}

function PoliciesIcon() {
return (
<svg viewBox="0 0 16 16" fill="none" className="size-3.5 shrink-0">
<path
d="M8 2l4.5 1.5V7c0 3-1.9 5.7-4.5 7-2.6-1.3-4.5-4-4.5-7V3.5L8 2z"
stroke="currentColor"
strokeWidth="1.2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M6.25 8.1l1.1 1.1 2.4-2.55"
stroke="currentColor"
strokeWidth="1.2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
}

// ── SourceList ───────────────────────────────────────────────────────────

function SourceList(props: { pathname: string; onNavigate?: () => void }) {
Expand Down Expand Up @@ -151,6 +179,7 @@ function UserFooter() {
function SidebarContent(props: { pathname: string; onNavigate?: () => void; showBrand?: boolean }) {
const isHome = props.pathname === "/";
const isSecrets = props.pathname === "/secrets";
const isPolicies = props.pathname === "/policies";
const isBilling = props.pathname === "/billing" || props.pathname.startsWith("/billing/");
const isOrg = props.pathname === "/org";

Expand All @@ -167,6 +196,13 @@ function SidebarContent(props: { pathname: string; onNavigate?: () => void; show
<nav className="flex flex-1 flex-col overflow-y-auto p-2">
<NavItem to="/" label="Sources" active={isHome} onNavigate={props.onNavigate} />
<NavItem to="/secrets" label="Secrets" active={isSecrets} onNavigate={props.onNavigate} />
<NavItem
to="/policies"
label="Policies"
active={isPolicies}
onNavigate={props.onNavigate}
icon={<PoliciesIcon />}
/>
<NavItem to="/org" label="Organization" active={isOrg} onNavigate={props.onNavigate} />
<NavItem to="/billing" label="Billing" active={isBilling} onNavigate={props.onNavigate} />

Expand Down
21 changes: 21 additions & 0 deletions apps/local/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import { Route as rootRouteImport } from './routes/__root'
import { Route as ToolsRouteImport } from './routes/tools'
import { Route as SecretsRouteImport } from './routes/secrets'
import { Route as PoliciesRouteImport } from './routes/policies'
import { Route as IndexRouteImport } from './routes/index'
import { Route as SourcesNamespaceRouteImport } from './routes/sources.$namespace'
import { Route as SourcesAddPluginKeyRouteImport } from './routes/sources.add.$pluginKey'
Expand All @@ -25,6 +26,11 @@ const SecretsRoute = SecretsRouteImport.update({
path: '/secrets',
getParentRoute: () => rootRouteImport,
} as any)
const PoliciesRoute = PoliciesRouteImport.update({
id: '/policies',
path: '/policies',
getParentRoute: () => rootRouteImport,
} as any)
const IndexRoute = IndexRouteImport.update({
id: '/',
path: '/',
Expand All @@ -43,13 +49,15 @@ const SourcesAddPluginKeyRoute = SourcesAddPluginKeyRouteImport.update({

export interface FileRoutesByFullPath {
'/': typeof IndexRoute
'/policies': typeof PoliciesRoute
'/secrets': typeof SecretsRoute
'/tools': typeof ToolsRoute
'/sources/$namespace': typeof SourcesNamespaceRoute
'/sources/add/$pluginKey': typeof SourcesAddPluginKeyRoute
}
export interface FileRoutesByTo {
'/': typeof IndexRoute
'/policies': typeof PoliciesRoute
'/secrets': typeof SecretsRoute
'/tools': typeof ToolsRoute
'/sources/$namespace': typeof SourcesNamespaceRoute
Expand All @@ -58,6 +66,7 @@ export interface FileRoutesByTo {
export interface FileRoutesById {
__root__: typeof rootRouteImport
'/': typeof IndexRoute
'/policies': typeof PoliciesRoute
'/secrets': typeof SecretsRoute
'/tools': typeof ToolsRoute
'/sources/$namespace': typeof SourcesNamespaceRoute
Expand All @@ -67,20 +76,23 @@ export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths:
| '/'
| '/policies'
| '/secrets'
| '/tools'
| '/sources/$namespace'
| '/sources/add/$pluginKey'
fileRoutesByTo: FileRoutesByTo
to:
| '/'
| '/policies'
| '/secrets'
| '/tools'
| '/sources/$namespace'
| '/sources/add/$pluginKey'
id:
| '__root__'
| '/'
| '/policies'
| '/secrets'
| '/tools'
| '/sources/$namespace'
Expand All @@ -89,6 +101,7 @@ export interface FileRouteTypes {
}
export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
PoliciesRoute: typeof PoliciesRoute
SecretsRoute: typeof SecretsRoute
ToolsRoute: typeof ToolsRoute
SourcesNamespaceRoute: typeof SourcesNamespaceRoute
Expand All @@ -111,6 +124,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof SecretsRouteImport
parentRoute: typeof rootRouteImport
}
'/policies': {
id: '/policies'
path: '/policies'
fullPath: '/policies'
preLoaderRoute: typeof PoliciesRouteImport
parentRoute: typeof rootRouteImport
}
'/': {
id: '/'
path: '/'
Expand All @@ -137,6 +157,7 @@ declare module '@tanstack/react-router' {

const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
PoliciesRoute: PoliciesRoute,
SecretsRoute: SecretsRoute,
ToolsRoute: ToolsRoute,
SourcesNamespaceRoute: SourcesNamespaceRoute,
Expand Down
6 changes: 6 additions & 0 deletions apps/local/src/routes/policies.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { createFileRoute } from "@tanstack/react-router";
import { PoliciesPage } from "@executor/react/pages/policies";

export const Route = createFileRoute("/policies")({
component: PoliciesPage,
});
Loading
Loading