diff --git a/src/App.js b/src/App.js index 9e987433eaf6a9f9a46ad3e719e3515680b7cf17..e926a92220957c31fe026b0a2bc7a6fd3646e275 100644 --- a/src/App.js +++ b/src/App.js @@ -88,7 +88,7 @@ function App() { element={<JobDetailsAccessControl exact />} /> <Route - path="/hosts/:id/:fqdn" + path="/hosts/:id" element={<HostDetailsAccessControl />} exact /> diff --git a/src/components/IOC/IOCTable/IOCTable.js b/src/components/IOC/IOCTable/IOCTable.js index a2d2d7c173daa1e41e345cf4a49f1da892aea403..d2ab4837843a2d8458191bd1857dce24227ec062 100644 --- a/src/components/IOC/IOCTable/IOCTable.js +++ b/src/components/IOC/IOCTable/IOCTable.js @@ -72,7 +72,7 @@ function createHostLink(host) { if (host?.hostId) { return ( <InternalLink - to={`/hosts/${host?.hostId}/${host.fqdn}`} + to={`/hosts/${host?.hostId}`} label={`Host details, ${host?.hostName}`} width="100%" > diff --git a/src/components/Job/JobDetails.js b/src/components/Job/JobDetails.js index 89ca1aa6b4a0981ba348b24e5d2c48e8f1c92b17..9bbc117d4c63cdcb1d4d73e901c90df4331106f5 100644 --- a/src/components/Job/JobDetails.js +++ b/src/components/Job/JobDetails.js @@ -37,7 +37,7 @@ const calculateHostText = (operation) => { if (operation.host.hostId && operation.host.externalIdValid) { return ( <InternalLink - to={`/hosts/${operation.host.hostId}/${operation.host.fqdn}`} + to={`/hosts/${operation.host.hostId}`} label={`Host Details, ${operation.host.fqdn}`} > {operation.host.fqdn} diff --git a/src/components/Job/JobTable/JobHostColumn.js b/src/components/Job/JobTable/JobHostColumn.js index 369b2e719f9f061136e07d3ace630e59ec1839bb..a06afea4265603ccba80636a7ea82a03d31b1d95 100644 --- a/src/components/Job/JobTable/JobHostColumn.js +++ b/src/components/Job/JobTable/JobHostColumn.js @@ -6,7 +6,7 @@ export const JobHostColumn = ({ job }) => { return ( <Stack> <InternalLink - to={`/hosts/${job?.host?.hostId}/${job?.host?.fqdn}`} + to={`/hosts/${job?.host?.hostId}`} label={`Host details, ${job.host?.hostName}`} > {job.host.hostName} diff --git a/src/components/host/HostTable.js b/src/components/host/HostTable.js index 8acf23a4d6b0579ebabe0fa09d0b30b7c925f582..a9d69e05840529b8fbf01faf3ea142ab519a89d3 100644 --- a/src/components/host/HostTable.js +++ b/src/components/host/HostTable.js @@ -21,7 +21,7 @@ export function createRow(host) { status: <HostStatus hostId={host.hostId} />, hostName: ( <InternalLink - to={`/hosts/${host.hostId}/${host.fqdn}`} + to={`/hosts/${host.hostId}`} label={`Host details, ${host.name}`} width="100%" > diff --git a/src/components/records/RecordHostLink.js b/src/components/records/RecordHostLink.js index 26861939c33a736465ab8564d2f2f3daa6c5b07a..135a2dde90fa04caf2c425c1494e5884b9f0fdfa 100644 --- a/src/components/records/RecordHostLink.js +++ b/src/components/records/RecordHostLink.js @@ -28,7 +28,7 @@ function createHostLink(fqdn, hostInfo) { if (hostInfo) { return ( <InternalLink - to={`/hosts/${hostInfo.hostId}/${fqdn}`} + to={`/hosts/${hostInfo.hostId}`} label={`Record host details, ${fqdn}}`} width="100%" > diff --git a/src/views/host/details/HostDetailsAccessControl.js b/src/views/host/details/HostDetailsAccessControl.js index 2057fade8ac82640d6fc25a62ac1c1679048d197..2bb2fbaaef6d106b0d7aa78e30c0c0ccc8268e03 100644 --- a/src/views/host/details/HostDetailsAccessControl.js +++ b/src/views/host/details/HostDetailsAccessControl.js @@ -4,15 +4,12 @@ import { HostDetailsContainer } from "./HostDetailsContainer"; import { useParams } from "react-router-dom"; export function HostDetailsAccessControl() { - const { id, fqdn } = useParams(); + const { id } = useParams(); return ( <RootPaper data-testid="host-details-container"> <AccessControl allowedRoles={[]}> - <HostDetailsContainer - hostId={id} - hostFqdn={fqdn} - /> + <HostDetailsContainer hostId={id} /> </AccessControl> </RootPaper> ); diff --git a/src/views/host/details/HostDetailsContainer.js b/src/views/host/details/HostDetailsContainer.js index 440ab0a4eba2c01b25a046ce88e6333a2efe38cc..3c30a771970065ed9b101b8a1b6171e8cbe02cc6 100644 --- a/src/views/host/details/HostDetailsContainer.js +++ b/src/views/host/details/HostDetailsContainer.js @@ -6,7 +6,7 @@ import NotFoundView from "../../../components/navigation/NotFoundView/NotFoundVi import { apiContext } from "../../../api/DeployApi"; import { useAPIMethod } from "@ess-ics/ce-ui-common"; -export function HostDetailsContainer({ hostId, hostFqdn }) { +export function HostDetailsContainer({ hostId }) { const [error, setError] = useState(null); const client = useContext(apiContext); @@ -19,13 +19,13 @@ export function HostDetailsContainer({ hostId, hostFqdn }) { const hostParams = useMemo( () => ({ - fqdn: hostFqdn + host_id: hostId }), - [hostFqdn] + [hostId] ); const { value: host, error: fetchError } = useAPIMethod({ - fcn: client.apis.Hosts.findNetBoxHostByFqdn, + fcn: client.apis.Hosts.findNetBoxHostByHostId, params: hostParams });