mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +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,11 +1,11 @@
|
|||
import { PorImageRegistryModel } from '@/docker/models/porImageRegistry';
|
||||
import { KubernetesApplicationDataAccessPolicies, KubernetesApplicationDeploymentTypes } from './models';
|
||||
import { KubernetesApplicationTypes, KubernetesApplicationDeploymentTypes, KubernetesApplicationDataAccessPolicies } from 'Kubernetes/models/application/models/appConstants';
|
||||
|
||||
/**
|
||||
* KubernetesApplicationFormValues Model
|
||||
*/
|
||||
export function KubernetesApplicationFormValues() {
|
||||
this.ApplicationType = undefined; // will only exist for formValues generated from Application (app edit situation;
|
||||
this.ApplicationType = KubernetesApplicationTypes.Deployment; // will only exist for formValues generated from Application (app edit situation;
|
||||
this.ResourcePool = {};
|
||||
this.Name = '';
|
||||
this.StackName = '';
|
||||
|
@ -14,13 +14,13 @@ export function KubernetesApplicationFormValues() {
|
|||
this.Note = '';
|
||||
this.MemoryLimit = 0;
|
||||
this.CpuLimit = 0;
|
||||
this.DeploymentType = KubernetesApplicationDeploymentTypes.REPLICATED;
|
||||
this.DeploymentType = KubernetesApplicationDeploymentTypes.Replicated;
|
||||
this.ReplicaCount = 1;
|
||||
this.AutoScaler = {};
|
||||
this.Containers = [];
|
||||
this.Services = [];
|
||||
this.EnvironmentVariables = []; // KubernetesApplicationEnvironmentVariableFormValue lis;
|
||||
this.DataAccessPolicy = KubernetesApplicationDataAccessPolicies.ISOLATED;
|
||||
this.DataAccessPolicy = KubernetesApplicationDataAccessPolicies.Isolated;
|
||||
this.PersistedFolders = []; // KubernetesApplicationPersistedFolderFormValue lis;
|
||||
this.ConfigMaps = [];
|
||||
this.Secrets = [];
|
||||
|
@ -130,11 +130,11 @@ export function KubernetesApplicationPlacementFormValue() {
|
|||
* KubernetesApplicationAutoScalerFormValue Model
|
||||
*/
|
||||
const _KubernetesApplicationAutoScalerFormValue = Object.freeze({
|
||||
MinReplicas: 0,
|
||||
MaxReplicas: 0,
|
||||
TargetCPUUtilization: 50,
|
||||
ApiVersion: '',
|
||||
IsUsed: false,
|
||||
minReplicas: 0,
|
||||
maxReplicas: 0,
|
||||
targetCpuUtilizationPercentage: 50,
|
||||
apiVersion: '',
|
||||
isUsed: false,
|
||||
});
|
||||
|
||||
export class KubernetesApplicationAutoScalerFormValue {
|
||||
|
|
41
app/kubernetes/models/application/models/appConstants.ts
Normal file
41
app/kubernetes/models/application/models/appConstants.ts
Normal file
|
@ -0,0 +1,41 @@
|
|||
import {
|
||||
AppType,
|
||||
AppDataAccessPolicy,
|
||||
DeploymentType,
|
||||
} from '@/react/kubernetes/applications/types';
|
||||
import { ServiceType } from '@/react/kubernetes/services/types';
|
||||
|
||||
// The following constants are used by angular views and can be removed once they are no longer referenced
|
||||
export const KubernetesApplicationTypes: Record<AppType, AppType> = {
|
||||
Deployment: 'Deployment',
|
||||
StatefulSet: 'StatefulSet',
|
||||
DaemonSet: 'DaemonSet',
|
||||
Pod: 'Pod',
|
||||
Helm: 'Helm',
|
||||
} as const;
|
||||
|
||||
export const KubernetesApplicationDeploymentTypes: Record<
|
||||
DeploymentType,
|
||||
DeploymentType
|
||||
> = {
|
||||
Global: 'Global',
|
||||
Replicated: 'Replicated',
|
||||
} as const;
|
||||
|
||||
export const KubernetesApplicationDataAccessPolicies: Record<
|
||||
AppDataAccessPolicy,
|
||||
AppDataAccessPolicy
|
||||
> = {
|
||||
Isolated: 'Isolated',
|
||||
Shared: 'Shared',
|
||||
} as const;
|
||||
|
||||
export const KubernetesApplicationServiceTypes: Record<
|
||||
ServiceType,
|
||||
ServiceType
|
||||
> = {
|
||||
ClusterIP: 'ClusterIP',
|
||||
NodePort: 'NodePort',
|
||||
LoadBalancer: 'LoadBalancer',
|
||||
ExternalName: 'ExternalName',
|
||||
} as const;
|
|
@ -1,35 +1,3 @@
|
|||
export const KubernetesApplicationDeploymentTypes = Object.freeze({
|
||||
REPLICATED: 1,
|
||||
GLOBAL: 2,
|
||||
});
|
||||
|
||||
export const KubernetesApplicationDataAccessPolicies = Object.freeze({
|
||||
SHARED: 1,
|
||||
ISOLATED: 2,
|
||||
});
|
||||
|
||||
export const KubernetesApplicationTypes = Object.freeze({
|
||||
DEPLOYMENT: 1,
|
||||
DAEMONSET: 2,
|
||||
STATEFULSET: 3,
|
||||
POD: 4,
|
||||
HELM: 5,
|
||||
});
|
||||
|
||||
export const KubernetesApplicationTypeStrings = Object.freeze({
|
||||
HELM: 'Helm',
|
||||
DEPLOYMENT: 'Deployment',
|
||||
DAEMONSET: 'DaemonSet',
|
||||
STATEFULSET: 'StatefulSet',
|
||||
POD: 'Pod',
|
||||
});
|
||||
|
||||
export const KubernetesApplicationPublishingTypes = Object.freeze({
|
||||
CLUSTER_IP: 1,
|
||||
NODE_PORT: 2,
|
||||
LOAD_BALANCER: 3,
|
||||
});
|
||||
|
||||
export const KubernetesApplicationQuotaDefaults = {
|
||||
CpuLimit: 0.1,
|
||||
MemoryLimit: 64, // MB
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue