fixed details modal and dashboard icons
This commit is contained in:
parent
3080516d93
commit
0dae02c382
4 changed files with 14 additions and 6 deletions
|
@ -74,10 +74,11 @@ export const DashboardAction = async (req, res) => {
|
||||||
res.send(modal);
|
res.send(modal);
|
||||||
return;
|
return;
|
||||||
case 'details':
|
case 'details':
|
||||||
modal = readFileSync('./views/modals/details.html', 'utf8');
|
modal = readFileSync('./views/modals/json.html', 'utf8');
|
||||||
let details = await containerInfo(name);
|
let details = await containerInfo(name);
|
||||||
modal = modal.replace(/AppName/g, details.name);
|
modal = modal.replace(/AppName/g, details.name);
|
||||||
modal = modal.replace(/AppImage/g, details.image);
|
modal = modal.replace(/AppImage/g, details.image);
|
||||||
|
|
||||||
res.send(modal);
|
res.send(modal);
|
||||||
return;
|
return;
|
||||||
case 'updates':
|
case 'updates':
|
||||||
|
@ -157,9 +158,14 @@ export const DashboardAction = async (req, res) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function containerInfo (containerName) {
|
async function containerInfo (containerName) {
|
||||||
|
// get the container info
|
||||||
let container = docker.getContainer(containerName);
|
let container = docker.getContainer(containerName);
|
||||||
let info = await container.inspect();
|
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 ports_list = [];
|
||||||
let external = 0;
|
let external = 0;
|
||||||
let internal = 0;
|
let internal = 0;
|
||||||
|
@ -181,7 +187,7 @@ async function containerInfo (containerName) {
|
||||||
let details = {
|
let details = {
|
||||||
name: containerName,
|
name: containerName,
|
||||||
image: image,
|
image: image,
|
||||||
service: image[image.length - 1].split(':')[0],
|
service: service,
|
||||||
state: info.State.Status,
|
state: info.State.Status,
|
||||||
external_port: external,
|
external_port: external,
|
||||||
internal_port: internal,
|
internal_port: internal,
|
||||||
|
@ -218,6 +224,8 @@ async function createCard (details) {
|
||||||
}
|
}
|
||||||
// if (name.startsWith('dweebui')) { disable = 'disabled=""'; }
|
// if (name.startsWith('dweebui')) { disable = 'disabled=""'; }
|
||||||
|
|
||||||
|
let app_icon = details.service;
|
||||||
|
|
||||||
card = card.replace(/AppName/g, details.name);
|
card = card.replace(/AppName/g, details.name);
|
||||||
card = card.replace(/AppShortName/g, shortname);
|
card = card.replace(/AppShortName/g, shortname);
|
||||||
card = card.replace(/AppIcon/g, details.service);
|
card = card.replace(/AppIcon/g, details.service);
|
||||||
|
|
|
@ -5220,7 +5220,7 @@
|
||||||
"note": "",
|
"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. <a href='https://www.elastic.co/' target='_blank'>Website</a>. <a href='https://hub.docker.com/_/elasticsearch' target='_blank'>Docker Hub</a>",
|
"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. <a href='https://www.elastic.co/' target='_blank'>Website</a>. <a href='https://hub.docker.com/_/elasticsearch' target='_blank'>Docker Hub</a>",
|
||||||
"logo": "https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/png/elasticsearch.png",
|
"logo": "https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/png/elasticsearch.png",
|
||||||
"image": "elasticsearch",
|
"image": "elasticsearch:8.13.4",
|
||||||
"categories": [
|
"categories": [
|
||||||
"Database"
|
"Database"
|
||||||
],
|
],
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
<option value="RestartPolicy" selected hidden>RestartPolicy</option>
|
<option value="RestartPolicy" selected hidden>RestartPolicy</option>
|
||||||
<option value="unless-stopped">unless-stopped</option>
|
<option value="unless-stopped">unless-stopped</option>
|
||||||
<option value="on-failure">on-failure</option>
|
<option value="on-failure">on-failure</option>
|
||||||
<option value="never">never</option>
|
<option value="no">never</option>
|
||||||
<option value="always">always</option>
|
<option value="always">always</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><circle cx="12" cy="12" r="1"></circle><circle cx="12" cy="19" r="1"></circle><circle cx="12" cy="5" r="1"></circle></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" class="" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><circle cx="12" cy="12" r="1"></circle><circle cx="12" cy="19" r="1"></circle><circle cx="12" cy="5" r="1"></circle></svg>
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-menu dropdown-menu-end">
|
<div class="dropdown-menu dropdown-menu-end">
|
||||||
<button class="dropdown-item text-secondary" name="AppName" id="details" data-hx-get="/dashboard/details" hx-swap="innerHTML" data-hx-trigger="mousedown" data-hx-target="#modals-here" data-bs-toggle="modal" data-bs-target="#modals-here">Details</button>
|
<button class="dropdown-item text-secondary" name="AppName" id="details" data-hx-post="/dashboard/details" hx-swap="innerHTML" data-hx-trigger="mousedown" data-hx-target="#modals-here" data-bs-toggle="modal" data-bs-target="#modals-here">Details</button>
|
||||||
<button class="dropdown-item text-secondary" name="AppName" id="logs" data-hx-post="/dashboard/logs" hx-swap="innerHTML" hx-trigger="mousedown" data-hx-target="#logView" data-bs-toggle="modal" data-bs-target="#log_view">Logs</button>
|
<button class="dropdown-item text-secondary" name="AppName" id="logs" data-hx-post="/dashboard/logs" hx-swap="innerHTML" hx-trigger="mousedown" data-hx-target="#logView" data-bs-toggle="modal" data-bs-target="#log_view">Logs</button>
|
||||||
<button class="dropdown-item text-secondary" name="AppName" id="edit">Edit</button>
|
<button class="dropdown-item text-secondary" name="AppName" id="edit">Edit</button>
|
||||||
<button class="dropdown-item text-primary" name="AppName" id="update" disabled="">Update</button>
|
<button class="dropdown-item text-primary" name="AppName" id="update" disabled="">Update</button>
|
||||||
|
|
Loading…
Add table
Reference in a new issue