2017-01-31 23:26:29 +00:00
|
|
|
function ImageViewModel(data) {
|
|
|
|
this.Id = data.Id;
|
|
|
|
this.Tag = data.Tag;
|
|
|
|
this.Repository = data.Repository;
|
|
|
|
this.Created = data.Created;
|
|
|
|
this.Checked = false;
|
|
|
|
this.RepoTags = data.RepoTags;
|
|
|
|
this.VirtualSize = data.VirtualSize;
|
2017-08-24 05:53:34 +00:00
|
|
|
this.ContainerCount = data.ContainerCount;
|
2018-05-06 07:15:57 +00:00
|
|
|
|
|
|
|
if (data.Portainer && data.Portainer.Agent && data.Portainer.Agent.NodeName) {
|
|
|
|
this.NodeName = data.Portainer.Agent.NodeName;
|
|
|
|
}
|
2017-01-31 23:26:29 +00:00
|
|
|
}
|
2018-02-28 06:19:06 +00:00
|
|
|
|
|
|
|
function ImageBuildModel(data) {
|
|
|
|
this.hasError = false;
|
|
|
|
var buildLogs = [];
|
|
|
|
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
var line = data[i];
|
|
|
|
|
|
|
|
if (line.stream) {
|
|
|
|
line = line.stream.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
|
|
|
|
buildLogs.push(line);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (line.errorDetail) {
|
|
|
|
buildLogs.push(line.errorDetail.message);
|
|
|
|
this.hasError = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.buildLogs = buildLogs;
|
|
|
|
}
|