Skip to content

Commit 01d3ea5

Browse files
authored
Merge branch 'master' into nitish/argocd-plugin-support
2 parents 1687909 + 98faf39 commit 01d3ea5

File tree

7 files changed

+49
-9
lines changed

7 files changed

+49
-9
lines changed

docs/operator-manual/declarative-setup.md

+1
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,7 @@ Notes:
11991199
* Quote globs in your YAML to avoid parsing errors.
12001200
* Invalid globs result in the whole rule being ignored.
12011201
* If you add a rule that matches existing resources, these will appear in the interface as `OutOfSync`.
1202+
* Some excluded objects may already be in the controller cache. A restart of the controller will be necessary to remove them from the Application View.
12021203

12031204
## Mask sensitive Annotations on Secrets
12041205

ui/src/app/applications/components/application-resource-tree/application-resource-tree.scss

+3
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@
139139
box-shadow: 1px 1px 1px $argo-color-gray-4;
140140
background-color: white;
141141
margin-left: 215px;
142+
@include themify($themes) {
143+
background-color: themed('background-2');
144+
}
142145

143146
.theme-dark & {
144147
box-shadow: 1px 1px 1px $argo-color-gray-7;

ui/src/app/applications/components/applications-list/applications-filter.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {AppsListPreferences, services} from '../../../shared/services';
77
import {Filter, FiltersGroup} from '../filter/filter';
88
import * as LabelSelector from '../label-selector';
99
import {ComparisonStatusIcon, getAppDefaultSource, HealthStatusIcon} from '../utils';
10+
import {formatClusterQueryParam} from '../../../shared/utils';
1011

1112
export interface FilterResult {
1213
repos: boolean;
@@ -185,10 +186,7 @@ const ClusterFilter = (props: AppFilterProps) => {
185186
if (!cluster) {
186187
return dest.server || dest.name;
187188
}
188-
if (cluster.name === cluster.server) {
189-
return cluster.name;
190-
}
191-
return `${cluster.name} (${cluster.server})`;
189+
return formatClusterQueryParam(cluster);
192190
};
193191

194192
const [clusters, loading, error] = useData(() => services.clusters.list());

ui/src/app/settings/components/cluster-details/cluster-details.tsx

+19-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ import * as classNames from 'classnames';
22
import * as moment from 'moment';
33
import * as React from 'react';
44
import {FieldApi, FormField as ReactFormField, Text} from 'react-form';
5-
import {RouteComponentProps} from 'react-router-dom';
5+
import {RouteComponentProps, Link} from 'react-router-dom';
66
import {from, timer} from 'rxjs';
77
import {mergeMap} from 'rxjs/operators';
88

99
import {FormField, Ticker} from 'argo-ui';
1010
import {ConnectionStateIcon, DataLoader, EditablePanel, Page, Timestamp, MapInputField} from '../../../shared/components';
1111
import {Cluster} from '../../../shared/models';
1212
import {services} from '../../../shared/services';
13+
import {formatClusterQueryParam} from '../../../shared/utils';
1314

1415
function isRefreshRequested(cluster: Cluster): boolean {
1516
return cluster.info.connectionState.attemptedAt && cluster.refreshRequestedAt && moment(cluster.info.connectionState.attemptedAt).isBefore(moment(cluster.refreshRequestedAt));
@@ -86,6 +87,23 @@ export const ClusterDetails = (props: RouteComponentProps<{server: string}>) =>
8687
view: ((cluster.namespaces || []).length === 0 && 'All namespaces') || cluster.namespaces.join(', '),
8788
edit: formApi => <FormField formApi={formApi} field='namespaces' component={NamespacesEditor} />
8889
},
90+
{
91+
title: 'APPLICATIONS',
92+
view: (
93+
<div>
94+
<DataLoader load={() => services.applications.list([])}>
95+
{apps => (
96+
<Link to={`/applications?cluster=${formatClusterQueryParam(cluster)}`}>
97+
{
98+
apps.items.filter(app => app.spec.destination.name === cluster.name || app.spec.destination.server === cluster.server)
99+
.length
100+
}
101+
</Link>
102+
)}
103+
</DataLoader>
104+
</div>
105+
)
106+
},
89107
{
90108
title: 'LABELS',
91109
view: Object.keys(cluster.labels || [])

ui/src/app/settings/components/project-details/project-details.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as PropTypes from 'prop-types';
44
import * as React from 'react';
55
import {FormApi, Text} from 'react-form';
66
import {RouteComponentProps} from 'react-router';
7+
import {Link} from 'react-router-dom';
78

89
import {BadgePanel, CheckboxField, DataLoader, EditablePanel, ErrorNotification, MapInputField, Page, Query} from '../../../shared/components';
910
import {AppContext, Consumer, AuthSettingsCtx} from '../../../shared/context';
@@ -610,6 +611,16 @@ export class ProjectDetails extends React.Component<RouteComponentProps<{name: s
610611
<DataLoader load={() => services.projects.getLinks(proj.metadata.name)}>{links => <DeepLinks links={links.items} />}</DataLoader>
611612
</div>
612613
)
614+
},
615+
{
616+
title: 'APPLICATIONS',
617+
view: (
618+
<div>
619+
<DataLoader load={() => services.applications.list([proj.metadata.name])}>
620+
{apps => <Link to={'/applications?proj=' + proj.metadata.name}>{apps.items.length}</Link>}
621+
</DataLoader>
622+
</div>
623+
)
613624
}
614625
]}
615626
/>

ui/src/app/shared/services/applications-service.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,6 @@ export class ApplicationsService {
482482
if (tail) {
483483
search.set('tailLines', tail.toString());
484484
}
485-
if (sinceSeconds) {
486-
search.set('sinceSeconds', sinceSeconds.toString());
487-
}
488485
if (untilTime) {
489486
search.set('untilTime', untilTime);
490487
}
@@ -498,7 +495,11 @@ export class ApplicationsService {
498495
search.set('matchCase', matchCase.toString());
499496
}
500497
// The API requires that this field be set to a non-empty string.
501-
search.set('sinceSeconds', '0');
498+
if (sinceSeconds) {
499+
search.set('sinceSeconds', sinceSeconds.toString());
500+
} else {
501+
search.set('sinceSeconds', '0');
502+
}
502503
return search;
503504
}
504505

ui/src/app/shared/utils.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import {Cluster} from './models';
23

34
export function hashCode(str: string) {
45
let hash = 0;
@@ -104,3 +105,10 @@ export const useTheme = (props: {theme: string}) => {
104105

105106
return [theme];
106107
};
108+
109+
export const formatClusterQueryParam = (cluster: Cluster) => {
110+
if (cluster.name === cluster.server) {
111+
return cluster.name;
112+
}
113+
return `${cluster.name} (${cluster.server})`;
114+
};

0 commit comments

Comments
 (0)