diff --git a/esp/src/package-lock.json b/esp/src/package-lock.json index 682bf16aac3..287f20927dc 100644 --- a/esp/src/package-lock.json +++ b/esp/src/package-lock.json @@ -17,7 +17,7 @@ "@hpcc-js/chart": "2.81.7", "@hpcc-js/codemirror": "2.60.12", "@hpcc-js/common": "2.71.12", - "@hpcc-js/comms": "2.84.4", + "@hpcc-js/comms": "2.85.0", "@hpcc-js/dataflow": "8.1.6", "@hpcc-js/eclwatch": "2.73.27", "@hpcc-js/graph": "2.85.8", @@ -1577,9 +1577,9 @@ } }, "node_modules/@hpcc-js/comms": { - "version": "2.84.4", - "resolved": "https://registry.npmjs.org/@hpcc-js/comms/-/comms-2.84.4.tgz", - "integrity": "sha512-GkKUyttPRYPb/jluoNtxY6jEqJhF2Dr0srzXrF+Vs0biyr4GvwQzMcoQfU97PQl7PJx8M+FUquMchfuQ7sqSWA==", + "version": "2.85.0", + "resolved": "https://registry.npmjs.org/@hpcc-js/comms/-/comms-2.85.0.tgz", + "integrity": "sha512-ZnvI7T35qyj6Dm1uT7f+j1Xgq0QGPyMAypGq8jacq2VAo2Q24eg/AL57E8PBLOM1Q0UAV/WYJqz4eTk9n+UwgQ==", "dependencies": { "@hpcc-js/ddl-shim": "^2.20.6", "@hpcc-js/util": "^2.50.6", diff --git a/esp/src/package.json b/esp/src/package.json index ef77a32ff76..6df836b8b9d 100644 --- a/esp/src/package.json +++ b/esp/src/package.json @@ -42,7 +42,7 @@ "@hpcc-js/chart": "2.81.7", "@hpcc-js/codemirror": "2.60.12", "@hpcc-js/common": "2.71.12", - "@hpcc-js/comms": "2.84.4", + "@hpcc-js/comms": "2.85.0", "@hpcc-js/dataflow": "8.1.6", "@hpcc-js/eclwatch": "2.73.27", "@hpcc-js/graph": "2.85.8", diff --git a/esp/src/src-react/components/Logs.tsx b/esp/src/src-react/components/Logs.tsx index 5d857e364fb..7d5a9f27c05 100644 --- a/esp/src/src-react/components/Logs.tsx +++ b/esp/src/src-react/components/Logs.tsx @@ -20,6 +20,7 @@ const defaultStartDate = new Date(new Date().getTime() - startTimeOffset); const FilterFields: Fields = { components: { type: "cloud-containername", label: nlsHPCC.ContainerName }, + instance: { type: "cloud-podname", label: nlsHPCC.PodName }, audience: { type: "dropdown", label: nlsHPCC.Audience, options: [ { key: TargetAudience.Operator, text: "Operator" }, @@ -130,6 +131,7 @@ export const Logs: React.FunctionComponent = ({ timestamp: { label: nlsHPCC.TimeStamp, width: 140, sortable: false, }, message: { label: nlsHPCC.Message, sortable: false, }, components: { label: nlsHPCC.ContainerName, width: 150, sortable: false }, + instance: { label: nlsHPCC.PodName, width: 150, sortable: false }, audience: { label: nlsHPCC.Audience, width: 60, sortable: false, }, class: { label: nlsHPCC.Class, width: 40, sortable: false, diff --git a/esp/src/src-react/components/forms/Fields.tsx b/esp/src/src-react/components/forms/Fields.tsx index af684b039e1..9efe0fdc8a7 100644 --- a/esp/src/src-react/components/forms/Fields.tsx +++ b/esp/src/src-react/components/forms/Fields.tsx @@ -10,7 +10,7 @@ import { FileList, States as DFUStates } from "src/FileSpray"; import { joinPath } from "src/Utility"; import nlsHPCC from "src/nlsHPCC"; import { useBuildInfo, useLogicalClusters } from "../../hooks/platform"; -import { useContainerNames } from "../../hooks/cloud"; +import { useContainerNames, usePodNames } from "../../hooks/cloud"; const logger = scopedLogger("src-react/components/forms/Fields.tsx"); @@ -200,7 +200,7 @@ export type FieldType = "string" | "password" | "number" | "checkbox" | "choiceg "target-dfuqueue" | "user-groups" | "group-members" | "permission-type" | "logicalfile-type" | "dfuworkunit-state" | "esdl-esp-processes" | "esdl-definitions" | - "cloud-containername"; + "cloud-containername" | "cloud-podname"; export type Values = { [name: string]: string | number | boolean | (string | number | boolean)[] }; @@ -369,6 +369,11 @@ interface CloudContainerNameField extends BaseField { value?: string; } +interface CloudPodNameField extends BaseField { + type: "cloud-podname"; + value?: string; +} + export type Field = StringField | NumericField | CheckboxField | ChoiceGroupField | DateTimeField | DropdownField | DropdownMultiField | LinkField | LinksField | ProgressField | WorkunitStateField | @@ -378,7 +383,7 @@ export type Field = StringField | NumericField | CheckboxField | ChoiceGroupFiel TargetDfuSprayQueueField | UserGroupsField | GroupMembersField | PermissionTypeField | LogicalFileType | DFUWorkunitStateField | EsdlEspProcessesField | EsdlDefinitionsField | - CloudContainerNameField; + CloudContainerNameField | CloudPodNameField; export type Fields = { [id: string]: Field }; @@ -766,6 +771,28 @@ export const CloudContainerNameField: React.FunctionComponent; }; +export interface CloudPodNameFieldProps extends Omit { + name?: string; +} + +export const CloudPodNameField: React.FunctionComponent = (props) => { + + const [cloudPodNames] = usePodNames(); + const [options, setOptions] = React.useState(); + + React.useEffect(() => { + const options = cloudPodNames?.map(row => { + return { + key: row, + text: row + }; + }) || []; + setOptions(options); + }, [cloudPodNames]); + + return ; +}; + const states = Object.keys(States).map(s => States[s]); const dfustates = Object.keys(DFUStates).map(s => DFUStates[s]); @@ -1260,7 +1287,21 @@ export function createInputs(fields: Fields, onChange?: (id: string, newValue: a /> }); break; - + case "cloud-podname": + field.value = field.value !== undefined ? field.value : ""; + retVal.push({ + id: fieldID, + label: field.label, + field: { + onChange(fieldID, row.key); + setDropzone(row.key as string); + }} + placeholder={field.placeholder} + /> + }); + break; } } return retVal; diff --git a/esp/src/src-react/hooks/cloud.ts b/esp/src/src-react/hooks/cloud.ts index 117ddddbfd6..fdc62c19724 100644 --- a/esp/src/src-react/hooks/cloud.ts +++ b/esp/src/src-react/hooks/cloud.ts @@ -84,4 +84,14 @@ export function useContainerNames(): [string[], () => void] { }, [pods]); return [containers, refreshData]; +} + +export function usePodNames(): [string[], () => void] { + + const [pods, refreshData] = usePods(); + const podNames = React.useMemo(() => { + return pods.map(pod => pod.name); + }, [pods]); + + return [podNames, refreshData]; } \ No newline at end of file diff --git a/esp/src/src/nls/hpcc.ts b/esp/src/src/nls/hpcc.ts index 1fe2ef88fde..5fb8a7659b0 100644 --- a/esp/src/src/nls/hpcc.ts +++ b/esp/src/src/nls/hpcc.ts @@ -686,6 +686,7 @@ export = { Plugins: "Plugins", PleaseEnterANumber: "Please enter a number 1 - ", PleaseLogin: "Please log in using your username and password", + PodName: "Pod Name", Pods: "Pods", PodsAccessError: "Cannot retrieve list of pods", Port: "Port",