code.gitea.io/gitea@v1.22.3/web_src/js/features/recent-commits.js (about)

     1  import {createApp} from 'vue';
     2  
     3  export async function initRepoRecentCommits() {
     4    const el = document.getElementById('repo-recent-commits-chart');
     5    if (!el) return;
     6  
     7    const {default: RepoRecentCommits} = await import(/* webpackChunkName: "recent-commits-graph" */'../components/RepoRecentCommits.vue');
     8    try {
     9      const View = createApp(RepoRecentCommits, {
    10        locale: {
    11          loadingTitle: el.getAttribute('data-locale-loading-title'),
    12          loadingTitleFailed: el.getAttribute('data-locale-loading-title-failed'),
    13          loadingInfo: el.getAttribute('data-locale-loading-info'),
    14        },
    15      });
    16      View.mount(el);
    17    } catch (err) {
    18      console.error('RepoRecentCommits failed to load', err);
    19      el.textContent = el.getAttribute('data-locale-component-failed-to-load');
    20    }
    21  }