Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const mockDeployment = new Deployment({
},
spec: {
replicas: 3,
selector: { matchLabels: { app: 'headlamp' } },
template: {
spec: {
nodeName: 'mock-node',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const mockDeployment = new Deployment({
},
spec: {
replicas: 3,
selector: { matchLabels: { app: 'headlamp' } },
template: {
spec: {
nodeName: 'mock-node',
Expand Down
33 changes: 33 additions & 0 deletions frontend/src/components/cronjob/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { useParams } from 'react-router-dom';
import { apply } from '../../lib/k8s/api/v1/apply';
import CronJob from '../../lib/k8s/cronJob';
import Job from '../../lib/k8s/job';
import { localeDate } from '../../lib/util';
import { clusterAction } from '../../redux/clusterActionSlice';
import { AppDispatch } from '../../redux/stores/store';
import ActionButton from '../common/ActionButton';
Expand Down Expand Up @@ -236,6 +237,16 @@ export default function CronJobDetails(props: {
name: t('Schedule'),
value: getSchedule(item, i18n.language),
},
{
name: t('Time Zone'),
value: item.spec.timeZone,
hide: !item.spec.timeZone,
},
{
name: t('Concurrency Policy'),
value: item.spec.concurrencyPolicy,
hide: !item.spec.concurrencyPolicy,
},
{
name: t('translation|Suspend'),
value: (item.spec?.suspend ?? false).toString(),
Expand All @@ -245,10 +256,32 @@ export default function CronJobDetails(props: {
value: `${item.spec.startingDeadlineSeconds}s`,
hide: !item.spec.startingDeadlineSeconds,
},
{
name: t('Successful Jobs History Limit'),
value: item.spec.successfulJobsHistoryLimit,
hide: item.spec.successfulJobsHistoryLimit === undefined,
},
{
name: t('Failed Jobs History Limit'),
value: item.spec.failedJobsHistoryLimit,
hide: item.spec.failedJobsHistoryLimit === undefined,
},
{
name: t('Last Schedule'),
value: getLastScheduleTime(item),
},
{
name: t('Last Successful Time'),
value: item.status?.lastSuccessfulTime
? localeDate(item.status.lastSuccessfulTime)
: '',
hide: !item.status?.lastSuccessfulTime,
},
{
name: t('Active Jobs'),
value: item.status?.active?.length,
hide: !item.status?.active?.length,
},
]
}
extraSections={cronJob =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,20 @@
*
</p>
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-9i4s51-MuiGrid-root"
>
Concurrency Policy
</dt>
<dd
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-9 MuiGrid-grid-md-10 css-1dbzfsd-MuiGrid-root"
>
<span
class="MuiTypography-root MuiTypography-body1 css-e06lsu-MuiTypography-root"
>
Allow
</span>
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-9i4s51-MuiGrid-root"
>
Expand All @@ -237,6 +251,26 @@
false
</span>
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-9i4s51-MuiGrid-root"
>
Successful Jobs History Limit
</dt>
<dd
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-9 MuiGrid-grid-md-10 css-1dbzfsd-MuiGrid-root"
>
3
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-9i4s51-MuiGrid-root"
>
Failed Jobs History Limit
</dt>
<dd
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-9 MuiGrid-grid-md-10 css-1dbzfsd-MuiGrid-root"
>
1
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-1hrqr1q-MuiGrid-root"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,20 @@
* * * * *
</p>
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-9i4s51-MuiGrid-root"
>
Concurrency Policy
</dt>
<dd
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-9 MuiGrid-grid-md-10 css-1dbzfsd-MuiGrid-root"
>
<span
class="MuiTypography-root MuiTypography-body1 css-e06lsu-MuiTypography-root"
>
Allow
</span>
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-9i4s51-MuiGrid-root"
>
Expand All @@ -237,6 +251,26 @@
false
</span>
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-9i4s51-MuiGrid-root"
>
Successful Jobs History Limit
</dt>
<dd
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-9 MuiGrid-grid-md-10 css-1dbzfsd-MuiGrid-root"
>
3
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-9i4s51-MuiGrid-root"
>
Failed Jobs History Limit
</dt>
<dd
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-9 MuiGrid-grid-md-10 css-1dbzfsd-MuiGrid-root"
>
1
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-1hrqr1q-MuiGrid-root"
>
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/components/horizontalPodAutoscaler/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import { useTranslation } from 'react-i18next';
import { useParams } from 'react-router-dom';
import HPA from '../../lib/k8s/hpa';
import { localeDate } from '../../lib/util';
import Link from '../common/Link';
import { ConditionsSection } from '../common/Resource';
import { DetailsGrid } from '../common/Resource';
Expand Down Expand Up @@ -71,6 +72,11 @@ export default function HpaDetails(props: { name?: string; namespace?: string; c
desiredReplicas: item.status.desiredReplicas,
}),
},
{
name: t('translation|Last Scale Time'),
value: item.status.lastScaleTime ? localeDate(item.status.lastScaleTime) : '',
hide: !item.status.lastScaleTime,
},
]
}
extraSections={item =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,19 +310,33 @@
10
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-1hrqr1q-MuiGrid-root"
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-9i4s51-MuiGrid-root"
>
Deployment pods
</dt>
<dd
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-9 MuiGrid-grid-md-10 css-ui3itl-MuiGrid-root"
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-9 MuiGrid-grid-md-10 css-1dbzfsd-MuiGrid-root"
>
<span
class="MuiTypography-root MuiTypography-body1 css-e06lsu-MuiTypography-root"
>
1 current / 1 desired
</span>
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-1hrqr1q-MuiGrid-root"
>
Last Scale Time
</dt>
<dd
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-9 MuiGrid-grid-md-10 css-ui3itl-MuiGrid-root"
>
<span
class="MuiTypography-root MuiTypography-body1 css-e06lsu-MuiTypography-root"
>
2022-10-21T11:15:12.000Z
</span>
</dd>
</dl>
</div>
</div>
Expand Down
17 changes: 13 additions & 4 deletions frontend/src/components/ingress/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,17 @@ export default function IngressDetails(props: {
namespace={namespace}
cluster={cluster}
withEvents
extraInfo={ingress =>
ingress && [
extraInfo={ingress => {
if (!ingress) {
return null;
}
const addresses = ingress.getAddresses();
return [
{
name: t('translation|Address'),
value: addresses,
hide: !addresses,
},
{
name: t('Default Backend'),
value: getDefaultBackend(ingress),
Expand Down Expand Up @@ -250,8 +259,8 @@ export default function IngressDetails(props: {
</Link>
) : null,
},
]
}
];
}}
extraSections={item => [
{
id: 'headlamp.ingress-rules',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/job/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ export function JobsListRenderer(props: JobsListRendererProps) {
}

function sortByCompletions(job1: Job, job2: Job) {
const parallelismSorted = job1.spec.parallelism - job2.spec.parallelism;
const parallelismSorted = (job1.spec.parallelism ?? 0) - (job2.spec.parallelism ?? 0);
if (parallelismSorted === 0) {
return job1.spec.completions - job2.spec.completions;
return (job1.spec.completions ?? 0) - (job2.spec.completions ?? 0);
}
return parallelismSorted;
}
Expand Down
13 changes: 9 additions & 4 deletions frontend/src/components/networkpolicy/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export function NetworkPolicyDetails(props: {
function PodSelector(props: { networkPolicy: NetworkPolicy }) {
const { networkPolicy } = props;
return prepareMatchLabelsAndExpressions(
networkPolicy.jsonData.spec?.podSelector?.matchLabels,
networkPolicy.jsonData.spec?.podSelector?.matchExpressions
networkPolicy.spec?.podSelector?.matchLabels,
networkPolicy.spec?.podSelector?.matchExpressions
);
}

Expand Down Expand Up @@ -243,17 +243,22 @@ export function NetworkPolicyDetails(props: {
name: t('Pod Selector'),
value: <PodSelector networkPolicy={item} />,
},
{
name: t('Policy Types'),
value: item.policyTypes.join(', '),
hide: !item.policyTypes.length,
},
]
}
extraSections={item =>
item && [
{
id: 'networkpolicy-ingress',
section: <Ingress ingress={item.jsonData.spec.ingress} />,
section: <Ingress ingress={item.spec?.ingress ?? []} />,
},
{
id: 'networkpolicy-egress',
section: <Egress egress={item.jsonData.spec.egress} />,
section: <Egress egress={item.spec?.egress ?? []} />,
},
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,33 @@
</span>
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-1hrqr1q-MuiGrid-root"
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-9i4s51-MuiGrid-root"
>
Pod Selector
</dt>
<dd
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-9 MuiGrid-grid-md-10 css-ui3itl-MuiGrid-root"
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-9 MuiGrid-grid-md-10 css-1dbzfsd-MuiGrid-root"
>
<p
class="MuiTypography-root MuiTypography-body1 css-cwic1g-MuiTypography-root"
>
app: frontend
</p>
</dd>
<dt
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-3 MuiGrid-grid-md-2 css-1hrqr1q-MuiGrid-root"
>
Policy Types
</dt>
<dd
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-9 MuiGrid-grid-md-10 css-ui3itl-MuiGrid-root"
>
<span
class="MuiTypography-root MuiTypography-body1 css-e06lsu-MuiTypography-root"
>
Ingress, Egress
</span>
</dd>
</dl>
</div>
</div>
Expand Down
Loading
Loading