diff --git a/controllers/apps/docker/useDocker.js b/controllers/apps/docker/useDocker.js index 88ecb3e..ce59dd7 100644 --- a/controllers/apps/docker/useDocker.js +++ b/controllers/apps/docker/useDocker.js @@ -92,15 +92,28 @@ const useDocker = async (apps) => { const names = labels['flame.name'].split(';'); const urls = labels['flame.url'].split(';'); let icons = ''; + let descriptions = ''; + let visibility = ''; if ('flame.icon' in labels) { icons = labels['flame.icon'].split(';'); } + if ('flame.description' in labels) { + descriptions = labels['flame.description'].split(';'); + } + + if ('flame.visible' in labels) { + visibility = labels['flame.visible'].split(';'); + } + dockerApps.push({ name: names[i] || names[0], url: urls[i] || urls[0], icon: icons[i] || 'docker', + // Add description and visbility + description: descriptions[i] || '', + isPublic: (visibility[i] && /^true$/.test(visibility[i]) ? visibility[i] : visibility[0]) || null, }); } } @@ -114,8 +127,9 @@ const useDocker = async (apps) => { for (const item of dockerApps) { // If app already exists, update it - if (apps.some((app) => app.name === item.name)) { - const app = apps.find((a) => a.name === item.name); + // Find by name or url + if (apps.some((app) => app.name === item.name || app.url === item.url)) { + const app = apps.find((a) => a.name === item.name || app.url === item.url); if ( item.icon === 'custom' || @@ -125,6 +139,9 @@ const useDocker = async (apps) => { await app.update({ name: item.name, url: item.url, + // Add description and visbility + description: item.description, + isPublic: item.isPublic, isPinned: true, }); } else { diff --git a/controllers/apps/docker/useKubernetes.js b/controllers/apps/docker/useKubernetes.js index d9961cd..31dcfec 100644 --- a/controllers/apps/docker/useKubernetes.js +++ b/controllers/apps/docker/useKubernetes.js @@ -43,6 +43,9 @@ const useKubernetes = async (apps) => { name: annotations['flame.pawelmalak/name'], url: annotations['flame.pawelmalak/url'], icon: annotations['flame.pawelmalak/icon'] || 'kubernetes', + // Add description and visibility + description: annotations['flame.pawelmalak/description'] || '', + isPublic: (annotations['flame.pawelmalak/visible'] && /^true$/.test(annotations['flame.pawelmalak/visible']) ? 1 : 0), }); } } @@ -54,8 +57,9 @@ const useKubernetes = async (apps) => { } for (const item of kubernetesApps) { - if (apps.some((app) => app.name === item.name)) { - const app = apps.find((a) => a.name === item.name); + // Find by name or url + if (apps.some((app) => app.name === item.name || app.url === item.url)) { + const app = apps.find((a) => a.name === item.name || app.url === item.url); await app.update({ ...item, isPinned: true }); } else { await App.create({