Skip to content

Commit

Permalink
Show private ports
Browse files Browse the repository at this point in the history
  • Loading branch information
Dartoxian committed Nov 7, 2023
1 parent c2343c9 commit 09fe294
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 16 deletions.
23 changes: 14 additions & 9 deletions enclave-manager/web/src/components/enclaves/tables/PortsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ import { useMemo } from "react";
import { DataTable } from "../../DataTable";
import { transportProtocolToString } from "../utils";
import { CopyButton } from "../../CopyButton";
import { ExternalLinkIcon } from "@chakra-ui/icons";

const columnHelper = createColumnHelper<Port>();

type PortsTableProps = {
ports: Port[];
ip: string;
isPublic?: boolean;
};

export const PortsTable = ({ ports, ip }: PortsTableProps) => {
export const PortsTable = ({ ports, ip, isPublic }: PortsTableProps) => {
const columns = useMemo<ColumnDef<Port, any>[]>(
() => [
columnHelper.accessor("number", {
Expand All @@ -32,14 +34,17 @@ export const PortsTable = ({ ports, ip }: PortsTableProps) => {
minSize: 800,
cell: ({ row }) => (
<Text width={"100%"}>
<Link
href={`${row.original.maybeApplicationProtocol}://${ip}:${row.original.number}`}
target="_blank"
rel="noopener noreferrer"
isExternal
>
{row.original.maybeApplicationProtocol}://{ip}:{row.original.number}
</Link>
{isPublic && (
<Link
href={`${row.original.maybeApplicationProtocol}://${ip}:${row.original.number}`}
target="_blank"
rel="noopener noreferrer"
isExternal
>
{row.original.maybeApplicationProtocol}://{ip}:{row.original.number} <ExternalLinkIcon mx="2px" />
</Link>
)}
{!isPublic && `${row.original.maybeApplicationProtocol}://${ip}:${row.original.number}`}
</Text>
),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { useMemo } from "react";
import { CodeEditor } from "../../../../../components/CodeEditor";
import { FileDisplay } from "../../../../../components/FileDisplay";
import { PortsTable } from "../../../../../components/enclaves/tables/PortsTable";
import { TitledCard } from "../../../../../components/TitledCard";

type ServiceOverviewProps = {
service: ServiceInfo;
Expand Down Expand Up @@ -42,9 +43,12 @@ export const ServiceOverview = ({ service }: ServiceOverviewProps) => {
/>
</GridItem>
</Grid>
<Card>
<PortsTable ports={Object.values(service.maybePublicPorts)} ip={service.maybePublicIpAddr} />
</Card>
<TitledCard title={"Public Ports"}>
<PortsTable ports={Object.values(service.maybePublicPorts)} ip={service.maybePublicIpAddr} isPublic />
</TitledCard>
<TitledCard title={"Private Ports"}>
<PortsTable ports={Object.values(service.privatePorts)} ip={service.privateIpAddr} />
</TitledCard>
{isDefined(service.container) && <ContainerOverview container={service.container} />}
{!isDefined(service.container) && (
<KurtosisAlert message={"No container details are available for this service."} />
Expand Down
6 changes: 3 additions & 3 deletions engine/server/webapp/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"files": {
"main.js": "./static/js/main.308dcf38.js",
"main.js": "./static/js/main.90108866.js",
"index.html": "./index.html",
"main.308dcf38.js.map": "./static/js/main.308dcf38.js.map"
"main.90108866.js.map": "./static/js/main.90108866.js.map"
},
"entrypoints": [
"static/js/main.308dcf38.js"
"static/js/main.90108866.js"
]
}
2 changes: 1 addition & 1 deletion engine/server/webapp/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="The Kurtosis Enclave Manager Web UI."/><title>Kurtosis Enclave Manager</title><script defer="defer" src="./static/js/main.308dcf38.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="The Kurtosis Enclave Manager Web UI."/><title>Kurtosis Enclave Manager</title><script defer="defer" src="./static/js/main.90108866.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
3 changes: 3 additions & 0 deletions engine/server/webapp/static/js/main.90108866.js

Large diffs are not rendered by default.

114 changes: 114 additions & 0 deletions engine/server/webapp/static/js/main.90108866.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/

/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @remix-run/router v1.10.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
* React Router DOM v6.17.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
* React Router v6.17.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
* react-table
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
* table-core
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
1 change: 1 addition & 0 deletions engine/server/webapp/static/js/main.90108866.js.map

Large diffs are not rendered by default.

0 comments on commit 09fe294

Please sign in to comment.