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

index.js « background_migrations « admin « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4ddd8f17c9ad4d766ec8bde3f64a440f90b2bb09 (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
import Vue from 'vue';
import * as Sentry from '@sentry/browser';
import Translate from '~/vue_shared/translate';
import BackgroundMigrationsDatabaseListbox from './components/database_listbox.vue';

Vue.use(Translate);

export const initBackgroundMigrationsApp = () => {
  const el = document.getElementById('js-database-listbox');

  if (!el) {
    return false;
  }

  const { selectedDatabase } = el.dataset;
  let { databases } = el.dataset;

  try {
    databases = JSON.parse(databases).map((database) => ({
      value: database,
      text: database,
    }));
  } catch (e) {
    Sentry.captureException(e);
  }

  return new Vue({
    el,
    render(createElement) {
      return createElement(BackgroundMigrationsDatabaseListbox, {
        props: {
          databases,
          selectedDatabase,
        },
      });
    },
  });
};