custom_components/bahmcloud_store/panel/panel.js aktualisiert

This commit is contained in:
2026-01-15 07:07:45 +00:00
parent 41fc0da76c
commit 58e62b864e

View File

@@ -112,12 +112,6 @@ class BahmcloudStorePanel extends HTMLElement {
margin-bottom: 12px; margin-bottom: 12px;
} }
.brand {
display: flex;
align-items: baseline;
gap: 10px;
}
.title { .title {
font-size: 22px; font-size: 22px;
font-weight: 800; font-weight: 800;
@@ -174,11 +168,6 @@ class BahmcloudStorePanel extends HTMLElement {
background: color-mix(in srgb, var(--bcs-accent) 16%, var(--card-background-color)); background: color-mix(in srgb, var(--bcs-accent) 16%, var(--card-background-color));
} }
button:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.card { .card {
border: 1px solid var(--divider-color); border: 1px solid var(--divider-color);
background: var(--card-background-color); background: var(--card-background-color);
@@ -245,27 +234,20 @@ class BahmcloudStorePanel extends HTMLElement {
box-shadow: 0 0 0 2px color-mix(in srgb, var(--bcs-accent) 20%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bcs-accent) 20%, transparent);
} }
.small { .small { font-size: 12px; }
font-size: 12px;
}
a { a {
color: var(--bcs-accent); color: var(--bcs-accent);
text-decoration: none; text-decoration: none;
} }
a:hover { text-decoration: underline; }
a:hover {
text-decoration: underline;
}
</style> </style>
<div class="wrap"> <div class="wrap">
<div class="topbar"> <div class="topbar">
<div class="brand"> <div>
<div> <div class="title">Bahmcloud Store</div>
<div class="title">Bahmcloud Store</div> <div class="subtitle">BCS 0.3.0 — repository enrichment</div>
<div class="subtitle">BCS 0.2.0 — foundation build</div>
</div>
</div> </div>
<div class="actions"> <div class="actions">
@@ -339,13 +321,14 @@ class BahmcloudStorePanel extends HTMLElement {
const owner = r.owner ? `Owner: ${this._esc(r.owner)}` : "Owner: -"; const owner = r.owner ? `Owner: ${this._esc(r.owner)}` : "Owner: -";
const provider = r.provider ? `Provider: ${this._esc(r.provider)}` : "Provider: -"; const provider = r.provider ? `Provider: ${this._esc(r.provider)}` : "Provider: -";
const desc = r.description || "No description available.";
return ` return `
<div class="card"> <div class="card">
<div class="row"> <div class="row">
<div> <div>
<div><strong>${this._esc(r.name)}</strong></div> <div><strong>${this._esc(r.name)}</strong></div>
<div class="muted">${this._esc(r.description || "Description will be loaded in a later version.")}</div> <div class="muted">${this._esc(desc)}</div>
<div class="muted small">${owner} · ${provider}</div> <div class="muted small">${owner} · ${provider}</div>
<div class="muted small"><a href="${this._esc(r.url)}" target="_blank" rel="noreferrer">Open repository</a></div> <div class="muted small"><a href="${this._esc(r.url)}" target="_blank" rel="noreferrer">Open repository</a></div>
</div> </div>
@@ -355,15 +338,7 @@ class BahmcloudStorePanel extends HTMLElement {
`; `;
}).join(""); }).join("");
return ` return rows || `<div class="card">No repositories configured.</div>`;
<div class="card">
<div><strong>Store</strong></div>
<div class="muted small">Index URL: ${this._esc(this._data.store_url || "-")}</div>
<div class="muted small">Refresh seconds: ${this._esc(String(this._data.refresh_seconds || "-"))}</div>
</div>
${rows || `<div class="card">No repositories configured.</div>`}
`;
} }
_renderManage() { _renderManage() {
@@ -419,19 +394,9 @@ class BahmcloudStorePanel extends HTMLElement {
const addName = root.getElementById("addName"); const addName = root.getElementById("addName");
const addBtn = root.getElementById("addBtn"); const addBtn = root.getElementById("addBtn");
if (addUrl) { if (addUrl) addUrl.addEventListener("input", (e) => (this._customAddUrl = e.target.value));
addUrl.addEventListener("input", (e) => { if (addName) addName.addEventListener("input", (e) => (this._customAddName = e.target.value));
this._customAddUrl = e.target.value; if (addBtn) addBtn.addEventListener("click", () => this._addCustomRepo());
});
}
if (addName) {
addName.addEventListener("input", (e) => {
this._customAddName = e.target.value;
});
}
if (addBtn) {
addBtn.addEventListener("click", () => this._addCustomRepo());
}
for (const btn of root.querySelectorAll("[data-remove]")) { for (const btn of root.querySelectorAll("[data-remove]")) {
btn.addEventListener("click", () => { btn.addEventListener("click", () => {
@@ -450,13 +415,6 @@ class BahmcloudStorePanel extends HTMLElement {
<div class="muted">Accent: Bahmcloud Blue.</div> <div class="muted">Accent: Bahmcloud Blue.</div>
<div class="muted small" style="margin-top: 10px;">BCS version: ${this._esc(this._data.version || "-")}</div> <div class="muted small" style="margin-top: 10px;">BCS version: ${this._esc(this._data.version || "-")}</div>
</div> </div>
<div class="card">
<div><strong>Roadmap</strong></div>
<div class="muted">
Next versions will add: repo metadata (bcs.yaml / hacs.*), README view, install/uninstall, update entities.
</div>
</div>
`; `;
} }