From 60753b59509907bf5100bfcf1a43a4199fbdd0b0 Mon Sep 17 00:00:00 2001 From: ItsBioDude Date: Sun, 3 Dec 2023 14:28:32 +0700 Subject: [PATCH] add vo_niem --- src/DatabaseDefinitions.d.ts | Bin 3048 -> 2882 bytes src/routes/table/+page.svelte | 3 +++ src/routes/tara/+page.server.ts | 2 +- src/routes/tara/+page.svelte | 19 ++++++++++++++++++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/DatabaseDefinitions.d.ts b/src/DatabaseDefinitions.d.ts index bc7c106fb1e05a5e988f963b257e98cd681a670e..7a013ef2f4e5aae2256e781d91421ac1f759f2a9 100644 GIT binary patch literal 2882 zcmeHJO;5r=5S?pH{15#d8sou_M2`l&5YkXUXeb4{6(q=CSKr&E>9TDa7ddz!WW#nk zZ|2SH>+XJkjpRcXGM8Km2{G1q8e#S*3f2s>D>;`l3FH%V1&>@3*vFPNlXsa(3|wwm zW8mkK!rF&_6@%U>ewAf|$X%Jjb1fH6mY%j$Y_=Azw05N@m)g#l`xTLEp_#pc#{jcX zZZRt`Vhp7%n_biexW(X>z>`c$dmtU{&uWzOCP3|d-IIMpfSx^}1FM=p-we%*CEE386j#dCHqpF~?oWoGs;ZwQJf@?{NZWIEf43c@M1Ldj1mq4iR~0 cJZ{t*eSY#btH7Gyd}nu`J!YP=OXeo}1L9VfZU6uP literal 3048 zcmeHJ%TB{E5Zp5o|B&xMLL7KVa72YmR7IpMZA6-uBs{9ZuLCnSrgjo4*Hvy+RDaraz>k|H@@Grw!`m&i}E(Qw4xT=m>u9#y5ZMLzT<#UV7ylt81ni2BJ+|l!~ zBx=;mjNX}MK8+RA&w%BwCD`E^V$)IC`{t)7gCF$3Mw&e|woISH<_Z?a=(85e&t491 zb&hR|e%NQ^EkUG=H&HuX!jq==e!9qySF{3}$ch5vP`}8zd7vM}hDTx06{47de`M(t zk?fw6&Hrb1oBcKN!c4KAP^bIX*eko3eWoyWjq%%?Hn+8=-5Eo6x3PZwZsYvC*9;Fu zcXK>cTQ|!?wP~L3gC^7W#W%SgqOY6ncc`VTZLH1*wjbEesvg2F)?ac9;L| z*F8?d32rj~-GpMCHIX_od27(8Xo-88K6A{sU1MGSS2(>3oZ>Zf@J`y7olEHEEw(TH Y=jy!WZM#AwtQmvf`*t4|bq@9W2j0n{g8%>k diff --git a/src/routes/table/+page.svelte b/src/routes/table/+page.svelte index 57a346c..b014509 100644 --- a/src/routes/table/+page.svelte +++ b/src/routes/table/+page.svelte @@ -12,6 +12,7 @@ hang_phuc: ele.hang_phuc === null ? '' : ele.hang_phuc, lhs: ele.lhs === null ? '' : ele.lhs, seven_lines: ele.seven_lines === null ? '' : ele.seven_lines, + vo_niem: ele.vo_niem === null ? '' : ele.vo_niem, })); let sum = { @@ -22,6 +23,7 @@ hang_phuc: 'N/A', lhs: 0, seven_lines: 0, + vo_niem: 'N/A', }; dates.forEach((ele) => { @@ -36,6 +38,7 @@ tara: 'Green Tara', taras_homage: '21 Tara Homages', lay_dai: 'Lạy Dài', + vo_niem: 'An trú Vô Niệm', hang_phuc: 'Kiết Già Hàng Phục', lhs: 'Guru Rinpoche', seven_lines: 'Seven Lines Guru Rinpoche', diff --git a/src/routes/tara/+page.server.ts b/src/routes/tara/+page.server.ts index 054222b..7b0189b 100644 --- a/src/routes/tara/+page.server.ts +++ b/src/routes/tara/+page.server.ts @@ -7,7 +7,7 @@ export const load: PageServerLoad = async ({ url, locals: { getSession } }) => { // console.log(session); const { data } = await supabase .from('main') - .select('id, created_at, tara, taras_homage, lay_dai, hang_phuc'); + .select('id, created_at, tara, taras_homage, lay_dai, hang_phuc, vo_niem'); return { dates: data ?? [], session: diff --git a/src/routes/tara/+page.svelte b/src/routes/tara/+page.svelte index b466fc2..9f1b727 100644 --- a/src/routes/tara/+page.svelte +++ b/src/routes/tara/+page.svelte @@ -53,12 +53,14 @@ taras_homage: values.taras_homage + lastDate.taras_homage, hang_phuc: values.hang_phuc + lastDate.hang_phuc, lay_dai: values.lay_dai + lastDate.lay_dai, + vo_niem: values.vo_niem + lastDate.vo_niem, }) .eq('created_at', created_date); lastDate.tara += values.tara; lastDate.taras_homage += values.taras_homage; lastDate.hang_phuc += values.hang_phuc; lastDate.lay_dai += values.lay_dai; + lastDate.vo_niem += values.vo_niem; } else { await supabase.from('main').insert([ { @@ -67,6 +69,7 @@ hang_phuc: values.hang_phuc, created_at: created_date, lay_dai: values.lay_dai, + vo_niem: values.vo_niem, }, ]); @@ -77,6 +80,7 @@ taras_homage: values.taras_homage, hang_phuc: values.hang_phuc, created_at: created_date, + vo_niem: values.vo_niem, }, ]; } @@ -98,6 +102,7 @@ y1: e.taras_homage, y2: e.lay_dai / 3, y3: e.hang_phuc, + y4: e.vo_niem, }); }); // const x = (DataRecord) => DataRecord.x; @@ -106,6 +111,7 @@ (DataRecord: { y1: number }) => DataRecord.y1, (DataRecord: { y2: number }) => DataRecord.y2, (DataRecord: { y3: number }) => DataRecord.y3, + (DataRecord: { y4: number }) => DataRecord.y4, ]; const bulletLegendItems = [ @@ -113,6 +119,7 @@ '21 Tara Homages', 'Lạy dài (x3)', 'Hàng Phục', + 'An trú Vô Niệm (s)', ].map((label) => ({ name: label })); // console.log(DataRecord); @@ -131,7 +138,7 @@ md:(px-4 py-4) md:(mt-4 mr-10)" > - {#each dates as { tara, taras_homage, created_at, hang_phuc, lay_dai, tam }, i} + {#each dates as { tara, taras_homage, created_at, hang_phuc, lay_dai, vo_niem }, i} @@ -146,6 +153,11 @@ ({hang_phuc} Phút Kiết Già Hàng Phục) {/if} + {#if vo_niem != null} + + ({vo_niem}s Vô Niệm) + + {/if}
Tán thán 21 Tara: {taras_homage} Lần {#if lay_dai != null} @@ -177,6 +189,7 @@ {#if visible && session} +

Green Tara (Chuỗi)

@@ -214,6 +227,10 @@ />
+
+

Thời gian An Trú Vô Niệm (giây)

+ +
{/if}