Skip to content

Commit 15f32c8

Browse files
committed
update live-demo and add inter plugin
1 parent 4ed3ef7 commit 15f32c8

File tree

18 files changed

+1535
-396
lines changed

18 files changed

+1535
-396
lines changed

adminforth/documentation/docs/tutorial/03-Customization/06-customPages.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Create a Vue component in the `custom` directory of your project, e.g. `Dashboar
3636
3737
```html title="./custom/Dashboard.vue"
3838
<template>
39-
<div class="px-4 py-8 bg-blue-50 dark:bg-gray-900 dark:shadow-none min-h-screen">
39+
<div class="px-4 py-8 bg-blue-50 dark:bg-gray-900 dark:shadow-none min-h-[calc(100vh-56px)]">
4040
<h1 class="mb-4 text-xl font-extrabold text-gray-900 dark:text-white md:text-2xl lg:text-3xl"><span
4141
class="text-transparent bg-clip-text bg-gradient-to-r to-emerald-600 from-sky-400">{{ $t('Apartments') }}</span>
4242
Statistics.</h1>
@@ -431,7 +431,7 @@ app.get(`${ADMIN_BASE_URL}/api/dashboard/`,
431431
const days = req.body.days || 7;
432432
const apartsByDays = await admin.resource('aparts').dataConnector.db.prepare(
433433
`SELECT
434-
strftime('%Y-%m-%d', created_at, 'unixepoch') as day,
434+
strftime('%Y-%m-%d', created_at) as day,
435435
COUNT(*) as count
436436
FROM apartments
437437
GROUP BY day
@@ -445,7 +445,7 @@ app.get(`${ADMIN_BASE_URL}/api/dashboard/`,
445445
// add listed, unlisted, listedPrice, unlistedPrice
446446
const listedVsUnlistedByDays = await admin.resource('aparts').dataConnector.db.prepare(
447447
`SELECT
448-
strftime('%Y-%m-%d', created_at, 'unixepoch') as day,
448+
strftime('%Y-%m-%d', created_at) as day,
449449
SUM(listed) as listed,
450450
COUNT(*) - SUM(listed) as unlisted,
451451
SUM(listed * price) as listedPrice,
@@ -459,7 +459,7 @@ app.get(`${ADMIN_BASE_URL}/api/dashboard/`,
459459

460460
const listedVsUnlistedPriceByDays = await admin.resource('aparts').dataConnector.db.prepare(
461461
`SELECT
462-
strftime('%Y-%m-%d', created_at, 'unixepoch') as day,
462+
strftime('%Y-%m-%d', created_at) as day,
463463
SUM(listed * price) as listedPrice,
464464
SUM((1 - listed) * price) as unlistedPrice
465465
FROM apartments

dev-demo/custom/Dash.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="px-4 py-8 bg-blue-50 dark:bg-gray-900 dark:shadow-none min-h-screen">
2+
<div class="px-4 py-8 bg-blue-50 dark:bg-gray-900 dark:shadow-none min-h-[calc(100vh-56px)]">
33

44
<h1 class="mb-4 text-xl font-extrabold text-gray-900 dark:text-white md:text-2xl lg:text-3xl"
55
v-html='$t("<span class=\"text-transparent bg-clip-text bg-gradient-to-r to-emerald-600 from-sky-400\">Apartments</span> Statistics.")'></h1>

dev-demo/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ app.get(`${ADMIN_BASE_URL}/api/dashboard/`,
325325
const days = req.body.days || 7;
326326
const apartsByDays = await db.prepare(
327327
`SELECT
328-
strftime('%Y-%m-%d', created_at, 'unixepoch') as day,
328+
strftime('%Y-%m-%d', created_at) as day,
329329
COUNT(*) as count
330330
FROM apartments
331331
GROUP BY day
@@ -339,7 +339,7 @@ app.get(`${ADMIN_BASE_URL}/api/dashboard/`,
339339
// add listed, unlisted, listedPrice, unlistedPrice
340340
const listedVsUnlistedByDays = await db.prepare(
341341
`SELECT
342-
strftime('%Y-%m-%d', created_at, 'unixepoch') as day,
342+
strftime('%Y-%m-%d', created_at) as day,
343343
SUM(listed) as listed,
344344
COUNT(*) - SUM(listed) as unlisted,
345345
SUM(listed * price) as listedPrice,
@@ -353,7 +353,7 @@ app.get(`${ADMIN_BASE_URL}/api/dashboard/`,
353353

354354
const listedVsUnlistedPriceByDays = await db.prepare(
355355
`SELECT
356-
strftime('%Y-%m-%d', created_at, 'unixepoch') as day,
356+
strftime('%Y-%m-%d', created_at) as day,
357357
SUM(listed * price) as listedPrice,
358358
SUM((1 - listed) * price) as unlistedPrice
359359
FROM apartments

0 commit comments

Comments
 (0)