mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
refactor(app): introduce new project structure for the frontend (#1623)
This commit is contained in:
parent
e6422a6d75
commit
27dceadba1
354 changed files with 1518 additions and 1755 deletions
30
app/docker/helpers/volumeHelper.js
Normal file
30
app/docker/helpers/volumeHelper.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
angular.module('portainer.docker')
|
||||
.factory('VolumeHelper', [function VolumeHelperFactory() {
|
||||
'use strict';
|
||||
var helper = {};
|
||||
|
||||
helper.createDriverOptions = function(optionArray) {
|
||||
var options = {};
|
||||
optionArray.forEach(function (option) {
|
||||
options[option.name] = option.value;
|
||||
});
|
||||
return options;
|
||||
};
|
||||
|
||||
helper.isVolumeUsedByAService = function(volume, services) {
|
||||
for (var i = 0; i < services.length; i++) {
|
||||
var service = services[i];
|
||||
var mounts = service.Mounts;
|
||||
for (var j = 0; j < mounts.length; j++) {
|
||||
var mount = mounts[j];
|
||||
if (mount.Source === volume.Id) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
return helper;
|
||||
}]);
|
Loading…
Add table
Add a link
Reference in a new issue