-
Notifications
You must be signed in to change notification settings - Fork 745
Add ConsoleCLIDownload CRD extension #1441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-robot
merged 1 commit into
openshift:master
from
rhamilto:command-line-tools-page
Jun 25, 2019
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| import * as React from 'react'; | ||
| import { Helmet } from 'react-helmet'; | ||
| import * as _ from 'lodash-es'; | ||
|
|
||
| import { OC_DOWNLOAD_LINK, ODO_DOWNLOAD_LINK, FLAGS } from '../const'; | ||
| import { ExternalLink, Firehose, FirehoseResult } from './utils'; | ||
| import { connectToFlags } from '../reducers/features'; | ||
| import { ConsoleCLIDownloadModel } from '../models'; | ||
| import { referenceForModel } from '../module/k8s'; | ||
| import { MarkdownView } from './operator-lifecycle-manager/clusterserviceversion'; | ||
|
|
||
| const CommandLineTools: React.FC<CommandLineToolsProps> = ({obj}) => { | ||
| const title = 'Command Line Tools'; | ||
| const additionalCommandLineTools = _.map(_.sortBy(_.get(obj, 'data'), 'spec.displayName'), (tool) => { | ||
| const displayName = tool.spec.displayName; | ||
| const defaultLinkText = `Download ${displayName}`; | ||
| return <React.Fragment key={tool.metadata.uid}> | ||
| <hr /> | ||
| <h2 className="co-section-heading">{displayName}</h2> | ||
| <MarkdownView content={tool.spec.description} exactHeight /> | ||
| {tool.spec.links.length === 1 && <p><ExternalLink href={tool.spec.links[0].href} text={tool.spec.links[0].text || defaultLinkText} /></p>} | ||
| {tool.spec.links.length > 1 && <ul> | ||
| {_.map(tool.spec.links, (link, i) => <li key={i}><ExternalLink href={link.href} text={link.text || defaultLinkText} /></li>)} | ||
| </ul>} | ||
| </React.Fragment>; | ||
| }); | ||
|
|
||
| return <React.Fragment> | ||
| <Helmet> | ||
| <title>{title}</title> | ||
| </Helmet> | ||
| <div className="co-m-pane__body"> | ||
| <h1 className="co-m-pane__heading"> | ||
| <div className="co-m-pane__name"> | ||
| {title} | ||
| </div> | ||
| </h1> | ||
| <h2 className="co-section-heading">oc - OpenShift Command Line Interface (CLI)</h2> | ||
| <p>With the OpenShift command line interface, you can create applications and manage OpenShift projects from a terminal.</p> | ||
| <p>The oc binary offers the same capabilities as the kubectl binary, but it is further extended to natively support OpenShift Container Platform features.</p> | ||
| <p> | ||
| <ExternalLink href={OC_DOWNLOAD_LINK} text="Download oc" /> | ||
| {(window as any).SERVER_FLAGS.requestTokenURL && ( | ||
| <React.Fragment> | ||
| <span className="co-action-divider" aria-hidden="true">|</span> | ||
| <ExternalLink href={(window as any).SERVER_FLAGS.requestTokenURL} text="Copy Login Command" /> | ||
| </React.Fragment> | ||
| )} | ||
| </p> | ||
| <hr /> | ||
| <h2 className="co-section-heading">odo - Developer-focused CLI for OpenShift</h2> | ||
| <p><span className="label label-warning">Tech Preview</span></p> | ||
| <p>OpenShift Do (odo) is a fast, iterative, and straightforward CLI tool for developers who write, build, and deploy applications on OpenShift.</p> | ||
| <p>odo abstracts away complex Kubernetes and OpenShift concepts, thus allowing developers to focus on what is most important to them: code.</p> | ||
| <p><ExternalLink href={ODO_DOWNLOAD_LINK} text="Download odo" /></p> | ||
| {additionalCommandLineTools} | ||
| </div> | ||
| </React.Fragment>; | ||
| }; | ||
|
|
||
| export const CommandLineToolsPage = connectToFlags(FLAGS.CONSOLE_CLI_DOWNLOAD)(({ flags, ...props }) => { | ||
| const resources = flags[FLAGS.CONSOLE_CLI_DOWNLOAD] | ||
| ? [{ | ||
| kind: referenceForModel(ConsoleCLIDownloadModel), | ||
| isList: true, | ||
| prop: 'obj', | ||
| }] | ||
| : []; | ||
|
|
||
| return <Firehose resources={resources}> | ||
| <CommandLineTools {...props as any} /> | ||
| </Firehose>; | ||
| }); | ||
|
|
||
| type CommandLineToolsProps = { | ||
| obj: FirehoseResult; | ||
| }; |
This file contains hidden or 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
31 changes: 0 additions & 31 deletions
31
frontend/public/components/modals/command-line-tools-modal.tsx
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.