From c0c689c2af85d31d73a768a48798d882332c65cf Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Wed, 27 Sep 2023 07:57:43 +0300 Subject: [PATCH] fix(docker/services): show cred spec configs [EE-5276] (#10082) --- app/docker/helpers/configHelper.js | 21 +++++++------ .../views/services/edit/includes/configs.html | 16 +++++----- .../views/services/edit/serviceController.js | 31 +++++++++++++++++-- 3 files changed, 48 insertions(+), 20 deletions(-) diff --git a/app/docker/helpers/configHelper.js b/app/docker/helpers/configHelper.js index 00c1dbcde..4822096ce 100644 --- a/app/docker/helpers/configHelper.js +++ b/app/docker/helpers/configHelper.js @@ -7,10 +7,8 @@ angular.module('portainer.docker').factory('ConfigHelper', [ return { Id: config.ConfigID, Name: config.ConfigName, - FileName: config.File.Name, - Uid: config.File.UID, - Gid: config.File.GID, - Mode: config.File.Mode, + ...(config.File ? { FileName: config.File.Name, Uid: config.File.UID, Gid: config.File.GID, Mode: config.File.Mode } : {}), + credSpec: !!config.Runtime, }; } return {}; @@ -20,12 +18,15 @@ angular.module('portainer.docker').factory('ConfigHelper', [ return { ConfigID: config.Id, ConfigName: config.Name, - File: { - Name: config.FileName || config.Name, - UID: config.Uid || '0', - GID: config.Gid || '0', - Mode: config.Mode || 292, - }, + 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 {}; diff --git a/app/docker/views/services/edit/includes/configs.html b/app/docker/views/services/edit/includes/configs.html index dd152d93e..b246c9937 100644 --- a/app/docker/views/services/edit/includes/configs.html +++ b/app/docker/views/services/edit/includes/configs.html @@ -4,7 +4,7 @@
Add a config: - add config @@ -22,10 +22,10 @@ - {{ config.Name }} + {{ config.Name }} + + - {{ config.Uid }} - {{ config.Gid }} - {{ config.Mode }} + {{ config.Uid }} + {{ config.Gid }} + {{ config.Mode }} + Credential Spec