Skip to content
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

feat(UI): Added link for docs to add clusters #17395

Merged
merged 7 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions ui/src/app/settings/components/clusters-list/cluster-list.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@import 'node_modules/argo-ui/src/styles/config';
@import 'node_modules/argo-ui/src/styles/theme';


.help-text {
color: $argo-color-gray-8;
@include themify($themes) {
color: themed('text-2');
}
a {
color: #007bff; /* Blue color for the link */
@include themify($themes) {
color: themed('light-argo-teal-7');
}
text-decoration: none; /* Remove default underline */
transition: color 0.3s ease; /* Smooth transition for color change */

&:hover {
color: #0056b3; /* Darker blue color on hover */
@include themify($themes) {
color: themed('light-argo-teal-5');
}
}
}
}
46 changes: 43 additions & 3 deletions ui/src/app/settings/components/clusters-list/clusters-list.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,59 @@
import {DropDownMenu, ErrorNotification, NotificationType} from 'argo-ui';
import {Tooltip} from 'argo-ui';
import {Tooltip, Toolbar} from 'argo-ui';
import * as React from 'react';
import {RouteComponentProps} from 'react-router-dom';
import {clusterName, ConnectionStateIcon, DataLoader, EmptyState, Page} from '../../../shared/components';
import {Consumer} from '../../../shared/context';
import {Consumer, Context} from '../../../shared/context';
import * as models from '../../../shared/models';
import {services} from '../../../shared/services';
import {AddAuthToToolbar} from '../../../shared/components';
import {Observable} from 'rxjs';

import './cluster-list.scss';

// CustomTopBar component similar to FlexTopBar in application-list panel
const CustomTopBar = (props: {toolbar?: Toolbar | Observable<Toolbar>}) => {
const ctx = React.useContext(Context);
const loadToolbar = AddAuthToToolbar(props.toolbar, ctx);
return (
<React.Fragment>
<div className='top-bar row top-bar' key='tool-bar'>
<DataLoader load={() => loadToolbar}>
{toolbar => (
<React.Fragment>
<div className='column small-11 flex-top-bar_center'>
<div className='top-bar'>
<div className='text-center'>
<span className='help-text'>
Refer to CLI{' '}
<a
href='https://argo-cd.readthedocs.io/en/stable/operator-manual/cluster-management/#adding-a-cluster'
target='_blank'
rel='noopener noreferrer'>
<i className='fa fa-external-link-alt' /> Documentation{' '}
</a>{' '}
for adding clusters.
</span>
</div>
</div>
</div>
<div className='columns small-1 top-bar__right-side'>{toolbar.tools}</div>
</React.Fragment>
)}
</DataLoader>
</div>
</React.Fragment>
);
};

export const ClustersList = (props: RouteComponentProps<{}>) => {
const clustersLoaderRef = React.useRef<DataLoader>();
return (
<Consumer>
{ctx => (
<React.Fragment>
<Page title='Clusters' toolbar={{breadcrumbs: [{title: 'Settings', path: '/settings'}, {title: 'Clusters'}]}}>
<Page title='Clusters' toolbar={{breadcrumbs: [{title: 'Settings', path: '/settings'}, {title: 'Clusters'}]}} hideAuth={true}>
<CustomTopBar />
<div className='repos-list'>
<div className='argo-container'>
<DataLoader
Expand Down
Loading