1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00

feat(image-build): add the ability to build images (#1672)

This commit is contained in:
Anthony Lapenna 2018-02-28 07:19:06 +01:00 committed by GitHub
parent e065bd4a47
commit 81de2a5afb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 607 additions and 15 deletions

View file

@ -8,3 +8,24 @@ function ImageViewModel(data) {
this.VirtualSize = data.VirtualSize;
this.ContainerCount = data.ContainerCount;
}
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;
}