Replace fixed paths with response from API
Currently, the Redfish request used fixed URIs, modify the code to use
the BMC and System paths got from response of API calls.
For CertificateStore, since it was using the URL for constant variable
assignment, changed the constant CERTIFICATE_TYPES to method call.
Change-Id: I330b7272083e3e6993aae5705aae170b8e9a4659
Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
diff --git a/src/views/SecurityAndAccess/Certificates/ModalGenerateCsr.vue b/src/views/SecurityAndAccess/Certificates/ModalGenerateCsr.vue
index d9d6591..9f60d2b 100644
--- a/src/views/SecurityAndAccess/Certificates/ModalGenerateCsr.vue
+++ b/src/views/SecurityAndAccess/Certificates/ModalGenerateCsr.vue
@@ -366,7 +366,6 @@
import { required, requiredIf } from 'vuelidate/lib/validators';
import { COUNTRY_LIST } from './CsrCountryCodes';
-import { CERTIFICATE_TYPES } from '@/store/modules/SecurityAndAccess/CertificatesStore';
import BVToastMixin from '@/components/Mixins/BVToastMixin';
import VuelidateMixin from '@/components/Mixins/VuelidateMixin.js';
@@ -391,14 +390,6 @@
keyCurveId: null,
keyBitLength: null,
},
- certificateOptions: CERTIFICATE_TYPES.reduce((arr, cert) => {
- if (cert.type === 'TrustStore Certificate') return arr;
- arr.push({
- text: cert.label,
- value: cert.type,
- });
- return arr;
- }, []),
countryOptions: COUNTRY_LIST.map((country) => ({
text: country.label,
value: country.code,
@@ -410,6 +401,21 @@
csrStringCopied: false,
};
},
+ computed: {
+ certificateTypes() {
+ return this.$store.getters['certificates/certificateTypes'];
+ },
+ certificateOptions() {
+ return this.certificateTypes.reduce((arr, cert) => {
+ if (cert.type === 'TrustStore Certificate') return arr;
+ arr.push({
+ text: cert.label,
+ value: cert.type,
+ });
+ return arr;
+ }, []);
+ },
+ },
validations: {
form: {
certificateType: { required },