mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-11 08:47:06 +02:00
62 lines
1.1 KiB
JavaScript
62 lines
1.1 KiB
JavaScript
"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: `${relativeUrlRoot}/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 };
|