mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 23:09:41 +02:00
feat(templates): add support for the command field (#585)
This commit is contained in:
parent
9ebe2d96dd
commit
d9624053d2
5 changed files with 26 additions and 18 deletions
|
@ -1,20 +1,26 @@
|
|||
angular.module('portainer.helpers')
|
||||
.factory('ContainerHelper', [function ContainerHelperFactory() {
|
||||
'use strict';
|
||||
return {
|
||||
hideContainers: function(containers, containersToHideLabels) {
|
||||
return containers.filter(function (container) {
|
||||
var filterContainer = false;
|
||||
containersToHideLabels.forEach(function(label, index) {
|
||||
if (_.has(container.Labels, label.name) &&
|
||||
container.Labels[label.name] === label.value) {
|
||||
filterContainer = true;
|
||||
}
|
||||
});
|
||||
if (!filterContainer) {
|
||||
return container;
|
||||
var helper = {};
|
||||
|
||||
helper.commandStringToArray = function(command) {
|
||||
return splitargs(command);
|
||||
};
|
||||
|
||||
helper.hideContainers = function(containers, containersToHideLabels) {
|
||||
return containers.filter(function (container) {
|
||||
var filterContainer = false;
|
||||
containersToHideLabels.forEach(function(label, index) {
|
||||
if (_.has(container.Labels, label.name) &&
|
||||
container.Labels[label.name] === label.value) {
|
||||
filterContainer = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!filterContainer) {
|
||||
return container;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return helper;
|
||||
}]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue