mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
* chore(project): install prettier and lint-staged * chore(project): apply prettier to html too * chore(project): git ignore eslintcache * chore(project): add a comment about format script * chore(prettier): update printWidth * chore(prettier): remove useTabs option * chore(prettier): add HTML validation * refactor(prettier): fix closing tags * feat(prettier): define angular parser for html templates * style(prettier): run prettier on codebase Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
32 lines
1 KiB
JavaScript
32 lines
1 KiB
JavaScript
import { ResourceControlViewModel } from 'Portainer/models/resourceControl/resourceControl';
|
|
|
|
export function NetworkViewModel(data) {
|
|
this.Id = data.Id;
|
|
this.Name = data.Name;
|
|
this.Scope = data.Scope;
|
|
this.Driver = data.Driver;
|
|
this.Attachable = data.Attachable;
|
|
this.Internal = data.Internal;
|
|
this.IPAM = data.IPAM;
|
|
this.Containers = data.Containers;
|
|
this.Options = data.Options;
|
|
|
|
this.Labels = data.Labels;
|
|
if (this.Labels && this.Labels['com.docker.compose.project']) {
|
|
this.StackName = this.Labels['com.docker.compose.project'];
|
|
} else if (this.Labels && this.Labels['com.docker.stack.namespace']) {
|
|
this.StackName = this.Labels['com.docker.stack.namespace'];
|
|
}
|
|
|
|
if (data.Portainer) {
|
|
if (data.Portainer.ResourceControl) {
|
|
this.ResourceControl = new ResourceControlViewModel(data.Portainer.ResourceControl);
|
|
}
|
|
if (data.Portainer.Agent && data.Portainer.Agent.NodeName) {
|
|
this.NodeName = data.Portainer.Agent.NodeName;
|
|
}
|
|
}
|
|
|
|
this.ConfigFrom = data.ConfigFrom;
|
|
this.ConfigOnly = data.ConfigOnly;
|
|
}
|