mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-23 09:18:26 +00:00
parent
488bdcf0e3
commit
4ec2ed3fe6
3 changed files with 15 additions and 4 deletions
|
|
@ -218,11 +218,13 @@ export const ApplicationsList = (props: RouteComponentProps<{}>) => {
|
|||
<ApplicationTiles
|
||||
applications={data}
|
||||
syncApplication={(appName) => ctx.navigation.goto('.', { syncApp: appName })}
|
||||
refreshApplication={(appName) => services.applications.get(appName, 'normal')}
|
||||
deleteApplication={(appName) => AppUtils.deleteApplication(appName, ctx)}
|
||||
/>
|
||||
) || (
|
||||
<ApplicationsTable applications={data}
|
||||
syncApplication={(appName) => ctx.navigation.goto('.', { syncApp: appName })}
|
||||
refreshApplication={(appName) => services.applications.get(appName, 'normal')}
|
||||
deleteApplication={(appName) => AppUtils.deleteApplication(appName, ctx)}
|
||||
/>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ import * as AppUtils from '../utils';
|
|||
|
||||
export const ApplicationsTable = (props: {
|
||||
applications: models.Application[];
|
||||
syncApplication: (appName: string, revision: string) => any;
|
||||
syncApplication: (appName: string) => any;
|
||||
refreshApplication: (appName: string) => any;
|
||||
deleteApplication: (appName: string) => any;
|
||||
}) => (
|
||||
<Consumer>
|
||||
|
|
@ -54,7 +55,8 @@ export const ApplicationsTable = (props: {
|
|||
</button>
|
||||
)
|
||||
} items={[
|
||||
{ title: 'Sync', action: () => props.syncApplication(app.metadata.name, app.spec.source.targetRevision || 'HEAD') },
|
||||
{ title: 'Sync', action: () => props.syncApplication(app.metadata.name) },
|
||||
{ title: 'Refresh', action: () => props.refreshApplication(app.metadata.name) },
|
||||
{ title: 'Delete', action: () => props.deleteApplication(app.metadata.name) },
|
||||
]} />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,13 +10,14 @@ import * as AppUtils from '../utils';
|
|||
export interface ApplicationTilesProps {
|
||||
applications: models.Application[];
|
||||
syncApplication: (appName: string) => any;
|
||||
refreshApplication: (appName: string) => any;
|
||||
deleteApplication: (appName: string) => any;
|
||||
}
|
||||
|
||||
export const ApplicationTiles = ({applications, syncApplication, deleteApplication}: ApplicationTilesProps) => (
|
||||
export const ApplicationTiles = ({applications, syncApplication, refreshApplication, deleteApplication}: ApplicationTilesProps) => (
|
||||
<Consumer>
|
||||
{(ctx) => (
|
||||
<div className='argo-table-list argo-table-list--clickable row small-up-1 medium-up-2 large-up-4'>
|
||||
<div className='argo-table-list argo-table-list--clickable row small-up-1 medium-up-2 large-up-3'>
|
||||
{applications.map((app) => (
|
||||
<div key={app.metadata.name} className='column column-block'>
|
||||
<div className={`argo-table-list__row
|
||||
|
|
@ -77,6 +78,12 @@ export const ApplicationTiles = ({applications, syncApplication, deleteApplicati
|
|||
syncApplication(app.metadata.name);
|
||||
}}><i className='fa fa-sync'/> Sync</a>
|
||||
|
||||
<a className='argo-button argo-button--base'
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
refreshApplication(app.metadata.name);
|
||||
}}><i className='fa fa-redo'/> Refresh</a>
|
||||
|
||||
<a className='argo-button argo-button--base' onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
deleteApplication(app.metadata.name);
|
||||
|
|
|
|||
Loading…
Reference in a new issue