-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Configurable ArgoCD binary download links on Help page. Fixes #…
…7698 (#7755) feat: Configurable ArgoCD binary download links on Help page. Fixes #7698 (#7755) Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
- Loading branch information
1 parent
394a2c8
commit d8cfafb
Showing
9 changed files
with
379 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,84 @@ | ||
import * as React from 'react'; | ||
import {Page} from '../../shared/components'; | ||
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'; | ||
|
||
require('./help.scss'); | ||
|
||
export const Help = () => ( | ||
<Consumer> | ||
{ctx => ( | ||
<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 | ||
</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> | ||
); | ||
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> | ||
| ||
{binaryUrls.hasOwnProperty('linux-arm64') && ( | ||
<a href={`${binaryUrls['linux-arm64']}`} className='user-info-panel-buttons argo-button argo-button--base'> | ||
<i className='fab fa-linux' /> Linux (arm64) | ||
</a> | ||
)} | ||
| ||
{binaryUrls.hasOwnProperty('darwin-amd64') && ( | ||
<a href={`${binaryUrls['darwin-amd64']}`} className='user-info-panel-buttons argo-button argo-button--base'> | ||
<i className='fab fa-apple' /> MacOS (amd64) | ||
</a> | ||
)} | ||
| ||
{binaryUrls.hasOwnProperty('darwin-arm64') && ( | ||
<a href={`${binaryUrls['darwin-arm64']}`} className='user-info-panel-buttons argo-button argo-button--base'> | ||
<i className='fab fa-apple' /> MacOS (arm64) | ||
</a> | ||
)} | ||
| ||
{binaryUrls.hasOwnProperty('windows-amd64') && ( | ||
<a href={`${binaryUrls['windows-amd64']}`} className='user-info-panel-buttons argo-button argo-button--base'> | ||
<i className='fab fa-windows' /> Windows | ||
</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> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters