1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

fix(microk8s): PO ui fixes [EE-5900] (#10031)

Co-authored-by: testa113 <testa113>
This commit is contained in:
Ali 2023-08-14 12:34:58 +12:00 committed by GitHub
parent c472fe9c18
commit 2a7a96f498
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 48 additions and 36 deletions

View file

@ -133,7 +133,11 @@ export function CreateIngressView() {
...group,
options: [
...group.options,
{ label: service.Name, value: service.Name },
{
label: service.Name,
selectedLabel: `${service.Name} (${service.Type})`,
value: service.Name,
},
],
};
}
@ -540,14 +544,14 @@ export function CreateIngressView() {
return (
<>
<PageHeader
title={isEdit ? 'Edit ingress' : 'Add ingress'}
title={isEdit ? 'Edit ingress' : 'Create ingress'}
breadcrumbs={[
{
link: 'kubernetes.ingresses',
label: 'Ingresses',
},
{
label: isEdit ? 'Edit ingress' : 'Add ingress',
label: isEdit ? 'Edit ingress' : 'Create ingress',
},
]}
/>

View file

@ -489,7 +489,10 @@ export function IngressForm({
path.ServiceName
? {
value: path.ServiceName,
label: path.ServiceName,
label: getServiceLabel(
serviceOptions,
path.ServiceName
),
}
: null
}
@ -728,3 +731,9 @@ export function IngressForm({
</Widget>
);
}
function getServiceLabel(options: GroupedServiceOptions, value: string) {
const allOptions = options.flatMap((group) => group.options);
const option = allOptions.find((o) => o.value === value);
return option?.selectedLabel || '';
}

View file

@ -32,7 +32,11 @@ export interface ServicePorts {
[serviceName: string]: Option<string>[];
}
interface ServiceOption extends Option<string> {
selectedLabel: string;
}
export type GroupedServiceOptions = {
label: string;
options: Option<string>[];
options: ServiceOption[];
}[];