Sha256: f4a8ee2d2a3fbd11d86172f58875ec31aa1be79e519240179d414b2a97d4fc79

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

"use strict";

import ConfigField from "./config_field";

const AwsCredential = {
  template: "#vue-aws-credential",
  components: {
    "config-field": ConfigField,
  },
  props: [
    "id",
    "pluginType",
    "pluginName",
  ],
  data: () => {
    return {
      credentialType: null,
      credentialOptions: [],
      options: [
        "simple",
        "assumeRoleCredentials",
        "instanceProfileCredentials",
        "sharedCredentials"
      ]
    };
  },

  computed: {
    token: function() {
      return Rails.csrfToken();
    }
  },

  mounted: function() {

  },

  methods: {
    onChange: function() {
      this.updateSection();
    },

    updateSection: function() {
      $.ajax({
        method: "GET",
        url: "/api/config_definitions",
        headers: {
          "X-CSRF-Token": this.token
        },
        data: {
          type: this.pluginType,
          name: this.pluginName
        }
      }).then((data) => {
        this.credentialOptions = data["awsCredentialOptions"][this.credentialType];
      });
    }
  }
};

export { AwsCredential as default };

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fluentd-ui-1.0.0.beta.1 app/javascript/packs/aws_credential.js