sveltekit-admin 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server/handler.js +3 -3
- package/package.json +1 -1
package/dist/server/handler.js
CHANGED
|
@@ -450,7 +450,7 @@ function adjustColor(hex, percent) {
|
|
|
450
450
|
const B = Math.max(0, Math.min(255, (num & 0x0000FF) + amt));
|
|
451
451
|
return `#${(0x1000000 + R * 0x10000 + G * 0x100 + B).toString(16).slice(1)}`;
|
|
452
452
|
}
|
|
453
|
-
function dashboardView(models, stats) {
|
|
453
|
+
function dashboardView(models, stats, basePath) {
|
|
454
454
|
return `
|
|
455
455
|
<h1>Dashboard</h1>
|
|
456
456
|
<p class="ska-subtitle">Welcome to your admin panel</p>
|
|
@@ -479,7 +479,7 @@ function dashboardView(models, stats) {
|
|
|
479
479
|
<h2>Models</h2>
|
|
480
480
|
<div class="ska-models">
|
|
481
481
|
${models.map(m => `
|
|
482
|
-
<a href="/${m.name.toLowerCase()}" class="ska-model-card">
|
|
482
|
+
<a href="${basePath}/${m.name.toLowerCase()}" class="ska-model-card">
|
|
483
483
|
<div>
|
|
484
484
|
<div class="ska-model-card__name">${m.label}</div>
|
|
485
485
|
<div class="ska-model-card__count">${m.count} records</div>
|
|
@@ -816,7 +816,7 @@ export function createAdminHandler(config) {
|
|
|
816
816
|
};
|
|
817
817
|
}));
|
|
818
818
|
const totalRecords = modelsWithCounts.reduce((sum, m) => sum + m.count, 0);
|
|
819
|
-
content = dashboardView(modelsWithCounts, { total: totalRecords, models: modelsWithCounts.length });
|
|
819
|
+
content = dashboardView(modelsWithCounts, { total: totalRecords, models: modelsWithCounts.length }, basePath);
|
|
820
820
|
}
|
|
821
821
|
else if (route.view === 'list' && route.model) {
|
|
822
822
|
currentModel = route.model;
|