feat: Implement core application structure with frontend styling, JavaScript, and Python backend services.
This commit is contained in:
+12
-16
@@ -2868,11 +2868,12 @@
|
||||
_currentFilter: "",
|
||||
|
||||
async load(vaultFilter = "") {
|
||||
this._currentFilter = vaultFilter;
|
||||
const v = vaultFilter || selectedContextVault || "all";
|
||||
this._currentFilter = v;
|
||||
this.showLoading();
|
||||
|
||||
let url = "/api/recent";
|
||||
if (vaultFilter) url += `?vault=${encodeURIComponent(vaultFilter)}`;
|
||||
let url = "/api/recent?mode=opened";
|
||||
if (v !== "all") url += `&vault=${encodeURIComponent(v)}`;
|
||||
|
||||
try {
|
||||
const data = await api(url);
|
||||
@@ -2954,7 +2955,7 @@
|
||||
title.title = file.title || file.path;
|
||||
card.appendChild(title);
|
||||
|
||||
// Path
|
||||
// Path (compact)
|
||||
const pathParts = file.path.split("/");
|
||||
if (pathParts.length > 1) {
|
||||
const path = document.createElement("div");
|
||||
@@ -2964,14 +2965,6 @@
|
||||
card.appendChild(path);
|
||||
}
|
||||
|
||||
// Preview
|
||||
if (file.preview) {
|
||||
const preview = document.createElement("p");
|
||||
preview.className = "dashboard-card-preview";
|
||||
preview.textContent = file.preview;
|
||||
card.appendChild(preview);
|
||||
}
|
||||
|
||||
// Footer with time and tags
|
||||
const footer = document.createElement("div");
|
||||
footer.className = "dashboard-card-footer";
|
||||
@@ -3057,12 +3050,12 @@
|
||||
const select = document.getElementById("dashboard-vault-filter");
|
||||
if (select) {
|
||||
select.addEventListener("change", () => {
|
||||
this.load(select.value || null);
|
||||
this.load(select.value);
|
||||
});
|
||||
}
|
||||
|
||||
this.populateVaultFilter();
|
||||
this.load(null);
|
||||
this.load(selectedContextVault);
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4663,8 +4656,11 @@
|
||||
// Show the dashboard widget instead of simple welcome message
|
||||
if (typeof DashboardRecentWidget !== "undefined") {
|
||||
// Re-init the widget to refresh data and populate vault filter
|
||||
DashboardRecentWidget.populateVaultFilter();
|
||||
DashboardRecentWidget.load(DashboardRecentWidget._currentFilter || null);
|
||||
const dashboardVaultFilter = document.getElementById("dashboard-vault-filter");
|
||||
if (dashboardVaultFilter) {
|
||||
dashboardVaultFilter.value = selectedContextVault === "all" ? "" : selectedContextVault;
|
||||
}
|
||||
DashboardRecentWidget.load(selectedContextVault);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user