-
Notifications
You must be signed in to change notification settings - Fork 5.6k
/
help.tsx
82 lines (80 loc) · 4.53 KB
/
help.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import * as React from 'react';
import {DataLoader, Page} from '../../shared/components';
import {Consumer} from '../../shared/context';
import {combineLatest} from 'rxjs';
import {services} from '../../shared/services';
import {map} from 'rxjs/operators';
import classNames from 'classnames';
require('./help.scss');
export const Help = () => {
return (
<DataLoader
load={() =>
combineLatest([services.authService.settings()]).pipe(
map(items => {
return {
binaryUrls: items[0].help.binaryUrls || {}
};
})
)
}>
{({binaryUrls}: {binaryUrls: Record<string, string>}) => {
return (
<Consumer>
{() => (
<Page title='Help'>
<div className='row'>
<div className='columns large-4 small-6'>
<div className='help-box'>
<p>New to Argo CD?</p>
<a className='user-info-panel-buttons argo-button argo-button--base' href='https://argo-cd.readthedocs.io'>
Read the docs
</a>
</div>
</div>
<div className='columns large-4 small-6'>
<div className='help-box'>
<p>Want to download the CLI tool?</p>
<a href={`download/argocd-linux-${process.env.HOST_ARCH}`} className='user-info-panel-buttons argo-button argo-button--base'>
<i className='fab fa-linux' /> Linux (amd64)
</a>
{Object.keys(binaryUrls || {}).map(binaryName => {
const url = binaryUrls[binaryName];
const match = binaryName.match(/.*(darwin|windows|linux)-(amd64|arm64)/);
const [platform, arch] = match ? match.slice(1) : ['', ''];
return (
<>
<a key={binaryName} href={url} className='user-info-panel-buttons argo-button argo-button--base'>
<i
className={classNames('fab', {
'fa-windows': platform === 'windows',
'fa-apple': platform === 'darwin',
'fa-linux': platform === 'linux'
})}
/>
{` ${platform}`} {arch && `(${arch})`}
</a>
</>
);
})}
</div>
</div>
<div className='columns large-4 small-6'>
<div className='help-box'>
<p>You want to develop against Argo CD's API?</p>
<a className='user-info-panel-buttons argo-button argo-button--base' href='/swagger-ui'>
Open the API docs
</a>
</div>
</div>
</div>
</Page>
)}
</Consumer>
);
}}
</DataLoader>
);
};