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

serverless_bundle.js « serverless « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e8d87a40fc782649bbc2d52b82c352e1f7d5de63 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import Vue from 'vue';
import FunctionDetails from './components/function_details.vue';
import Functions from './components/functions.vue';
import { createStore } from './store';

export default class Serverless {
  constructor() {
    if (document.querySelector('.js-serverless-function-details-page') != null) {
      const entryPointData = document.querySelector('.js-serverless-function-details-page').dataset;
      const store = createStore(entryPointData);

      const {
        serviceName,
        serviceDescription,
        serviceEnvironment,
        serviceUrl,
        serviceNamespace,
        servicePodcount,
        serviceMetricsUrl,
        prometheus,
      } = entryPointData;
      const el = document.querySelector('#js-serverless-function-details');

      const service = {
        name: serviceName,
        description: serviceDescription,
        environment: serviceEnvironment,
        url: serviceUrl,
        namespace: serviceNamespace,
        podcount: servicePodcount,
        metricsUrl: serviceMetricsUrl,
      };

      this.functionDetails = new Vue({
        el,
        store,
        render(createElement) {
          return createElement(FunctionDetails, {
            props: {
              func: service,
              hasPrometheus: prometheus !== undefined,
            },
          });
        },
      });
    } else {
      const entryPointData = document.querySelector('.js-serverless-functions-page').dataset;
      const store = createStore(entryPointData);

      const el = document.querySelector('#js-serverless-functions');
      this.functions = new Vue({
        el,
        store,
        render(createElement) {
          return createElement(Functions);
        },
      });
    }
  }

  destroy() {
    this.destroyed = true;

    this.functions.$destroy();
    this.functionDetails.$destroy();
  }
}