// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import React from 'react'; import { connect } from 'react-redux'; import { Grid, Typography, Button, Card, CardContent, TableBody, TableCell, TableHead, TableRow, Table, Tooltip, IconButton } from '@material-ui/core'; import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles'; import { ArvadosTheme } from 'common/custom-theme'; import { Link } from 'react-router-dom'; import { Dispatch, compose } from 'redux'; import { RootState } from 'store/store'; import { HelpIcon, AddIcon, MoreVerticalIcon } from 'components/icon/icon'; import { loadRepositoriesData, openRepositoriesSampleGitDialog, openRepositoryCreateDialog } from 'store/repositories/repositories-actions'; import { RepositoryResource } from 'models/repositories'; import { openRepositoryContextMenu } from 'store/context-menu/context-menu-actions'; import { Routes } from 'routes/routes'; type CssRules = 'link' | 'button' | 'icon' | 'iconRow' | 'moreOptionsButton' | 'moreOptions' | 'cloneUrls'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ link: { textDecoration: 'none', color: theme.palette.primary.main, "&:hover": { color: theme.palette.primary.dark, transition: 'all 0.5s ease' } }, button: { textAlign: 'right', alignSelf: 'center' }, icon: { cursor: 'pointer', color: theme.palette.grey["500"], "&:hover": { color: theme.palette.common.black, transition: 'all 0.5s ease' } }, iconRow: { paddingTop: theme.spacing.unit * 2, textAlign: 'right' }, moreOptionsButton: { padding: 0 }, moreOptions: { textAlign: 'right', '&:last-child': { paddingRight: 0 } }, cloneUrls: { whiteSpace: 'pre-wrap' } }); const mapStateToProps = (state: RootState) => { return { repositories: state.repositories.items }; }; const mapDispatchToProps = (dispatch: Dispatch): Pick => ({ loadRepositories: () => dispatch(loadRepositoriesData()), onOptionsMenuOpen: (event, repository) => { dispatch(openRepositoryContextMenu(event, repository)); }, openRepositoriesSampleGitDialog: () => dispatch(openRepositoriesSampleGitDialog()), openRepositoryCreateDialog: () => dispatch(openRepositoryCreateDialog()) }); interface RepositoriesActionProps { loadRepositories: () => void; onOptionsMenuOpen: (event: React.MouseEvent, repository: RepositoryResource) => void; openRepositoriesSampleGitDialog: () => void; openRepositoryCreateDialog: () => void; } interface RepositoriesDataProps { repositories: RepositoryResource[]; } type RepositoriesProps = RepositoriesDataProps & RepositoriesActionProps & WithStyles; export const RepositoriesPanel = compose( withStyles(styles), connect(mapStateToProps, mapDispatchToProps))( class extends React.Component { componentDidMount() { this.props.loadRepositories(); } render() { const { classes, repositories, onOptionsMenuOpen, openRepositoriesSampleGitDialog, openRepositoryCreateDialog } = this.props; return ( When you are using an Arvados virtual machine, you should clone the https:// URLs. This will authenticate automatically using your API token.
In order to clone git repositories using SSH, add an SSH key to your account and clone the git@ URLs.
{repositories && Name URL {repositories.map((repository, index) => {repository.name} {repository.cloneUrls.join("\n")} onOptionsMenuOpen(event, repository)} className={classes.moreOptionsButton}> )}
}
); } } );