2017-03-12 16:24:15 +00:00
|
|
|
function VolumeViewModel(data) {
|
2017-05-23 18:56:10 +00:00
|
|
|
this.Id = data.Name;
|
2017-03-12 16:24:15 +00:00
|
|
|
this.Driver = data.Driver;
|
2017-05-23 18:56:10 +00:00
|
|
|
this.Options = data.Options;
|
|
|
|
this.Labels = data.Labels;
|
2017-10-15 17:24:40 +00:00
|
|
|
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'];
|
|
|
|
}
|
2017-03-12 16:24:15 +00:00
|
|
|
this.Mountpoint = data.Mountpoint;
|
2017-05-23 18:56:10 +00:00
|
|
|
|
2017-03-12 16:24:15 +00:00
|
|
|
if (data.Portainer) {
|
|
|
|
if (data.Portainer.ResourceControl) {
|
2017-05-23 18:56:10 +00:00
|
|
|
this.ResourceControl = new ResourceControlViewModel(data.Portainer.ResourceControl);
|
2017-03-12 16:24:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|