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:
parent
c472fe9c18
commit
2a7a96f498
9 changed files with 48 additions and 36 deletions
|
@ -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',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
|
|
@ -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 || '';
|
||||
}
|
||||
|
|
|
@ -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[];
|
||||
}[];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue