2020-04-10 21:54:53 +00:00
|
|
|
angular.module('portainer.docker').factory('TaskHelper', [
|
|
|
|
function TaskHelperFactory() {
|
|
|
|
'use strict';
|
2018-05-06 07:15:57 +00:00
|
|
|
|
2020-04-10 21:54:53 +00:00
|
|
|
var helper = {};
|
2018-05-06 07:15:57 +00:00
|
|
|
|
2020-04-10 21:54:53 +00:00
|
|
|
helper.associateContainerToTask = function (task, containers) {
|
|
|
|
for (var i = 0; i < containers.length; i++) {
|
|
|
|
var container = containers[i];
|
|
|
|
if (task.ContainerId === container.Id) {
|
|
|
|
task.Container = container;
|
|
|
|
break;
|
|
|
|
}
|
2018-05-06 07:15:57 +00:00
|
|
|
}
|
2020-04-10 21:54:53 +00:00
|
|
|
};
|
2018-05-06 07:15:57 +00:00
|
|
|
|
2020-04-10 21:54:53 +00:00
|
|
|
return helper;
|
|
|
|
},
|
|
|
|
]);
|