Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.js « list « registry « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e8e54fda169d919c2d1217726df2e16d76abc5cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import Vue from 'vue';
import registryApp from './components/app.vue';
import Translate from '~/vue_shared/translate';

Vue.use(Translate);

export default () => {
  const el = document.getElementById('js-vue-registry-images');

  if (!el) {
    return null;
  }

  return new Vue({
    el,
    components: {
      registryApp,
    },
    data() {
      const { dataset } = el;
      return {
        registryData: {
          endpoint: dataset.endpoint,
          characterError: Boolean(dataset.characterError),
          helpPagePath: dataset.helpPagePath,
          noContainersImage: dataset.noContainersImage,
          containersErrorImage: dataset.containersErrorImage,
          repositoryUrl: dataset.repositoryUrl,
          isGroupPage: dataset.isGroupPage,
          personalAccessTokensHelpLink: dataset.personalAccessTokensHelpLink,
          registryHostUrlWithPort: dataset.registryHostUrlWithPort,
          twoFactorAuthHelpLink: dataset.twoFactorAuthHelpLink,
        },
      };
    },
    render(createElement) {
      return createElement('registry-app', {
        props: {
          ...this.registryData,
        },
      });
    },
  });
};