Better messaging around build status.

This commit is contained in:
yackob03 2014-02-05 19:59:57 -05:00
parent fab699530c
commit c919b9321b

View file

@ -2474,55 +2474,52 @@ quayApp.directive('buildStatus', function () {
'build': '=build'
},
controller: function($scope, $element) {
$scope.getBuildProgress = function(buildInfo) {
switch (buildInfo.phase) {
case 'building':
return (buildInfo.status.current_command / buildInfo.status.total_commands) * 100;
break;
case 'pushing':
return buildInfo.status.push_completion * 100;
break;
case 'complete':
return 100;
break;
case 'initializing':
case 'starting':
case 'waiting':
return 0;
break;
}
$scope.getBuildProgress = function(buildInfo) {
switch (buildInfo.phase) {
case 'building':
return (buildInfo.status.current_command / buildInfo.status.total_commands) * 100;
break;
return -1;
};
case 'pushing':
return buildInfo.status.push_completion * 100;
break;
$scope.getBuildMessage = function(buildInfo) {
switch (buildInfo.phase) {
case 'initializing':
return 'Starting Dockerfile build';
break;
case 'complete':
return 100;
break;
case 'starting':
case 'waiting':
case 'building':
return 'Building image from Dockerfile';
break;
case 'initializing':
case 'starting':
case 'waiting':
return 0;
break;
}
return -1;
};
case 'pushing':
return 'Pushing image built from Dockerfile';
break;
$scope.getBuildMessage = function(buildInfo) {
switch (buildInfo.phase) {
case 'starting':
case 'initializing':
return 'Starting Dockerfile build';
case 'complete':
return 'Dockerfile build completed and pushed';
break;
case 'error':
return 'Dockerfile build failed.';
break;
}
};
case 'waiting':
return 'Waiting for available build worker.';
case 'building':
return 'Building image from Dockerfile';
case 'pushing':
return 'Pushing image built from Dockerfile';
case 'complete':
return 'Dockerfile build completed and pushed';
case 'error':
return 'Dockerfile build failed.';
}
};
}
};
return directiveDefinitionObject;