mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
* feat(docker/stacks): add creation and update dates * feat(docker/stacks): put ownership column as the last column * feat(docker/stacks): fix the no stacks message
26 lines
809 B
JavaScript
26 lines
809 B
JavaScript
import { ResourceControlViewModel } from 'Portainer/models/resourceControl/resourceControl';
|
|
|
|
export function StackViewModel(data) {
|
|
this.Id = data.Id;
|
|
this.Type = data.Type;
|
|
this.Name = data.Name;
|
|
this.Checked = false;
|
|
this.EndpointId = data.EndpointId;
|
|
this.SwarmId = data.SwarmId;
|
|
this.Env = data.Env ? data.Env : [];
|
|
if (data.ResourceControl && data.ResourceControl.Id !== 0) {
|
|
this.ResourceControl = new ResourceControlViewModel(data.ResourceControl);
|
|
}
|
|
this.External = false;
|
|
this.Status = data.Status;
|
|
this.CreationDate = data.CreationDate;
|
|
this.UpdateDate = data.UpdateDate;
|
|
}
|
|
|
|
export function ExternalStackViewModel(name, type, creationDate) {
|
|
this.Name = name;
|
|
this.Type = type;
|
|
this.External = true;
|
|
this.Checked = false;
|
|
this.CreationDate = creationDate;
|
|
}
|