The frontend for the project formerly known as signet, now known as beignet.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

AdminDashboardView.vue 1.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <div class="container is-max-desktop">
  3. <section class="section is-small px-0">
  4. <template v-if="nearlyCompletedFunds.length > 0">
  5. <div class="title is-4 has-text-white-ter has-text-centered">Nearly Completed Funds</div>
  6. <div v-for="(fund, ind) in nearlyCompletedFunds" :key="ind">
  7. <RouterLink :to="`/fund/${fund.id}`">
  8. <FundLink :fund="fund" :aside="`${round(fund.raised/fund.amountAvailable*100)}%`"/>
  9. </RouterLink>
  10. </div>
  11. </template>
  12. </section>
  13. </div>
  14. </template>
  15. <script setup lang="ts">
  16. import { ref } from 'vue';
  17. import { getNearlyCompletedFunds } from '@/api/composed';
  18. import FundLink from '@/components/FundLink.vue';
  19. import { NearlyCompletedFund } from '@/api/types';
  20. const nearlyCompletedFunds = ref([] as NearlyCompletedFund[]);
  21. const pctThreshold = 85;
  22. const req = await getNearlyCompletedFunds(pctThreshold);
  23. if (req?.funds) {
  24. nearlyCompletedFunds.value = req?.funds;
  25. }
  26. const round = (float: number, digits = 1) => {
  27. const factor = 10 ** digits;
  28. return Math.round(float * factor) / factor;
  29. };
  30. </script>
  31. <style scoped lang="stylus">
  32. </style>