mirror of
https://github.com/ansible/awx.git
synced 2026-02-12 07:04:45 -03:30
Listener Addresses is a better name to emphasize these are routable addresses to reach a listener service on the node. Also removed expand toggle on the listener addresses list items, as the expanded mode had no additional information. Signed-off-by: Seth Foster <fosterbseth@gmail.com>
57 lines
1.8 KiB
JavaScript
57 lines
1.8 KiB
JavaScript
import React, { useCallback, useState } from 'react';
|
|
|
|
import { t } from '@lingui/macro';
|
|
import { Route, Switch } from 'react-router-dom';
|
|
import ScreenHeader from 'components/ScreenHeader';
|
|
import PersistentFilters from 'components/PersistentFilters';
|
|
import { InstanceList } from './InstanceList';
|
|
import Instance from './Instance';
|
|
import InstanceAdd from './InstanceAdd';
|
|
import InstanceEdit from './InstanceEdit';
|
|
|
|
function Instances() {
|
|
const [breadcrumbConfig, setBreadcrumbConfig] = useState({
|
|
'/instances': t`Instances`,
|
|
'/instances/add': t`Create new Instance`,
|
|
});
|
|
|
|
const buildBreadcrumbConfig = useCallback((instance) => {
|
|
if (!instance) {
|
|
return;
|
|
}
|
|
setBreadcrumbConfig({
|
|
'/instances': t`Instances`,
|
|
'/instances/add': t`Create new Instance`,
|
|
[`/instances/${instance.id}`]: `${instance.hostname}`,
|
|
[`/instances/${instance.id}/details`]: t`Details`,
|
|
[`/instances/${instance.id}/peers`]: t`Peers`,
|
|
[`/instances/${instance.id}/listener_addresses`]: t`Listener Addresses`,
|
|
[`/instances/${instance.id}/edit`]: t`Edit Instance`,
|
|
});
|
|
}, []);
|
|
|
|
return (
|
|
<>
|
|
<ScreenHeader streamType="instance" breadcrumbConfig={breadcrumbConfig} />
|
|
<Switch>
|
|
<Route path="/instances/add">
|
|
<InstanceAdd setBreadcrumb={buildBreadcrumbConfig} />
|
|
</Route>
|
|
<Route path="/instances/:id/edit" key="edit">
|
|
<InstanceEdit setBreadcrumb={buildBreadcrumbConfig} />
|
|
</Route>
|
|
<Route path="/instances/:id">
|
|
<Instance setBreadcrumb={buildBreadcrumbConfig} />
|
|
</Route>
|
|
<Route path="/instances">
|
|
<PersistentFilters pageKey="instances">
|
|
<InstanceList />
|
|
</PersistentFilters>
|
|
</Route>
|
|
</Switch>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default Instances;
|