You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/docker/helpers/configHelper.js

37 lines
1.0 KiB

angular.module('portainer.docker').factory('ConfigHelper', [
function ConfigHelperFactory() {
'use strict';
return {
flattenConfig: function (config) {
if (config) {
return {
Id: config.ConfigID,
Name: config.ConfigName,
...(config.File ? { FileName: config.File.Name, Uid: config.File.UID, Gid: config.File.GID, Mode: config.File.Mode } : {}),
credSpec: !!config.Runtime,
};
}
return {};
},
configConfig: function (config) {
if (config) {
return {
ConfigID: config.Id,
ConfigName: config.Name,
File: config.credSpec
? null
: {
Name: config.FileName || config.Name,
UID: config.Uid || '0',
GID: config.Gid || '0',
Mode: config.Mode || 292,
},
Runtime: config.credSpec ? {} : null,
};
}
return {};
},
};
},
]);