mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
refactor(app): migrate app summary section [EE-6239] (#10910)
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run
This commit is contained in:
parent
7a4314032a
commit
abf517de28
61 changed files with 1461 additions and 661 deletions
|
@ -1,7 +1,5 @@
|
|||
import { SchemaOf, array, object, boolean, string, mixed, number } from 'yup';
|
||||
|
||||
import { KubernetesApplicationPublishingTypes } from '@/kubernetes/models/application/models';
|
||||
|
||||
import { ServiceFormValues, ServicePort } from './types';
|
||||
import { prependWithSlash } from './utils';
|
||||
|
||||
|
@ -46,11 +44,7 @@ export function kubeServicesValidation(
|
|||
Namespace: string(),
|
||||
Name: string(),
|
||||
StackName: string(),
|
||||
Type: mixed().oneOf([
|
||||
KubernetesApplicationPublishingTypes.CLUSTER_IP,
|
||||
KubernetesApplicationPublishingTypes.NODE_PORT,
|
||||
KubernetesApplicationPublishingTypes.LOAD_BALANCER,
|
||||
]),
|
||||
Type: mixed().oneOf(['ClusterIP', 'NodePort', 'LoadBalancer']),
|
||||
ClusterIP: string(),
|
||||
ApplicationName: string(),
|
||||
ApplicationOwner: string(),
|
||||
|
@ -61,6 +55,7 @@ export function kubeServicesValidation(
|
|||
object({
|
||||
port: number()
|
||||
.required('Service port number is required.')
|
||||
.typeError('Service port number is required.')
|
||||
.min(1, 'Service port number must be inside the range 1-65535.')
|
||||
.max(65535, 'Service port number must be inside the range 1-65535.')
|
||||
.test(
|
||||
|
@ -93,6 +88,7 @@ export function kubeServicesValidation(
|
|||
),
|
||||
targetPort: number()
|
||||
.required('Container port number is required.')
|
||||
.typeError('Container port number is required.')
|
||||
.min(1, 'Container port number must be inside the range 1-65535.')
|
||||
.max(
|
||||
65535,
|
||||
|
@ -116,8 +112,7 @@ export function kubeServicesValidation(
|
|||
);
|
||||
if (
|
||||
matchingService === undefined ||
|
||||
matchingService.Type !==
|
||||
KubernetesApplicationPublishingTypes.NODE_PORT // ignore validation unless the service is of type nodeport
|
||||
matchingService.Type !== 'NodePort'
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
@ -143,8 +138,7 @@ export function kubeServicesValidation(
|
|||
|
||||
if (
|
||||
matchingService === undefined ||
|
||||
matchingService.Type !==
|
||||
KubernetesApplicationPublishingTypes.NODE_PORT // ignore validation unless the service is of type nodeport
|
||||
matchingService.Type !== 'NodePort'
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
@ -163,8 +157,7 @@ export function kubeServicesValidation(
|
|||
const formNodePortsWithoutCurrentService = formServices
|
||||
.filter(
|
||||
(formService) =>
|
||||
formService.Type ===
|
||||
KubernetesApplicationPublishingTypes.NODE_PORT &&
|
||||
formService.Type === 'NodePort' &&
|
||||
formService.Name !== matchingService.Name
|
||||
)
|
||||
.flatMap((formService) => formService.Ports)
|
||||
|
@ -187,11 +180,7 @@ export function kubeServicesValidation(
|
|||
context.parent as ServicePort,
|
||||
formServices
|
||||
);
|
||||
if (
|
||||
!matchingService ||
|
||||
matchingService.Type !==
|
||||
KubernetesApplicationPublishingTypes.NODE_PORT
|
||||
) {
|
||||
if (!matchingService || matchingService.Type !== 'NodePort') {
|
||||
return true;
|
||||
}
|
||||
return nodePort >= 30000;
|
||||
|
@ -209,11 +198,7 @@ export function kubeServicesValidation(
|
|||
context.parent as ServicePort,
|
||||
formServices
|
||||
);
|
||||
if (
|
||||
!matchingService ||
|
||||
matchingService.Type !==
|
||||
KubernetesApplicationPublishingTypes.NODE_PORT
|
||||
) {
|
||||
if (!matchingService || matchingService.Type !== 'NodePort') {
|
||||
return true;
|
||||
}
|
||||
return nodePort <= 32767;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue