App icons are now determined by service label.
This commit is contained in:
parent
31f5230f50
commit
87fe9d4c65
|
@ -16,6 +16,8 @@
|
|||
* Removed 'SECRET' environment variable.
|
||||
* New - Custom container links.
|
||||
* Fixed issue updating view permission.
|
||||
* Fixed issue viewing container logs.
|
||||
* App icons are now determined by service label instead of image name.
|
||||
|
||||
## v0.60 (June 9th 2024) - Permissions system and import templates
|
||||
* Converted JS template literals into HTML.
|
||||
|
|
|
@ -268,6 +268,8 @@ async function createCard (details) {
|
|||
let state = details.state;
|
||||
let card = readFileSync('./views/partials/containerFull.html', 'utf8');
|
||||
|
||||
let app_icon = (details.labels['com.docker.compose.service']);
|
||||
|
||||
let links = await ServerSettings.findOne({ where: {key: 'links'}});
|
||||
if (!links) { links = { value: 'localhost' }; }
|
||||
|
||||
|
@ -294,7 +296,7 @@ async function createCard (details) {
|
|||
|
||||
card = card.replace(/AppName/g, details.name);
|
||||
card = card.replace(/AppShortName/g, shortname);
|
||||
card = card.replace(/AppIcon/g, details.service);
|
||||
card = card.replace(/AppIcon/g, app_icon);
|
||||
card = card.replace(/AppState/g, state);
|
||||
card = card.replace(/StateColor/g, state_color);
|
||||
card = card.replace(/AppLink/g, links.value);
|
||||
|
@ -406,7 +408,7 @@ export const Stats = async (req, res) => {
|
|||
break;
|
||||
}
|
||||
let info = `<div class="font-weight-medium"> <label class="cpu-text mb-1">${name} ${value}%</label></div>
|
||||
<div class="cpu-bar meter animate ${color}"> <span style="width:${value}%"><span></span></span> </div>`;
|
||||
<div class="cpu-bar meter animate ${color}"><span style="width:${value}%"><span></span></span></div>`;
|
||||
res.send(info);
|
||||
}
|
||||
|
||||
|
@ -421,7 +423,7 @@ export async function addAlert (session, type, message) {
|
|||
${message}
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn-close" data-hx-post="/dashboard/alert" data-hx-trigger="click" data-hx-target="#alert" data-hx-swap="outerHTML" style="padding-top: 0.5rem;" ></button>
|
||||
<button class="btn-close" data-hx-post="/dashboard/alert" data-hx-trigger="click" data-hx-target="#alert" data-hx-swap="outerHTML" style="padding-top: 0.5rem;"></button>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
|
@ -467,11 +469,7 @@ export const Chart = async (req, res) => {
|
|||
stats[name].ramArray = stats[name].ramArray.slice(-15);
|
||||
let chart = `
|
||||
<script>
|
||||
${name}chart.updateSeries([{
|
||||
data: [${stats[name].cpuArray}]
|
||||
}, {
|
||||
data: [${stats[name].ramArray}]
|
||||
}])
|
||||
${name}chart.updateSeries([{data: [${stats[name].cpuArray}]}, {data: [${stats[name].ramArray}]}])
|
||||
</script>`
|
||||
res.send(chart);
|
||||
}
|
|
@ -26,8 +26,13 @@ router.post("/uninstall", adminOnly, Uninstall);
|
|||
|
||||
// Search (testing)
|
||||
router.post("/search", function (req, res) {
|
||||
console.log(req.body);
|
||||
console.log(req.header('hx-current-url'));
|
||||
let path = req.header('hx-current-url');
|
||||
// http://localhost:8000/dashboard
|
||||
let search_from = path.split("/").pop();
|
||||
// dashboard
|
||||
if (search_from == "dashboard") {
|
||||
DashboardAction(req, res);
|
||||
}
|
||||
});
|
||||
|
||||
// Routes
|
||||
|
|
Loading…
Reference in New Issue