mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 16:29:44 +02:00
Some checks failed
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
ci / build_images (map[arch:arm platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Has been cancelled
/ triage (push) Has been cancelled
Lint / Run linters (push) Has been cancelled
Test / test-client (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:linux]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
Test / test-server (map[arch:arm64 platform:linux]) (push) Has been cancelled
ci / build_manifests (push) Has been cancelled
106 lines
2.5 KiB
TypeScript
106 lines
2.5 KiB
TypeScript
import { Stack, StackStatus, StackType } from '@/react/common/stacks/types';
|
|
import { ResourceControlViewModel } from '@/react/portainer/access-control/models/ResourceControlViewModel';
|
|
import { EnvironmentId } from '@/react/portainer/environments/types';
|
|
import {
|
|
AutoUpdateResponse,
|
|
RepoConfigResponse,
|
|
} from '@/react/portainer/gitops/types';
|
|
|
|
import { IResource } from '../../components/datatables/createOwnershipColumn';
|
|
|
|
export class StackViewModel implements IResource {
|
|
Id: number;
|
|
|
|
Type: StackType;
|
|
|
|
Name: string;
|
|
|
|
EndpointId: EnvironmentId;
|
|
|
|
SwarmId: string;
|
|
|
|
Env: { name: string; value: string }[];
|
|
|
|
Option: { Prune: boolean; Force: boolean } | undefined;
|
|
|
|
IsComposeFormat: boolean;
|
|
|
|
ResourceControl?: ResourceControlViewModel;
|
|
|
|
Status: StackStatus;
|
|
|
|
CreationDate: number;
|
|
|
|
CreatedBy: string;
|
|
|
|
UpdateDate: number;
|
|
|
|
UpdatedBy: string;
|
|
|
|
Regular: boolean;
|
|
|
|
External: boolean;
|
|
|
|
Orphaned: boolean;
|
|
|
|
OrphanedRunning: boolean;
|
|
|
|
GitConfig: RepoConfigResponse | undefined;
|
|
|
|
FromAppTemplate: boolean;
|
|
|
|
AdditionalFiles: string[] | undefined;
|
|
|
|
AutoUpdate: AutoUpdateResponse | undefined;
|
|
|
|
Webhook: string | undefined;
|
|
|
|
StackFileVersion: string;
|
|
|
|
PreviousDeploymentInfo: unknown;
|
|
|
|
SupportRelativePath: boolean;
|
|
|
|
FilesystemPath: string;
|
|
|
|
constructor(stack: Stack, orphaned = false) {
|
|
this.Id = stack.Id;
|
|
this.Type = stack.Type;
|
|
this.Name = stack.Name;
|
|
this.EndpointId = stack.EndpointID;
|
|
this.SwarmId = stack.SwarmID;
|
|
this.Env = stack.Env ? stack.Env : [];
|
|
this.Option = stack.Option;
|
|
this.IsComposeFormat = stack.IsComposeFormat;
|
|
|
|
if (stack.ResourceControl && stack.ResourceControl.Id !== 0) {
|
|
this.ResourceControl = new ResourceControlViewModel(
|
|
stack.ResourceControl
|
|
);
|
|
}
|
|
|
|
this.Status = stack.Status;
|
|
|
|
this.CreationDate = stack.CreationDate;
|
|
this.CreatedBy = stack.CreatedBy;
|
|
|
|
this.UpdateDate = stack.UpdateDate;
|
|
this.UpdatedBy = stack.UpdatedBy;
|
|
|
|
this.GitConfig = stack.GitConfig;
|
|
this.FromAppTemplate = stack.FromAppTemplate;
|
|
this.AdditionalFiles = stack.AdditionalFiles;
|
|
this.AutoUpdate = stack.AutoUpdate;
|
|
this.Webhook = stack.Webhook;
|
|
this.StackFileVersion = stack.StackFileVersion;
|
|
this.PreviousDeploymentInfo = stack.PreviousDeploymentInfo;
|
|
|
|
this.Regular = !orphaned;
|
|
this.External = false;
|
|
this.Orphaned = orphaned;
|
|
this.OrphanedRunning = false;
|
|
|
|
this.SupportRelativePath = stack.SupportRelativePath;
|
|
this.FilesystemPath = stack.FilesystemPath;
|
|
}
|
|
}
|