File tree Expand file tree Collapse file tree 5 files changed +46
-1
lines changed Expand file tree Collapse file tree 5 files changed +46
-1
lines changed Original file line number Diff line number Diff line change 1+ <template >
2+ <div v-if =" lastUpdated" class =" flex justify-end mr-24 pt-5" >
3+ <p class =" opacity-50" >
4+ {{ lastUpdated }}
5+ </p >
6+ </div >
7+ </template >
8+
9+ <script >
10+ export default {
11+ name: ' LastUpdated' ,
12+ data () {
13+ return {
14+ lastUpdated: null ,
15+ }
16+ },
17+ async fetch () {
18+ const response = await this .$axios .get (' /v1/stats/updated' )
19+ const year = new Date (response .data .lastUpdated ).getFullYear ()
20+ const month = new Date (response .data .lastUpdated ).toLocaleString (' en-GB' , {
21+ month: ' 2-digit' ,
22+ })
23+ const day = new Date (response .data .lastUpdated ).toLocaleString (' en-GB' , {
24+ day: ' 2-digit' ,
25+ })
26+ const time = new Date (response .data .lastUpdated ).toLocaleTimeString (' en-GB' )
27+ this .lastUpdated = ` The information on this site was last updated at ${ year} -${ month} -${ day} ${ time} `
28+ },
29+ }
30+ </script >
31+
32+ <style lang="postcss" scoped>
33+ .cards-container {
34+ @apply block py-2 w-11/ 12 mx-auto lg :flex lg:flex-nowrap lg:justify-center;
35+ }
36+ </style >
Original file line number Diff line number Diff line change 3838import { mapState } from ' vuex'
3939import Card from ' ./Card.vue'
4040export default {
41- name: ' Stats ' ,
41+ name: ' StatsCards ' ,
4242 components: {
4343 Card,
4444 },
Original file line number Diff line number Diff line change 11<template >
22 <div class =" page-container" >
33 <Hero title =" Contributors" />
4+ <LastUpdated />
45 <div class =" area-chart-section" >
56 <div class =" chart-header" >
67 <div class =" divider-black" ></div >
3031</template >
3132
3233<script >
34+ import LastUpdated from ' ~/components/LastUpdated.vue'
3335export default {
3436 name: ' ContributorsPage' ,
3537 components: {
3638 Hero : () => import (' ~/components/Hero.vue' ),
3739 AreaChart : () => import (' ~/components/AreaChart.vue' ),
3840 BarChart : () => import (' ~/components/BarChart.vue' ),
3941 TopDevelopers : () => import (' ~/components/TopDevelopers.vue' ),
42+ LastUpdated,
4043 },
4144 data () {
4245 return {
Original file line number Diff line number Diff line change 11<template >
22 <div class =" bg-gray" >
33 <Hero />
4+ <LastUpdated />
45 <LazyHydrate when-visible >
56 <Stats />
67 </LazyHydrate >
1314<script >
1415import LazyHydrate from ' vue-lazy-hydration'
1516import Hero from ' ../components/HomePageHero.vue'
17+ import LastUpdated from ' ~/components/LastUpdated.vue'
1618export default {
1719 components: {
1820 Hero,
1921 Stats : () => import (' ../components/Stats.vue' ),
2022 TopDevelopers : () => import (' ../components/TopDevelopers.vue' ),
2123 LazyHydrate,
24+ LastUpdated,
2225 },
2326 mounted () {
2427 this .$store .commit (' setPeriod' , ' last_30_days' )
Original file line number Diff line number Diff line change 11<template >
22 <div class =" page-container" >
33 <Hero title =" Organizations" />
4+ <LastUpdated />
45 <div class =" area-chart-section" >
56 <div class =" chart-header" >
67 <div class =" divider-black" ></div >
2122</template >
2223
2324<script >
25+ import LastUpdated from ' ~/components/LastUpdated.vue'
2426export default {
2527 name: ' OrganizationsPage' ,
2628 components: {
2729 Hero : () => import (' ~/components/Hero.vue' ),
2830 AreaChart : () => import (' ~/components/AreaChart.vue' ),
2931 TopOrganizations : () => import (' ~/components/TopOrganizations.vue' ),
32+ LastUpdated,
3033 },
3134 data () {
3235 return {
You can’t perform that action at this time.
0 commit comments