Skip to content

Commit f1580f0

Browse files
megasanjayAydawka
andauthored
fix: add umami time zone (#231)
* fix: add umami timezone * fix: update citation count document * chore: add number formatting * fix: mini dataset warning banner text * fix: mini dataset text in the dataset size section * fix: update citation count document --------- Co-authored-by: aydawka <[email protected]>
1 parent 880fcb0 commit f1580f0

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

components/side/DatasetSize.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const parsedSize = byteSize(props.size, { precision: 2 }).toString();
4343
:to="`/datasets/${child}`"
4444
class="p flex justify-center text-xs text-sky-700 hover:underline"
4545
>
46-
A smaller version is available for model training...
46+
A smaller version is available for pipeline development...
4747
</NuxtLink>
4848
</n-flex>
4949
</template>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@nuxtjs/eslint-config-typescript": "12.1.0",
2828
"@nuxtjs/google-fonts": "3.1.3",
2929
"@nuxtjs/sitemap": "5.1.0",
30-
"@nuxtjs/tailwindcss": "6.14.0",
30+
"@nuxtjs/tailwindcss": "6.11.4",
3131
"@tailwindcss/typography": "0.5.10",
3232
"@types/byte-size": "^8.1.2",
3333
"@types/marked": "6.0.0",

pages/datasets/[datasetid]/index.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ const tabs = reactive([
5757
shownInMini: true,
5858
},
5959
]);
60+
61+
const formatter = Intl.NumberFormat("en", { notation: "compact" });
62+
6063
const totalViewCount = ref(0);
6164
const totalDownloadApprovals = ref(0);
6265
const totalDownloadApprovalforAllVersions = ref(0);
@@ -422,8 +425,8 @@ const onTabChange = () => {
422425
type="warning"
423426
>
424427
<p>
425-
It is only intended to be used as a smaller training dataset for model
426-
and workflow development. To access the full dataset, please
428+
It is only intended to help develop pipelines before downloading the
429+
full dataset. To access the full dataset, please
427430
<NuxtLink
428431
:to="`/datasets/${dataset?.data.parent || ''}`"
429432
class="text-blue-500 hover:underline"
@@ -686,11 +689,11 @@ const onTabChange = () => {
686689

687690
<div v-else class="min-w-[36px] text-sm font-medium">
688691
<div v-if="currentTab === 'currentVersion'">
689-
{{ totalViewCount }}
692+
{{ formatter.format(totalViewCount || 0) }}
690693
</div>
691694

692695
<div v-else>
693-
{{ totalViewCount }}
696+
{{ formatter.format(totalViewCount || 0) }}
694697
</div>
695698
</div>
696699
</TransitionFade>
@@ -713,11 +716,11 @@ const onTabChange = () => {
713716

714717
<div v-else class="min-w-[36px] text-sm font-medium">
715718
<div v-if="currentTab === 'currentVersion'">
716-
{{ totalViewCount }}
719+
{{ formatter.format(totalViewCount || 0) }}
717720
</div>
718721

719722
<div v-else>
720-
{{ totalViewCount }}
723+
{{ formatter.format(totalViewCount || 0) }}
721724
</div>
722725
</div>
723726
</TransitionFade>
@@ -823,7 +826,7 @@ const onTabChange = () => {
823826
<a
824827
class="flex justify-center pt-4 text-xs text-sky-700 hover:underline"
825828
target="_blank"
826-
href="https://github.com/AI-READI/fairhub-portal/blob/citation-count/dev/usage-statistics.md"
829+
href="https://github.com/AI-READI/fairhub-portal/blob/main/dev/usage-statistics.md"
827830
>
828831
More info on how stats are collected....
829832
</a>

server/api/viewCount/[datasetid]/all.get.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default defineEventHandler(async (event) => {
5050

5151
for (const version of allVersions) {
5252
const res = await fetch(
53-
`https://umami.aireadi.org/api/websites/${process.env.UMAMI_WEBSITE_ID}/pageviews?unit=year&endAt=${currentTime}&startAt=1709149073000&url=/datasets/${version.id}`,
53+
`https://umami.aireadi.org/api/websites/${process.env.UMAMI_WEBSITE_ID}/pageviews?unit=year&endAt=${currentTime}&startAt=1709149073000&url=/datasets/${version.id}&timezone=America/Los_Angeles`,
5454
{
5555
headers: {
5656
Authorization: `Bearer ${token}`,
@@ -61,6 +61,7 @@ export default defineEventHandler(async (event) => {
6161

6262
if (response.ok) {
6363
const data = await res.json();
64+
6465
total += data.pageviews.reduce(
6566
(
6667
acc: number,

server/api/viewCount/[datasetid]/index.get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default defineEventHandler(async (event) => {
4141
const currentTime: number = Date.now();
4242

4343
const res = await fetch(
44-
`https://umami.aireadi.org/api/websites/${process.env.UMAMI_WEBSITE_ID}/pageviews?unit=year&endAt=${currentTime}&startAt=1709149073000&url=/datasets/${datasetid}`,
44+
`https://umami.aireadi.org/api/websites/${process.env.UMAMI_WEBSITE_ID}/pageviews?unit=year&endAt=${currentTime}&startAt=1709149073000&url=/datasets/${datasetid}&timezone=America/Los_Angeles`,
4545
{
4646
headers: {
4747
Authorization: `Bearer ${token}`,

0 commit comments

Comments
 (0)