mirror of
https://github.com/ansible/awx.git
synced 2026-01-24 16:01:20 -03:30
add some links to docs
This commit is contained in:
parent
775c0b02ee
commit
64b9d61dd4
@ -78,7 +78,8 @@
|
||||
"src",
|
||||
"theme",
|
||||
"gridColumns",
|
||||
"rows"
|
||||
"rows",
|
||||
"href"
|
||||
],
|
||||
"ignore": ["Ansible", "Tower", "JSON", "YAML", "lg"],
|
||||
"ignoreComponent": [
|
||||
|
||||
0
awx/ui_next/src/components/DocsLink/DocsLink.jsx
Normal file
0
awx/ui_next/src/components/DocsLink/DocsLink.jsx
Normal file
1
awx/ui_next/src/components/DocsLink/index.jsx
Normal file
1
awx/ui_next/src/components/DocsLink/index.jsx
Normal file
@ -0,0 +1 @@
|
||||
export { default } from './DocsLink';
|
||||
@ -11,9 +11,12 @@ import {
|
||||
SelectOption,
|
||||
SelectVariant,
|
||||
TextInput,
|
||||
Tooltip,
|
||||
} from '@patternfly/react-core';
|
||||
import { SearchIcon } from '@patternfly/react-icons';
|
||||
import { SearchIcon, QuestionCircleIcon } from '@patternfly/react-icons';
|
||||
import styled from 'styled-components';
|
||||
import { useConfig } from '../../contexts/Config';
|
||||
import getDocsBaseUrl from '../../util/getDocsBaseUrl';
|
||||
|
||||
const AdvancedGroup = styled.div`
|
||||
display: flex;
|
||||
@ -45,6 +48,7 @@ function AdvancedSearch({
|
||||
const [lookupSelection, setLookupSelection] = useState(null);
|
||||
const [keySelection, setKeySelection] = useState(null);
|
||||
const [searchValue, setSearchValue] = useState('');
|
||||
const config = useConfig();
|
||||
|
||||
const handleAdvancedSearch = e => {
|
||||
// keeps page from fully reloading
|
||||
@ -262,6 +266,19 @@ function AdvancedSearch({
|
||||
</Button>
|
||||
</div>
|
||||
</InputGroup>
|
||||
<Tooltip
|
||||
content={i18n._(t`Advanced search documentation`)}
|
||||
position="bottom"
|
||||
>
|
||||
<Button
|
||||
component="a"
|
||||
variant="plain"
|
||||
target="_blank"
|
||||
href={`${getDocsBaseUrl(config)}/html/userguide/search_sort.html`}
|
||||
>
|
||||
<QuestionCircleIcon />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</AdvancedGroup>
|
||||
);
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ import {
|
||||
ToolbarToggleGroup,
|
||||
Tooltip,
|
||||
} from '@patternfly/react-core';
|
||||
import { SearchIcon } from '@patternfly/react-icons';
|
||||
import { SearchIcon, QuestionCircleIcon } from '@patternfly/react-icons';
|
||||
|
||||
import AlertModal from '../../../components/AlertModal';
|
||||
import { CardBody as _CardBody } from '../../../components/Card';
|
||||
@ -47,6 +47,8 @@ import {
|
||||
removeParams,
|
||||
getQSConfig,
|
||||
} from '../../../util/qs';
|
||||
import getDocsBaseUrl from '../../../util/getDocsBaseUrl';
|
||||
import { useConfig } from '../../../contexts/Config';
|
||||
|
||||
const QS_CONFIG = getQSConfig('job_output', {
|
||||
order_by: 'start_line',
|
||||
@ -280,6 +282,7 @@ function JobOutput({ job, eventRelatedSearchableKeys, eventSearchableKeys }) {
|
||||
const jobSocketCounter = useRef(0);
|
||||
const interval = useRef(null);
|
||||
const history = useHistory();
|
||||
const config = useConfig();
|
||||
const [contentError, setContentError] = useState(null);
|
||||
const [cssMap, setCssMap] = useState({});
|
||||
const [currentlyLoading, setCurrentlyLoading] = useState([]);
|
||||
@ -730,6 +733,21 @@ function JobOutput({ job, eventRelatedSearchableKeys, eventSearchableKeys }) {
|
||||
) : (
|
||||
renderSearchComponent(i18n)
|
||||
)}
|
||||
<Tooltip
|
||||
content={i18n._(t`Job output documentation`)}
|
||||
position="bottom"
|
||||
>
|
||||
<Button
|
||||
component="a"
|
||||
variant="plain"
|
||||
target="_blank"
|
||||
href={`${getDocsBaseUrl(
|
||||
config
|
||||
)}/html/userguide/jobs.html#standard-out-pane`}
|
||||
>
|
||||
<QuestionCircleIcon />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</ToolbarItem>
|
||||
</ToolbarToggleGroup>
|
||||
</SearchToolbarContent>
|
||||
|
||||
7
awx/ui_next/src/util/getDocsBaseUrl.js
Normal file
7
awx/ui_next/src/util/getDocsBaseUrl.js
Normal file
@ -0,0 +1,7 @@
|
||||
export default function getDocsBaseUrl(config) {
|
||||
let version = 'latest';
|
||||
if (config?.license_info?.license_type !== 'open') {
|
||||
version = config?.version ? config.version.split('-')[0] : 'latest';
|
||||
}
|
||||
return `https://docs.ansible.com/ansible-tower/${version}`;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user