code.gitea.io/gitea@v1.22.3/web_src/js/features/contributors.js (about)

     1  import {createApp} from 'vue';
     2  
     3  export async function initRepoContributors() {
     4    const el = document.getElementById('repo-contributors-chart');
     5    if (!el) return;
     6  
     7    const {default: RepoContributors} = await import(/* webpackChunkName: "contributors-graph" */'../components/RepoContributors.vue');
     8    try {
     9      const View = createApp(RepoContributors, {
    10        repoLink: el.getAttribute('data-repo-link'),
    11        locale: {
    12          filterLabel: el.getAttribute('data-locale-filter-label'),
    13          contributionType: {
    14            commits: el.getAttribute('data-locale-contribution-type-commits'),
    15            additions: el.getAttribute('data-locale-contribution-type-additions'),
    16            deletions: el.getAttribute('data-locale-contribution-type-deletions'),
    17          },
    18  
    19          loadingTitle: el.getAttribute('data-locale-loading-title'),
    20          loadingTitleFailed: el.getAttribute('data-locale-loading-title-failed'),
    21          loadingInfo: el.getAttribute('data-locale-loading-info'),
    22        },
    23      });
    24      View.mount(el);
    25    } catch (err) {
    26      console.error('RepoContributors failed to load', err);
    27      el.textContent = el.getAttribute('data-locale-component-failed-to-load');
    28    }
    29  }