custom_components/bahmcloud_store/panel/panel.js aktualisiert
This commit is contained in:
@@ -112,12 +112,6 @@ class BahmcloudStorePanel extends HTMLElement {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 22px;
|
||||
font-weight: 800;
|
||||
@@ -174,11 +168,6 @@ class BahmcloudStorePanel extends HTMLElement {
|
||||
background: color-mix(in srgb, var(--bcs-accent) 16%, var(--card-background-color));
|
||||
}
|
||||
|
||||
button:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.card {
|
||||
border: 1px solid var(--divider-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);
|
||||
}
|
||||
|
||||
.small {
|
||||
font-size: 12px;
|
||||
}
|
||||
.small { font-size: 12px; }
|
||||
|
||||
a {
|
||||
color: var(--bcs-accent);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:hover { text-decoration: underline; }
|
||||
</style>
|
||||
|
||||
<div class="wrap">
|
||||
<div class="topbar">
|
||||
<div class="brand">
|
||||
<div>
|
||||
<div class="title">Bahmcloud Store</div>
|
||||
<div class="subtitle">BCS 0.2.0 — foundation build</div>
|
||||
</div>
|
||||
<div class="subtitle">BCS 0.3.0 — repository enrichment</div>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
@@ -339,13 +321,14 @@ class BahmcloudStorePanel extends HTMLElement {
|
||||
|
||||
const owner = r.owner ? `Owner: ${this._esc(r.owner)}` : "Owner: -";
|
||||
const provider = r.provider ? `Provider: ${this._esc(r.provider)}` : "Provider: -";
|
||||
const desc = r.description || "No description available.";
|
||||
|
||||
return `
|
||||
<div class="card">
|
||||
<div class="row">
|
||||
<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"><a href="${this._esc(r.url)}" target="_blank" rel="noreferrer">Open repository</a></div>
|
||||
</div>
|
||||
@@ -355,15 +338,7 @@ class BahmcloudStorePanel extends HTMLElement {
|
||||
`;
|
||||
}).join("");
|
||||
|
||||
return `
|
||||
<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>`}
|
||||
`;
|
||||
return rows || `<div class="card">No repositories configured.</div>`;
|
||||
}
|
||||
|
||||
_renderManage() {
|
||||
@@ -419,19 +394,9 @@ class BahmcloudStorePanel extends HTMLElement {
|
||||
const addName = root.getElementById("addName");
|
||||
const addBtn = root.getElementById("addBtn");
|
||||
|
||||
if (addUrl) {
|
||||
addUrl.addEventListener("input", (e) => {
|
||||
this._customAddUrl = e.target.value;
|
||||
});
|
||||
}
|
||||
if (addName) {
|
||||
addName.addEventListener("input", (e) => {
|
||||
this._customAddName = e.target.value;
|
||||
});
|
||||
}
|
||||
if (addBtn) {
|
||||
addBtn.addEventListener("click", () => this._addCustomRepo());
|
||||
}
|
||||
if (addUrl) addUrl.addEventListener("input", (e) => (this._customAddUrl = e.target.value));
|
||||
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]")) {
|
||||
btn.addEventListener("click", () => {
|
||||
@@ -450,13 +415,6 @@ class BahmcloudStorePanel extends HTMLElement {
|
||||
<div class="muted">Accent: Bahmcloud Blue.</div>
|
||||
<div class="muted small" style="margin-top: 10px;">BCS version: ${this._esc(this._data.version || "-")}</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>
|
||||
`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user