summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/registry/index.js
blob: d8daec29fda195a430999bf0ad0eec871aec128b (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
import Vue from 'vue';
import registryApp from './components/app.vue';
import Translate from '../vue_shared/translate';

Vue.use(Translate);

export default () =>
  new Vue({
    el: '#js-vue-registry-images',
    components: {
      registryApp,
    },
    data() {
      const { dataset } = document.querySelector(this.$options.el);
      return {
        endpoint: dataset.endpoint,
        characterError: Boolean(dataset.characterError),
        helpPagePath: dataset.helpPagePath,
        noContainersImage: dataset.noContainersImage,
        containersErrorImage: dataset.containersErrorImage,
        repositoryUrl: dataset.repositoryUrl,
      };
    },
    render(createElement) {
      return createElement('registry-app', {
        props: {
          endpoint: this.endpoint,
          characterError: this.characterError,
          helpPagePath: this.helpPagePath,
          noContainersImage: this.noContainersImage,
          containersErrorImage: this.containersErrorImage,
          repositoryUrl: this.repositoryUrl,
        },
      });
    },
  });