Skip to content

Commit

Permalink
Merge branch 'master' into add.id
Browse files Browse the repository at this point in the history
  • Loading branch information
mareklibra authored Jun 25, 2020
2 parents 048360d + 56a673f commit 9fa220c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "facet-lib",
"version": "1.0.11",
"version": "1.0.12",
"description": "React component library for the Bare Metal Installer",
"author": "mareklibra",
"license": "Apache-2.0",
Expand Down
9 changes: 6 additions & 3 deletions src/api/clusters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,17 @@ export const createClusterDownloadsImage = (
axiosOptions: AxiosRequestConfig,
): AxiosPromise<void> => client.post(`/clusters/${id}/downloads/image`, params, axiosOptions);

// TODO(jtomasek): make the API_ROOT configurable so this can be used in cloud.redhat.com
const API_ROOT = process.env.REACT_APP_API_ROOT;

export const getClusterDownloadsImageUrl = (clusterId: string) =>
`/clusters/${clusterId}/downloads/image`;
`${API_ROOT}/clusters/${clusterId}/downloads/image`;

export const getClusterFileURL = (clusterID: string, fileName: string) =>
`/clusters/${clusterID}/downloads/files?file_name=${fileName}`;
`${API_ROOT}/clusters/${clusterID}/downloads/files?file_name=${fileName}`;

export const getClusterKubeconfigURL = (clusterID: string) =>
`/clusters/${clusterID}/downloads/kubeconfig`;
`${API_ROOT}/clusters/${clusterID}/downloads/kubeconfig`;

export const getClusterCredentials = (clusterID: string): AxiosPromise<Credentials> =>
client.get(`/clusters/${clusterID}/credentials`);
2 changes: 1 addition & 1 deletion src/api/versions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AxiosPromise } from 'axios';
import { client } from './axiosClient';

export const getVersions = (): AxiosPromise => client.get('/versions');
export const getVersions = (): AxiosPromise => client.get('/component_versions');
7 changes: 6 additions & 1 deletion src/components/hosts/HostsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ const HostsTable: React.FC<HostsTableProps> = ({ cluster }) => {
[setSortBy, setOpenRows],
);

const getHostInventory = (hostId: Host['id']): Inventory =>
hostRows.find((hostRow) => hostRow.extraData?.id === hostId)?.inventory;

return (
<>
<Table
Expand All @@ -307,7 +310,9 @@ const HostsTable: React.FC<HostsTableProps> = ({ cluster }) => {
<TableBody rowKey={rowKey} />
</Table>
<EventsModal
title="Host Events"
title={`Events for the ${
getHostInventory(showEventsModal)?.hostname || showEventsModal
} host`}
entityKind="host"
entityId={showEventsModal}
onClose={() => setShowEventsModal('')}
Expand Down
1 change: 1 addition & 0 deletions src/components/ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export * from './utils';
export * from './formik';
export * from './Toolbar';
export * from './Alerts';
export * from './DetailList';

export { default as PageSection } from './PageSection';
export { default as ExternalLink } from './ExternalLink';

0 comments on commit 9fa220c

Please sign in to comment.