From 448bdc0f1e691fab5af5e05f56e4897fc2ce518e Mon Sep 17 00:00:00 2001 From: Jeremy Clements Date: Wed, 29 Mar 2023 16:19:03 -0400 Subject: [PATCH] HPCC-28736 Fix ECL Watch v9 security section missing on containerized build Signed-off-by: Jeremy Clements --- esp/src/src-react/components/GroupDetails.tsx | 3 +- esp/src/src-react/components/GroupMembers.tsx | 7 +- esp/src/src-react/components/Groups.tsx | 7 +- esp/src/src-react/components/Menu.tsx | 23 ++-- esp/src/src-react/components/Permissions.tsx | 11 +- esp/src/src-react/components/Security.tsx | 3 +- esp/src/src-react/components/UserDetails.tsx | 3 +- esp/src/src-react/components/UserGroups.tsx | 7 +- esp/src/src-react/components/Users.tsx | 7 +- esp/src/src-react/components/Xrefs.tsx | 5 +- .../components/controls/ComingSoon.tsx | 19 +-- esp/src/src-react/routes.tsx | 111 ++++++++---------- esp/src/src/Utility.ts | 9 +- 13 files changed, 109 insertions(+), 106 deletions(-) diff --git a/esp/src/src-react/components/GroupDetails.tsx b/esp/src/src-react/components/GroupDetails.tsx index 14f4fc9a160..2a3bbf6b54a 100644 --- a/esp/src/src-react/components/GroupDetails.tsx +++ b/esp/src/src-react/components/GroupDetails.tsx @@ -4,6 +4,7 @@ import { SizeMe } from "react-sizeme"; import { scopedLogger } from "@hpcc-js/util"; import * as WsAccess from "src/ws_access"; import nlsHPCC from "src/nlsHPCC"; +import * as Utility from "src/Utility"; import { pivotItemStyle } from "../layouts/pivot"; import { DojoAdapter } from "../layouts/DojoAdapter"; import { TableGroup } from "./forms/Groups"; @@ -58,7 +59,7 @@ export const GroupDetails: React.FunctionComponent = ({ { - pushUrl(`/security/groups/${groupName}/${evt.props.itemKey}`); + pushUrl(`/${Utility.opsRouteCategory}/security/groups/${groupName}/${evt.props.itemKey}`); }} > diff --git a/esp/src/src-react/components/GroupMembers.tsx b/esp/src/src-react/components/GroupMembers.tsx index 87860453121..b2453064c13 100644 --- a/esp/src/src-react/components/GroupMembers.tsx +++ b/esp/src/src-react/components/GroupMembers.tsx @@ -3,6 +3,7 @@ import { CommandBar, ContextualMenuItemType, ICommandBarItemProps, Link } from " import { scopedLogger } from "@hpcc-js/util"; import * as WsAccess from "src/ws_access"; import nlsHPCC from "src/nlsHPCC"; +import * as Utility from "src/Utility"; import { GroupMemberStore, CreateGroupMemberStore } from "src/ws_access"; import { ShortVerticalDivider } from "./Common"; import { useConfirm } from "../hooks/confirm"; @@ -57,7 +58,7 @@ export const GroupMembers: React.FunctionComponent = ({ username: { label: nlsHPCC.UserName, formatter: React.useCallback(function (_name, idx) { - return {_name}; + return {_name}; }, []) }, employeeID: { label: nlsHPCC.EmployeeID }, @@ -107,10 +108,10 @@ export const GroupMembers: React.FunctionComponent = ({ key: "open", text: nlsHPCC.Open, disabled: !uiState.hasSelection, onClick: () => { if (selection.length === 1) { - pushUrl(`/security/users/${selection[0].username}`); + pushUrl(`/${Utility.opsRouteCategory}/security/users/${selection[0].username}`); } else { selection.forEach(user => { - window.open(`#/security/users/${user?.username}`, "_blank"); + window.open(`#/${Utility.opsRouteCategory}/security/users/${user?.username}`, "_blank"); }); } } diff --git a/esp/src/src-react/components/Groups.tsx b/esp/src/src-react/components/Groups.tsx index c73070a9308..3c543eb827b 100644 --- a/esp/src/src-react/components/Groups.tsx +++ b/esp/src/src-react/components/Groups.tsx @@ -11,6 +11,7 @@ import { AddGroupForm } from "./forms/AddGroup"; import { HolyGrail } from "../layouts/HolyGrail"; import { pushUrl } from "../util/history"; import { QuerySortItem } from "src/store/Store"; +import * as Utility from "src/Utility"; const logger = scopedLogger("src-react/components/Groups.tsx"); const wsAccess = new AccessService({ baseUrl: "" }); @@ -52,7 +53,7 @@ export const Groups: React.FunctionComponent = ({ name: { label: nlsHPCC.GroupName, formatter: function (_name, idx) { - return {_name}; + return {_name}; } }, groupOwner: { label: nlsHPCC.ManagedBy }, @@ -109,10 +110,10 @@ export const Groups: React.FunctionComponent = ({ key: "open", text: nlsHPCC.Open, disabled: !uiState.hasSelection, onClick: () => { if (selection.length === 1) { - pushUrl(`/security/groups/${selection[0].name}`); + pushUrl(`/${Utility.opsRouteCategory}/security/groups/${selection[0].name}`); } else { selection.forEach(group => { - window.open(`#/security/groups/${group.name}`, "_blank"); + window.open(`#/${Utility.opsRouteCategory}/security/groups/${group.name}`, "_blank"); }); } } diff --git a/esp/src/src-react/components/Menu.tsx b/esp/src/src-react/components/Menu.tsx index afbed3d2140..d5a6a1673d0 100644 --- a/esp/src/src-react/components/Menu.tsx +++ b/esp/src/src-react/components/Menu.tsx @@ -45,16 +45,16 @@ function navLinkGroups(): INavLinkGroup[] { }, { name: nlsHPCC.Operations, - url: "#/topology-bare-metal", + url: "#/operations", icon: "Admin", - key: "topology-bare-metal" + key: "operations" } ]; if (!containerized) { links = links.filter(l => l.key !== "topology"); } if (!bare_metal) { - links = links.filter(l => l.key !== "topology-bare-metal"); + links = links.filter(l => l.key !== "operations"); } return [{ links }]; } @@ -159,16 +159,17 @@ const subMenuItems: SubMenuItems = { { headerText: nlsHPCC.Pods, itemKey: "/topology/pods" }, { headerText: nlsHPCC.Services, itemKey: "/topology/services" }, { headerText: nlsHPCC.Logs, itemKey: "/topology/logs" }, + { headerText: nlsHPCC.Security + " (L)", itemKey: "/topology/security" }, { headerText: nlsHPCC.DaliAdmin, itemKey: "/topology/daliadmin" }, ], - "topology-bare-metal": [ - { headerText: nlsHPCC.Topology + " (L)", itemKey: "/topology-bare-metal" }, - { headerText: nlsHPCC.DiskUsage + " (L)", itemKey: "/diskusage" }, - { headerText: nlsHPCC.TargetClusters + " (L)", itemKey: "/clusters" }, - { headerText: nlsHPCC.ClusterProcesses + " (L)", itemKey: "/processes" }, - { headerText: nlsHPCC.SystemServers + " (L)", itemKey: "/servers" }, - { headerText: nlsHPCC.Security + " (L)", itemKey: "/security" }, - { headerText: nlsHPCC.DESDL + " (L)", itemKey: "/desdl" }, + "operations": [ + { headerText: nlsHPCC.Topology + " (L)", itemKey: "/operations" }, + { headerText: nlsHPCC.DiskUsage + " (L)", itemKey: "/operations/diskusage" }, + { headerText: nlsHPCC.TargetClusters + " (L)", itemKey: "/operations/clusters" }, + { headerText: nlsHPCC.ClusterProcesses + " (L)", itemKey: "/operations/processes" }, + { headerText: nlsHPCC.SystemServers + " (L)", itemKey: "/operations/servers" }, + { headerText: nlsHPCC.Security + " (L)", itemKey: "/operations/security" }, + { headerText: nlsHPCC.DESDL + " (L)", itemKey: "/operations/desdl" }, ], }; diff --git a/esp/src/src-react/components/Permissions.tsx b/esp/src/src-react/components/Permissions.tsx index 2d714881335..5bae8331ec9 100644 --- a/esp/src/src-react/components/Permissions.tsx +++ b/esp/src/src-react/components/Permissions.tsx @@ -4,6 +4,7 @@ import { useConst } from "@fluentui/react-hooks"; import { scopedLogger } from "@hpcc-js/util"; import * as WsAccess from "src/ws_access"; import nlsHPCC from "src/nlsHPCC"; +import * as Utility from "src/Utility"; import { ShortVerticalDivider } from "./Common"; import { useConfirm } from "../hooks/confirm"; import { DojoGrid, selector, tree } from "./DojoGrid"; @@ -55,7 +56,7 @@ export const Permissions: React.FunctionComponent = ({ label: nlsHPCC.Name, formatter: function (_name, idx) { if (idx.__hpcc_parent) { - return `${_name}`; + return `${_name}`; } else { return _name; } @@ -197,11 +198,11 @@ export const Permissions: React.FunctionComponent = ({ onClick: () => setShowDisableScopesConfirm(true), disabled: !scopeScansEnabled }, - { key: "fileScopeDefaults", text: nlsHPCC.FileScopeDefaultPermissions, onClick: (evt, item) => pushUrl("/security/permissions/_/File%20Scopes"), disabled: !uiState.fileScope }, - { key: "workunitScopeDefaults", text: nlsHPCC.WorkUnitScopeDefaultPermissions, onClick: (evt, item) => pushUrl("/security/permissions/_/Workunit%20Scopes"), disabled: !uiState.workunitScope }, - { key: "physicalFiles", text: nlsHPCC.PhysicalFiles, onClick: (evt, item) => pushUrl("/security/permissions/file/File%20Scopes"), disabled: !uiState.fileScope }, + { key: "fileScopeDefaults", text: nlsHPCC.FileScopeDefaultPermissions, onClick: (evt, item) => pushUrl(`/${Utility.opsRouteCategory}/security/permissions/_/File%20Scopes`), disabled: !uiState.fileScope }, + { key: "workunitScopeDefaults", text: nlsHPCC.WorkUnitScopeDefaultPermissions, onClick: (evt, item) => pushUrl(`/${Utility.opsRouteCategory}/security/permissions/_/Workunit%20Scopes`), disabled: !uiState.workunitScope }, + { key: "physicalFiles", text: nlsHPCC.PhysicalFiles, onClick: (evt, item) => pushUrl(`/${Utility.opsRouteCategory}/security/permissions/file/File%20Scopes`), disabled: !uiState.fileScope }, { key: "checkFilePermissions", text: nlsHPCC.CheckFilePermissions, disabled: !uiState.fileScope }, - { key: "codeGenerator", text: nlsHPCC.CodeGenerator, onClick: (evt, item) => pushUrl(`/security/permissions/_/${modulesDn}`), disabled: !uiState.repositoryModule }, + { key: "codeGenerator", text: nlsHPCC.CodeGenerator, onClick: (evt, item) => pushUrl(`/${Utility.opsRouteCategory}/security/permissions/_/${modulesDn}`), disabled: !uiState.repositoryModule }, ], }, }, diff --git a/esp/src/src-react/components/Security.tsx b/esp/src/src-react/components/Security.tsx index 642eb7d34f5..9a2aba9c678 100644 --- a/esp/src/src-react/components/Security.tsx +++ b/esp/src/src-react/components/Security.tsx @@ -8,6 +8,7 @@ import { Users } from "./Users"; import { pivotItemStyle } from "../layouts/pivot"; import { DojoAdapter } from "../layouts/DojoAdapter"; import nlsHPCC from "src/nlsHPCC"; +import * as Utility from "src/Utility"; interface SecurityProps { filter?: object; @@ -29,7 +30,7 @@ export const Security: React.FunctionComponent = ({ {({ size }) => pushUrl(`/security/${evt.props.itemKey}`)} + onLinkClick={evt => pushUrl(`/${Utility.opsRouteCategory}/security/${evt.props.itemKey}`)} > diff --git a/esp/src/src-react/components/UserDetails.tsx b/esp/src/src-react/components/UserDetails.tsx index a553a5cc35d..306e890277b 100644 --- a/esp/src/src-react/components/UserDetails.tsx +++ b/esp/src/src-react/components/UserDetails.tsx @@ -4,6 +4,7 @@ import { SizeMe } from "react-sizeme"; import { scopedLogger } from "@hpcc-js/util"; import * as WsAccess from "src/ws_access"; import nlsHPCC from "src/nlsHPCC"; +import * as Utility from "src/Utility"; import { pivotItemStyle } from "../layouts/pivot"; import { DojoAdapter } from "../layouts/DojoAdapter"; import { TableGroup } from "./forms/Groups"; @@ -100,7 +101,7 @@ export const UserDetails: React.FunctionComponent = ({ { - pushUrl(`/security/users/${user?.username}/${evt.props.itemKey}`); + pushUrl(`/${Utility.opsRouteCategory}/security/users/${user?.username}/${evt.props.itemKey}`); }} > diff --git a/esp/src/src-react/components/UserGroups.tsx b/esp/src/src-react/components/UserGroups.tsx index 54dafe195b3..7a191933d72 100644 --- a/esp/src/src-react/components/UserGroups.tsx +++ b/esp/src/src-react/components/UserGroups.tsx @@ -3,6 +3,7 @@ import { CommandBar, ContextualMenuItemType, ICommandBarItemProps, Link } from " import { AccessService } from "@hpcc-js/comms"; import { scopedLogger } from "@hpcc-js/util"; import nlsHPCC from "src/nlsHPCC"; +import * as Utility from "src/Utility"; import { ShortVerticalDivider } from "./Common"; import { pushUrl } from "../util/history"; import { useConfirm } from "../hooks/confirm"; @@ -41,7 +42,7 @@ export const UserGroups: React.FunctionComponent = ({ label: nlsHPCC.GroupName, formatter: function (_name, idx) { _name = _name.replace(/[^-_a-zA-Z0-9\s]+/g, ""); - return {_name}; + return {_name}; } } } @@ -95,10 +96,10 @@ export const UserGroups: React.FunctionComponent = ({ key: "open", text: nlsHPCC.Open, disabled: !uiState.hasSelection, onClick: () => { if (selection.length === 1) { - pushUrl(`/security/groups/${selection[0].name}`); + pushUrl(`/${Utility.opsRouteCategory}/security/groups/${selection[0].name}`); } else { selection.forEach(group => { - window.open(`#/security/groups/${group?.name}`, "_blank"); + window.open(`#/${Utility.opsRouteCategory}/security/groups/${group?.name}`, "_blank"); }); } } diff --git a/esp/src/src-react/components/Users.tsx b/esp/src/src-react/components/Users.tsx index 54cf4e66e81..855b1bbec83 100644 --- a/esp/src/src-react/components/Users.tsx +++ b/esp/src/src-react/components/Users.tsx @@ -13,6 +13,7 @@ import { Fields } from "./forms/Fields"; import { HolyGrail } from "../layouts/HolyGrail"; import { pushParams, pushUrl } from "../util/history"; import { QuerySortItem } from "src/store/Store"; +import * as Utility from "src/Utility"; const logger = scopedLogger("src-react/components/Users.tsx"); const wsAccess = new AccessService({ baseUrl: "" }); @@ -68,7 +69,7 @@ export const Users: React.FunctionComponent = ({ width: 180, label: nlsHPCC.Username, formatter: React.useCallback(function (_name, idx) { - return {_name}; + return {_name}; }, []) }, employeeID: { width: 180, label: nlsHPCC.EmployeeID }, @@ -133,10 +134,10 @@ export const Users: React.FunctionComponent = ({ key: "open", text: nlsHPCC.Open, disabled: !uiState.hasSelection, onClick: () => { if (selection.length === 1) { - pushUrl(`/security/users/${selection[0].username}`); + pushUrl(`/${Utility.opsRouteCategory}/security/users/${selection[0].username}`); } else { selection.forEach(user => { - window.open(`#/security/users/${user?.username}`, "_blank"); + window.open(`#/${Utility.opsRouteCategory}/security/users/${user?.username}`, "_blank"); }); } } diff --git a/esp/src/src-react/components/Xrefs.tsx b/esp/src/src-react/components/Xrefs.tsx index 772657fefa7..0e05c1d74a6 100644 --- a/esp/src/src-react/components/Xrefs.tsx +++ b/esp/src/src-react/components/Xrefs.tsx @@ -8,6 +8,7 @@ import { useFluentGrid } from "../hooks/grid"; import { ShortVerticalDivider } from "./Common"; import { pushUrl } from "../util/history"; import nlsHPCC from "src/nlsHPCC"; +import * as Utility from "src/Utility"; const logger = scopedLogger("src-react/components/Xrefs.tsx"); @@ -125,10 +126,10 @@ export const Xrefs: React.FunctionComponent = ({ key: "open", text: nlsHPCC.Open, disabled: !uiState.hasSelection, onClick: () => { if (selection.length === 1) { - pushUrl(`/security/users/${selection[0].username}`); + pushUrl(`/${Utility.opsRouteCategory}/security/users/${selection[0].username}`); } else { selection.forEach(user => { - window.open(`#/security/users/${user.username}`, "_blank"); + window.open(`#/${Utility.opsRouteCategory}/security/users/${user.username}`, "_blank"); }); } } diff --git a/esp/src/src-react/components/controls/ComingSoon.tsx b/esp/src/src-react/components/controls/ComingSoon.tsx index d05cf1020a5..29ee2d6517a 100644 --- a/esp/src/src-react/components/controls/ComingSoon.tsx +++ b/esp/src/src-react/components/controls/ComingSoon.tsx @@ -2,6 +2,7 @@ import * as React from "react"; import { IStyle, Toggle } from "@fluentui/react"; import nlsHPCC from "src/nlsHPCC"; import { ModernMode } from "src/BuildInfo"; +import * as Utility from "src/Utility"; import { useUserStore } from "../../hooks/store"; const legacyIndex = {}; @@ -26,15 +27,15 @@ const modernIndex = {}; ["#/stub/RoxieQueries-DL/PackageMaps", "#/packagemaps"], ["#/stub/RoxieQueries", "#/queries"], - ["#/stub/OPS-DL/Topology", "#/topology-bare-metal"], - ["#/stub/OPS-DL/DiskUsage", "#/diskusage"], - ["#/stub/OPS-DL/TargetClustersQuery", "#/clusters"], - ["#/stub/OPS-DL/ClusterProcessesQuery", "#/processes"], - ["#/stub/OPS-DL/SystemServersQuery", "#/servers"], - ["#/stub/OPS-DL/Permissions", "#/security"], - ["#/stub/OPS-DL/DESDL", "#/desdl"], - ["#/stub/OPS-DL/LogVisualization", "#/topology-bare-metal"], - ["#/stub/OPS", "#/topology-bare-metal"], + ["#/stub/OPS-DL/Topology", "#/operations"], + ["#/stub/OPS-DL/DiskUsage", "#/operations/diskusage"], + ["#/stub/OPS-DL/TargetClustersQuery", "#/operations/clusters"], + ["#/stub/OPS-DL/ClusterProcessesQuery", "#/operations/processes"], + ["#/stub/OPS-DL/SystemServersQuery", "#/operations/servers"], + ["#/stub/OPS-DL/Permissions", `#/${Utility.opsRouteCategory}/security`], + ["#/stub/OPS-DL/DESDL", `#/${Utility.opsRouteCategory}/desdl`], + ["#/stub/OPS-DL/LogVisualization", "#/operations"], + ["#/stub/OPS", "#/operations"], ].forEach(row => { legacyIndex[row[0]] = row[1]; modernIndex[row[1]] = row[0]; diff --git a/esp/src/src-react/routes.tsx b/esp/src/src-react/routes.tsx index 052d8799623..a37919153c4 100644 --- a/esp/src/src-react/routes.tsx +++ b/esp/src/src-react/routes.tsx @@ -2,7 +2,7 @@ import * as React from "react"; import { Route, RouterContext } from "universal-router"; import { initialize, parsePage, parseSearch, parseSort, pushUrl, replaceUrl } from "./util/history"; -export type MainNav = "activities" | "workunits" | "files" | "queries" | "topology" | "topology-bare-metal"; +export type MainNav = "activities" | "workunits" | "files" | "queries" | "topology" | "operations"; export interface RouteEx extends Route { mainNav: MainNav[]; @@ -170,6 +170,18 @@ export const routes: RoutesEx = [ { path: "/pods-json", action: (ctx, params) => import("./components/Pods").then(_ => <_.PodsJSON />) }, { path: "/services", action: (ctx, params) => import("./components/Services").then(_ => <_.Services />) }, { path: "/logs", action: (ctx) => import("./components/Logs").then(_ => <_.Logs filter={parseSearch(ctx.search) as any} />) }, + { + path: "/security", + children: [ + { path: "", action: (ctx, params) => import("./components/Security").then(_ => <_.Security filter={parseSearch(ctx.search) as any} page={parsePage(ctx.search)} />) }, + { path: "/:Tab", action: (ctx, params) => import("./components/Security").then(_ => <_.Security filter={parseSearch(ctx.search) as any} tab={params.Tab as string} page={parsePage(ctx.search)} />) }, + { path: "/users/:username", action: (ctx, params) => import("./components/UserDetails").then(_ => <_.UserDetails username={params.username as string} />) }, + { path: "/users/:username/:Tab", action: (ctx, params) => import("./components/UserDetails").then(_ => <_.UserDetails username={params.username as string} tab={params.Tab as string} />) }, + { path: "/groups/:name", action: (ctx, params) => import("./components/GroupDetails").then(_ => <_.GroupDetails name={params.name as string} />) }, + { path: "/groups/:name/:Tab", action: (ctx, params) => import("./components/GroupDetails").then(_ => <_.GroupDetails name={params.name as string} tab={params.Tab as string} />) }, + { path: "/permissions/:Name/:BaseDn", action: (ctx, params) => import("./components/Security").then(_ => <_.Security tab="permissions" name={params.Name as string} baseDn={params.BaseDn as string} />) }, + ] + }, { path: "/daliadmin", children: [ @@ -180,70 +192,43 @@ export const routes: RoutesEx = [ ] }, { - mainNav: ["topology"], - path: "/daliadmin", - children: [ - { path: "", action: (ctx, params) => import("./components/DaliAdmin").then(_ => <_.DaliAdmin />) }, - { path: "/:Tab", action: (ctx, params) => import("./components/DaliAdmin").then(_ => <_.DaliAdmin tab={params.Tab as string} />) }, - ] - }, - { - mainNav: ["topology-bare-metal"], - path: "/topology-bare-metal", - action: () => import("./layouts/DojoAdapter").then(_ => <_.DojoAdapter widgetClassID="TopologyWidget" />) - }, - { - mainNav: ["topology-bare-metal"], - path: "/diskusage", action: () => import("./layouts/DojoAdapter").then(_ => <_.DojoAdapter widgetClassID="DiskUsageWidget" />) - }, - { - mainNav: ["topology-bare-metal"], - path: "/clusters", action: () => import("./layouts/DojoAdapter").then(_ => <_.DojoAdapter widgetClassID="TargetClustersQueryWidget" />) - }, - { - mainNav: ["topology-bare-metal"], - path: "/clusters", - children: [ - { path: "/:ClusterName", action: (ctx, params) => import("./layouts/DojoAdapter").then(_ => <_.DojoAdapter widgetClassID="TpClusterInfoWidget" params={params} />) }, - { path: "/:Cluster/usage", action: (ctx, params) => import("./components/DiskUsage").then(_ => <_.ClusterUsage cluster={params.Cluster as string} />) }, - ] - }, - { - mainNav: ["topology-bare-metal"], - path: "/processes", action: () => import("./layouts/DojoAdapter").then(_ => <_.DojoAdapter widgetClassID="ClusterProcessesQueryWidget" />) - }, - { - mainNav: ["topology-bare-metal"], - path: "/servers", action: () => import("./layouts/DojoAdapter").then(_ => <_.DojoAdapter widgetClassID="SystemServersQueryWidget" />) - }, - { - mainNav: ["topology-bare-metal"], - path: "/machines", + mainNav: ["operations"], + path: "/operations", children: [ + { path: "", action: () => import("./layouts/DojoAdapter").then(_ => <_.DojoAdapter widgetClassID="TopologyWidget" />) }, + { path: "/diskusage", action: () => import("./layouts/DojoAdapter").then(_ => <_.DojoAdapter widgetClassID="DiskUsageWidget" />) }, + { + path: "/clusters", + children: [ + { path: "", action: () => import("./layouts/DojoAdapter").then(_ => <_.DojoAdapter widgetClassID="TargetClustersQueryWidget" />) }, + { path: "/:ClusterName", action: (ctx, params) => import("./layouts/DojoAdapter").then(_ => <_.DojoAdapter widgetClassID="TpClusterInfoWidget" params={params} />) }, + { path: "/:Cluster/usage", action: (ctx, params) => import("./components/DiskUsage").then(_ => <_.ClusterUsage cluster={params.Cluster as string} />) }, + ] + }, + { path: "/processes", action: () => import("./layouts/DojoAdapter").then(_ => <_.DojoAdapter widgetClassID="ClusterProcessesQueryWidget" />) }, + { path: "/servers", action: () => import("./layouts/DojoAdapter").then(_ => <_.DojoAdapter widgetClassID="SystemServersQueryWidget" />) }, { path: "/:Machine/usage", action: (ctx, params) => import("./components/DiskUsage").then(_ => <_.MachineUsage machine={params.Machine as string} />) }, - ] - }, - { - mainNav: ["topology-bare-metal"], - path: "/security", - children: [ - { path: "", action: (ctx, params) => import("./components/Security").then(_ => <_.Security filter={parseSearch(ctx.search) as any} page={parsePage(ctx.search)} />) }, - { path: "/:Tab", action: (ctx, params) => import("./components/Security").then(_ => <_.Security filter={parseSearch(ctx.search) as any} tab={params.Tab as string} page={parsePage(ctx.search)} />) }, - { path: "/users/:username", action: (ctx, params) => import("./components/UserDetails").then(_ => <_.UserDetails username={params.username as string} />) }, - { path: "/users/:username/:Tab", action: (ctx, params) => import("./components/UserDetails").then(_ => <_.UserDetails username={params.username as string} tab={params.Tab as string} />) }, - { path: "/groups/:name", action: (ctx, params) => import("./components/GroupDetails").then(_ => <_.GroupDetails name={params.name as string} />) }, - { path: "/groups/:name/:Tab", action: (ctx, params) => import("./components/GroupDetails").then(_ => <_.GroupDetails name={params.name as string} tab={params.Tab as string} />) }, - { path: "/permissions/:Name/:BaseDn", action: (ctx, params) => import("./components/Security").then(_ => <_.Security tab="permissions" name={params.Name as string} baseDn={params.BaseDn as string} />) }, - ] - }, - { - mainNav: ["topology-bare-metal"], - path: "/desdl", - children: [ - { path: "", action: (ctx, params) => import("./components/DynamicESDL").then(_ => <_.DynamicESDL />) }, - { path: "/:Tab", action: (ctx, params) => import("./components/DynamicESDL").then(_ => <_.DynamicESDL tab={params.Tab as string} />) }, - { path: "/bindings/:Name", action: (ctx, params) => import("./components/DESDLBindingDetails").then(_ => <_.DESDLBindingDetails name={params.Name as string} />) }, - { path: "/bindings/:Name/:Tab", action: (ctx, params) => import("./components/DESDLBindingDetails").then(_ => <_.DESDLBindingDetails name={params.Name as string} tab={params.Tab as string} />) }, + { + path: "/security", + children: [ + { path: "", action: (ctx, params) => import("./components/Security").then(_ => <_.Security filter={parseSearch(ctx.search) as any} page={parsePage(ctx.search)} />) }, + { path: "/:Tab", action: (ctx, params) => import("./components/Security").then(_ => <_.Security filter={parseSearch(ctx.search) as any} tab={params.Tab as string} page={parsePage(ctx.search)} />) }, + { path: "/users/:username", action: (ctx, params) => import("./components/UserDetails").then(_ => <_.UserDetails username={params.username as string} />) }, + { path: "/users/:username/:Tab", action: (ctx, params) => import("./components/UserDetails").then(_ => <_.UserDetails username={params.username as string} tab={params.Tab as string} />) }, + { path: "/groups/:name", action: (ctx, params) => import("./components/GroupDetails").then(_ => <_.GroupDetails name={params.name as string} />) }, + { path: "/groups/:name/:Tab", action: (ctx, params) => import("./components/GroupDetails").then(_ => <_.GroupDetails name={params.name as string} tab={params.Tab as string} />) }, + { path: "/permissions/:Name/:BaseDn", action: (ctx, params) => import("./components/Security").then(_ => <_.Security tab="permissions" name={params.Name as string} baseDn={params.BaseDn as string} />) }, + ] + }, + { + path: "/desdl", + children: [ + { path: "", action: (ctx, params) => import("./components/DynamicESDL").then(_ => <_.DynamicESDL />) }, + { path: "/:Tab", action: (ctx, params) => import("./components/DynamicESDL").then(_ => <_.DynamicESDL tab={params.Tab as string} />) }, + { path: "/bindings/:Name", action: (ctx, params) => import("./components/DESDLBindingDetails").then(_ => <_.DESDLBindingDetails name={params.Name as string} />) }, + { path: "/bindings/:Name/:Tab", action: (ctx, params) => import("./components/DESDLBindingDetails").then(_ => <_.DESDLBindingDetails name={params.Name as string} tab={params.Tab as string} />) }, + ] + } ] }, { diff --git a/esp/src/src/Utility.ts b/esp/src/src/Utility.ts index 6d11e1fe7c1..4f0c494dead 100644 --- a/esp/src/src/Utility.ts +++ b/esp/src/src/Utility.ts @@ -6,6 +6,7 @@ import * as domConstruct from "dojo/dom-construct"; import * as entities from "dojox/html/entities"; import { darkTheme } from "../src-react/themes"; import nlsHPCC from "src/nlsHPCC"; +import { cmake_build_type, containerized } from "src/BuildInfo"; declare const dojoConfig; declare const ActiveXObject; @@ -1177,4 +1178,10 @@ export function wrapStringWithTag(string, tag = "span") { export function isSpill(sourceKind: string, targetKind: string): boolean { return sourceKind === "2" || targetKind === "71"; -} \ No newline at end of file +} + +export const opsRouteCategory = (cmake_build_type !== "Debug") ? + // not a Debug build, check if containerized + ((containerized) ? "topology" : "operations") : + // Debug build, use first segment of current hash after # + document.location.hash.indexOf("stub") > -1 ? "operations" : document.location.hash.split("/")[1]; \ No newline at end of file