diff --git a/controllers/dashboard.js b/controllers/dashboard.js index e4dbd86..fb1ea7c 100644 --- a/controllers/dashboard.js +++ b/controllers/dashboard.js @@ -74,10 +74,11 @@ export const DashboardAction = async (req, res) => { res.send(modal); return; case 'details': - modal = readFileSync('./views/modals/details.html', 'utf8'); + modal = readFileSync('./views/modals/json.html', 'utf8'); let details = await containerInfo(name); modal = modal.replace(/AppName/g, details.name); modal = modal.replace(/AppImage/g, details.image); + res.send(modal); return; case 'updates': @@ -157,9 +158,14 @@ export const DashboardAction = async (req, res) => { } async function containerInfo (containerName) { + // get the container info let container = docker.getContainer(containerName); let info = await container.inspect(); - let image = info.Config.Image.split('/'); + let image = info.Config.Image; + // grab the service name from the end of the image name + let service = image.split('/').pop(); + // remove the tag from the service name if it exists + try { service = service.split(':')[0]; } catch {} let ports_list = []; let external = 0; let internal = 0; @@ -181,7 +187,7 @@ async function containerInfo (containerName) { let details = { name: containerName, image: image, - service: image[image.length - 1].split(':')[0], + service: service, state: info.State.Status, external_port: external, internal_port: internal, @@ -218,6 +224,8 @@ async function createCard (details) { } // if (name.startsWith('dweebui')) { disable = 'disabled=""'; } + let app_icon = details.service; + card = card.replace(/AppName/g, details.name); card = card.replace(/AppShortName/g, shortname); card = card.replace(/AppIcon/g, details.service); diff --git a/templates/json/default.json b/templates/json/default.json index 59c7fc9..d6ac6ba 100644 --- a/templates/json/default.json +++ b/templates/json/default.json @@ -5220,7 +5220,7 @@ "note": "", "description": "Elasticsearch is a distributed, RESTful search and analytics engine capable of solving a growing number of use cases. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents. Website. Docker Hub", "logo": "https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/png/elasticsearch.png", - "image": "elasticsearch", + "image": "elasticsearch:8.13.4", "categories": [ "Database" ], diff --git a/views/modals/json.html b/views/modals/json.html index 75908b9..510812d 100644 --- a/views/modals/json.html +++ b/views/modals/json.html @@ -30,7 +30,7 @@ - + diff --git a/views/partials/containerFull.html b/views/partials/containerFull.html index e93a8de..7a64b2c 100644 --- a/views/partials/containerFull.html +++ b/views/partials/containerFull.html @@ -26,7 +26,7 @@