diff --git a/charts/opskubedbcom-cassandraopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-cassandraopsrequest-editor/ui/create-ui.yaml index d0e0e0eaec..cf4599994a 100644 --- a/charts/opskubedbcom-cassandraopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-cassandraopsrequest-editor/ui/create-ui.yaml @@ -261,6 +261,20 @@ step: subtitle: Select a new configuration secret, apply a custom configuration, or remove an existing setup to update your database settings type: label-element + - type: editor + label: Current Configuration + schema: temp/properties/currentConfig + readonly: true + editorHeight: 120px + validateContent: false + if: + name: getCurrentConfig + type: function + loader: + name: getCurrentConfig + watchPaths: + - schema/properties/metadata/properties/namespace + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -366,6 +380,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: @@ -390,15 +405,6 @@ step: refresh: fetchConfigSecrets schema: temp/properties/selectedConfigurationRemove type: select - - editorHeight: 500px - hideFormatButton: true - init: - type: func - value: onRemoveConfigChange - readonly: true - schema: temp/properties/removeConfig - type: multi-file-editor - validateContent: false watcher: func: onRemoveConfigChange paths: diff --git a/charts/opskubedbcom-cassandraopsrequest-editor/ui/functions.js b/charts/opskubedbcom-cassandraopsrequest-editor/ui/functions.js index 96d5005c9d..8f66f9f14f 100644 --- a/charts/opskubedbcom-cassandraopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-cassandraopsrequest-editor/ui/functions.js @@ -894,6 +894,7 @@ export const useFunc = (model) => { let configSecrets = [] let secretConfigData = [] let existingSecrets = [] + let databaseInfoResponse = {} async function fetchConfigSecrets() { const owner = storeGet('/route/params/user') @@ -930,6 +931,7 @@ export const useFunc = (model) => { }, }, ) + databaseInfoResponse = resp?.data?.response || {} configSecrets = resp?.data?.response?.availableSecrets || [] secretConfigData = resp?.data?.response?.configurations || [] } catch (e) { @@ -949,6 +951,11 @@ export const useFunc = (model) => { } } + function getCurrentConfig() { + const currentConfig = databaseInfoResponse?.appliedConfig ?? '' + return currentConfig + } + async function getConfigSecrets(type) { type = type ? type + '/' : '' const secretStatus = getValue(discriminator, `${type}createSecret/status`) @@ -1226,38 +1233,12 @@ export const useFunc = (model) => { if (!selectedConfig) { commit('wizard/model$delete', `/spec/configuration/${type}removeCustomConfig`) - return [{ name: '', content: '' }] + return } commit('wizard/model$update', { path: `/spec/configuration/${type}removeCustomConfig`, value: true, }) - - const configuration = secretConfigData.find((item) => item.componentName === selectedConfig) - - if (!configuration.data) { - return [{ name: '', content: '' }] - } - - const configObj = [] - // Decode base64 and format as array of objects with name and content - Object.keys(configuration.data).forEach((fileName) => { - try { - // Decode base64 string - const decodedString = atob(configuration.data[fileName]) - configObj.push({ - name: fileName, - content: decodedString, - }) - } catch (e) { - console.error(`Error decoding ${fileName}:`, e) - configObj.push({ - name: fileName, - content: configuration.data[fileName], // Fallback to original if decode fails - }) - } - }) - return configObj } async function onNewConfigSecretChange(type) { @@ -1909,5 +1890,6 @@ export const useFunc = (model) => { onNewConfigSecretChange, onSelectedSecretChange, isTlsEnabled, + getCurrentConfig, } } diff --git a/charts/opskubedbcom-clickhouseopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-clickhouseopsrequest-editor/ui/create-ui.yaml index 7f3d54049d..ecad5665f6 100644 --- a/charts/opskubedbcom-clickhouseopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-clickhouseopsrequest-editor/ui/create-ui.yaml @@ -261,6 +261,20 @@ step: subtitle: Select a new configuration secret, apply a custom configuration, or remove an existing setup to update your database settings type: label-element + - type: editor + label: Current Configuration + schema: temp/properties/currentConfig + readonly: true + editorHeight: 120px + validateContent: false + if: + name: getCurrentConfig + type: function + loader: + name: getCurrentConfig + watchPaths: + - schema/properties/metadata/properties/namespace + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -366,6 +380,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: @@ -390,15 +405,6 @@ step: refresh: fetchConfigSecrets schema: temp/properties/selectedConfigurationRemove type: select - - editorHeight: 500px - hideFormatButton: true - init: - type: func - value: onRemoveConfigChange - readonly: true - schema: temp/properties/removeConfig - type: multi-file-editor - validateContent: false watcher: func: onRemoveConfigChange paths: diff --git a/charts/opskubedbcom-clickhouseopsrequest-editor/ui/functions.js b/charts/opskubedbcom-clickhouseopsrequest-editor/ui/functions.js index 3497716927..3d3afa4b7f 100644 --- a/charts/opskubedbcom-clickhouseopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-clickhouseopsrequest-editor/ui/functions.js @@ -907,6 +907,7 @@ export const useFunc = (model) => { let configSecrets = [] let secretConfigData = [] let existingSecrets = [] + let databaseInfoResponse = {} async function fetchConfigSecrets() { const owner = storeGet('/route/params/user') @@ -922,10 +923,10 @@ export const useFunc = (model) => { try { const resp = await axios.post( - `/clusters/${owner}/${cluster}/proxy/ui.kubedb.com/v1alpha1/databaseinfos`, + `/clusters/${owner}/${cluster}/proxy/ui.kubedb.com/v1alpha1/databaseconfigurations`, { apiVersion: 'ui.kubedb.com/v1alpha1', - kind: 'DatabaseInfo', + kind: 'DatabaseConfiguration', request: { source: { ref: { @@ -943,6 +944,7 @@ export const useFunc = (model) => { }, }, ) + databaseInfoResponse = resp?.data?.response || {} configSecrets = resp?.data?.response?.availableSecrets || [] secretConfigData = resp?.data?.response?.configurations || [] } catch (e) { @@ -962,6 +964,11 @@ export const useFunc = (model) => { } } + function getCurrentConfig() { + const currentConfig = databaseInfoResponse?.appliedConfig ?? '' + return currentConfig + } + async function getConfigSecrets(type) { type = type ? type + '/' : '' const secretStatus = getValue(discriminator, `${type}createSecret/status`) @@ -1239,38 +1246,12 @@ export const useFunc = (model) => { if (!selectedConfig) { commit('wizard/model$delete', `/spec/configuration/${type}removeCustomConfig`) - return [{ name: '', content: '' }] + return } commit('wizard/model$update', { path: `/spec/configuration/${type}removeCustomConfig`, value: true, }) - - const configuration = secretConfigData.find((item) => item.componentName === selectedConfig) - - if (!configuration.data) { - return [{ name: '', content: '' }] - } - - const configObj = [] - // Decode base64 and format as array of objects with name and content - Object.keys(configuration.data).forEach((fileName) => { - try { - // Decode base64 string - const decodedString = atob(configuration.data[fileName]) - configObj.push({ - name: fileName, - content: decodedString, - }) - } catch (e) { - console.error(`Error decoding ${fileName}:`, e) - configObj.push({ - name: fileName, - content: configuration.data[fileName], // Fallback to original if decode fails - }) - } - }) - return configObj } async function onNewConfigSecretChange(type) { @@ -1936,5 +1917,6 @@ export const useFunc = (model) => { onNewConfigSecretChange, onSelectedSecretChange, isTlsEnabled, + getCurrentConfig, } } diff --git a/charts/opskubedbcom-documentdbopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-documentdbopsrequest-editor/ui/create-ui.yaml index a1a383828b..4597ac8e14 100644 --- a/charts/opskubedbcom-documentdbopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-documentdbopsrequest-editor/ui/create-ui.yaml @@ -298,7 +298,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -404,6 +404,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: diff --git a/charts/opskubedbcom-druidopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-druidopsrequest-editor/ui/create-ui.yaml index ddf8457f77..6e7ddf52f6 100644 --- a/charts/opskubedbcom-druidopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-druidopsrequest-editor/ui/create-ui.yaml @@ -587,7 +587,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -693,6 +693,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: diff --git a/charts/opskubedbcom-elasticsearchopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-elasticsearchopsrequest-editor/ui/create-ui.yaml index ccaca34caf..d94cf37398 100644 --- a/charts/opskubedbcom-elasticsearchopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-elasticsearchopsrequest-editor/ui/create-ui.yaml @@ -1280,7 +1280,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -1386,6 +1386,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: diff --git a/charts/opskubedbcom-hanadbopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-hanadbopsrequest-editor/ui/create-ui.yaml index 3fc614b536..5deaddb56c 100644 --- a/charts/opskubedbcom-hanadbopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-hanadbopsrequest-editor/ui/create-ui.yaml @@ -158,6 +158,20 @@ step: subtitle: Select a new configuration secret, apply a custom configuration, or remove an existing setup to update your database settings type: label-element + - type: editor + label: Current Configuration + schema: temp/properties/currentConfig + readonly: true + editorHeight: 120px + validateContent: false + if: + name: getCurrentConfig + type: function + loader: + name: getCurrentConfig + watchPaths: + - schema/properties/metadata/properties/namespace + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -263,6 +277,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: @@ -287,15 +302,6 @@ step: refresh: fetchConfigSecrets schema: temp/properties/selectedConfigurationRemove type: select - - editorHeight: 500px - hideFormatButton: true - init: - type: func - value: onRemoveConfigChange - readonly: true - schema: temp/properties/removeConfig - type: multi-file-editor - validateContent: false watcher: func: onRemoveConfigChange paths: diff --git a/charts/opskubedbcom-hanadbopsrequest-editor/ui/functions.js b/charts/opskubedbcom-hanadbopsrequest-editor/ui/functions.js index 45a9b412b7..2e51d2d7bd 100644 --- a/charts/opskubedbcom-hanadbopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-hanadbopsrequest-editor/ui/functions.js @@ -788,6 +788,7 @@ export const useFunc = (model) => { let configSecrets = [] let secretConfigData = [] let existingSecrets = [] + let databaseInfoResponse = {} async function fetchConfigSecrets() { const owner = storeGet('/route/params/user') @@ -803,10 +804,10 @@ export const useFunc = (model) => { try { const resp = await axios.post( - `/clusters/${owner}/${cluster}/proxy/ui.kubedb.com/v1alpha1/databaseinfos`, + `/clusters/${owner}/${cluster}/proxy/ui.kubedb.com/v1alpha1/databaseconfigurations`, { apiVersion: 'ui.kubedb.com/v1alpha1', - kind: 'DatabaseInfo', + kind: 'DatabaseConfiguration', request: { source: { ref: { @@ -824,6 +825,7 @@ export const useFunc = (model) => { }, }, ) + databaseInfoResponse = resp?.data?.response || {} configSecrets = resp?.data?.response?.availableSecrets || [] secretConfigData = resp?.data?.response?.configurations || [] } catch (e) { @@ -843,6 +845,11 @@ export const useFunc = (model) => { } } + function getCurrentConfig() { + const currentConfig = databaseInfoResponse?.appliedConfig ?? '' + return currentConfig + } + async function getConfigSecrets(type) { type = type ? type + '/' : '' const secretStatus = getValue(discriminator, `${type}createSecret/status`) @@ -1120,38 +1127,12 @@ export const useFunc = (model) => { if (!selectedConfig) { commit('wizard/model$delete', `/spec/configuration/${type}removeCustomConfig`) - return [{ name: '', content: '' }] + return } commit('wizard/model$update', { path: `/spec/configuration/${type}removeCustomConfig`, value: true, }) - - const configuration = secretConfigData.find((item) => item.componentName === selectedConfig) - - if (!configuration.data) { - return [{ name: '', content: '' }] - } - - const configObj = [] - // Decode base64 and format as array of objects with name and content - Object.keys(configuration.data).forEach((fileName) => { - try { - // Decode base64 string - const decodedString = atob(configuration.data[fileName]) - configObj.push({ - name: fileName, - content: decodedString, - }) - } catch (e) { - console.error(`Error decoding ${fileName}:`, e) - configObj.push({ - name: fileName, - content: configuration.data[fileName], // Fallback to original if decode fails - }) - } - }) - return configObj } async function onNewConfigSecretChange(type) { @@ -1815,5 +1796,6 @@ export const useFunc = (model) => { onNewConfigSecretChange, onSelectedSecretChange, isTlsEnabled, + getCurrentConfig, } } diff --git a/charts/opskubedbcom-hazelcastopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-hazelcastopsrequest-editor/ui/create-ui.yaml index 4cd9c4027c..79340fa32b 100644 --- a/charts/opskubedbcom-hazelcastopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-hazelcastopsrequest-editor/ui/create-ui.yaml @@ -266,6 +266,20 @@ step: subtitle: Select a new configuration secret, apply a custom configuration, or remove an existing setup to update your database settings type: label-element + - type: editor + label: Current Configuration + schema: temp/properties/currentConfig + readonly: true + editorHeight: 120px + validateContent: false + if: + name: getCurrentConfig + type: function + loader: + name: getCurrentConfig + watchPaths: + - schema/properties/metadata/properties/namespace + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -371,6 +385,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: @@ -395,15 +410,6 @@ step: refresh: fetchConfigSecrets schema: temp/properties/selectedConfigurationRemove type: select - - editorHeight: 500px - hideFormatButton: true - init: - type: func - value: onRemoveConfigChange - readonly: true - schema: temp/properties/removeConfig - type: multi-file-editor - validateContent: false watcher: func: onRemoveConfigChange paths: diff --git a/charts/opskubedbcom-hazelcastopsrequest-editor/ui/functions.js b/charts/opskubedbcom-hazelcastopsrequest-editor/ui/functions.js index b893f02a53..7156294cb2 100644 --- a/charts/opskubedbcom-hazelcastopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-hazelcastopsrequest-editor/ui/functions.js @@ -898,6 +898,7 @@ export const useFunc = (model) => { let configSecrets = [] let secretConfigData = [] let existingSecrets = [] + let databaseInfoResponse = {} async function fetchConfigSecrets() { const owner = storeGet('/route/params/user') @@ -934,6 +935,7 @@ export const useFunc = (model) => { }, }, ) + databaseInfoResponse = resp?.data?.response || {} configSecrets = resp?.data?.response?.availableSecrets || [] secretConfigData = resp?.data?.response?.configurations || [] } catch (e) { @@ -953,6 +955,11 @@ export const useFunc = (model) => { } } + function getCurrentConfig() { + const currentConfig = databaseInfoResponse?.appliedConfig ?? '' + return currentConfig + } + async function getConfigSecrets(type) { type = type ? type + '/' : '' const secretStatus = getValue(discriminator, `${type}createSecret/status`) @@ -1230,38 +1237,12 @@ export const useFunc = (model) => { if (!selectedConfig) { commit('wizard/model$delete', `/spec/configuration/${type}removeCustomConfig`) - return [{ name: '', content: '' }] + return } commit('wizard/model$update', { path: `/spec/configuration/${type}removeCustomConfig`, value: true, }) - - const configuration = secretConfigData.find((item) => item.componentName === selectedConfig) - - if (!configuration.data) { - return [{ name: '', content: '' }] - } - - const configObj = [] - // Decode base64 and format as array of objects with name and content - Object.keys(configuration.data).forEach((fileName) => { - try { - // Decode base64 string - const decodedString = atob(configuration.data[fileName]) - configObj.push({ - name: fileName, - content: decodedString, - }) - } catch (e) { - console.error(`Error decoding ${fileName}:`, e) - configObj.push({ - name: fileName, - content: configuration.data[fileName], // Fallback to original if decode fails - }) - } - }) - return configObj } async function onNewConfigSecretChange(type) { @@ -1926,5 +1907,6 @@ export const useFunc = (model) => { onNewConfigSecretChange, onSelectedSecretChange, isTlsEnabled, + getCurrentConfig, } } diff --git a/charts/opskubedbcom-igniteopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-igniteopsrequest-editor/ui/create-ui.yaml index 8509e70631..a1bea14814 100644 --- a/charts/opskubedbcom-igniteopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-igniteopsrequest-editor/ui/create-ui.yaml @@ -262,6 +262,20 @@ step: subtitle: Select a new configuration secret, apply a custom configuration, or remove an existing setup to update your database settings type: label-element + - type: editor + label: Current Configuration + schema: temp/properties/currentConfig + readonly: true + editorHeight: 120px + validateContent: false + if: + name: getCurrentConfig + type: function + loader: + name: getCurrentConfig + watchPaths: + - schema/properties/metadata/properties/namespace + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -367,6 +381,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: @@ -391,15 +406,6 @@ step: refresh: fetchConfigSecrets schema: temp/properties/selectedConfigurationRemove type: select - - editorHeight: 500px - hideFormatButton: true - init: - type: func - value: onRemoveConfigChange - readonly: true - schema: temp/properties/removeConfig - type: multi-file-editor - validateContent: false watcher: func: onRemoveConfigChange paths: diff --git a/charts/opskubedbcom-igniteopsrequest-editor/ui/functions.js b/charts/opskubedbcom-igniteopsrequest-editor/ui/functions.js index 248c53d4e6..a5168caa19 100644 --- a/charts/opskubedbcom-igniteopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-igniteopsrequest-editor/ui/functions.js @@ -887,6 +887,7 @@ export const useFunc = (model) => { let configSecrets = [] let secretConfigData = [] let existingSecrets = [] + let databaseInfoResponse = {} async function fetchConfigSecrets() { const owner = storeGet('/route/params/user') @@ -923,6 +924,7 @@ export const useFunc = (model) => { }, }, ) + databaseInfoResponse = resp?.data?.response || {} configSecrets = resp?.data?.response?.availableSecrets || [] secretConfigData = resp?.data?.response?.configurations || [] } catch (e) { @@ -942,6 +944,11 @@ export const useFunc = (model) => { } } + function getCurrentConfig() { + const currentConfig = databaseInfoResponse?.appliedConfig ?? '' + return currentConfig + } + async function getConfigSecrets(type) { type = type ? type + '/' : '' const secretStatus = getValue(discriminator, `${type}createSecret/status`) @@ -1219,38 +1226,12 @@ export const useFunc = (model) => { if (!selectedConfig) { commit('wizard/model$delete', `/spec/configuration/${type}removeCustomConfig`) - return [{ name: '', content: '' }] + return } commit('wizard/model$update', { path: `/spec/configuration/${type}removeCustomConfig`, value: true, }) - - const configuration = secretConfigData.find((item) => item.componentName === selectedConfig) - - if (!configuration.data) { - return [{ name: '', content: '' }] - } - - const configObj = [] - // Decode base64 and format as array of objects with name and content - Object.keys(configuration.data).forEach((fileName) => { - try { - // Decode base64 string - const decodedString = atob(configuration.data[fileName]) - configObj.push({ - name: fileName, - content: decodedString, - }) - } catch (e) { - console.error(`Error decoding ${fileName}:`, e) - configObj.push({ - name: fileName, - content: configuration.data[fileName], // Fallback to original if decode fails - }) - } - }) - return configObj } async function onNewConfigSecretChange(type) { @@ -1915,6 +1896,7 @@ export const useFunc = (model) => { onNewConfigSecretChange, onSelectedSecretChange, isTlsEnabled, + getCurrentConfig, fetchPresets, } } diff --git a/charts/opskubedbcom-kafkaopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-kafkaopsrequest-editor/ui/create-ui.yaml index c5e3511783..4b316ea66b 100644 --- a/charts/opskubedbcom-kafkaopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-kafkaopsrequest-editor/ui/create-ui.yaml @@ -491,7 +491,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -597,6 +597,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: diff --git a/charts/opskubedbcom-mariadbopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-mariadbopsrequest-editor/ui/create-ui.yaml index ac4597bd43..f1badc9451 100644 --- a/charts/opskubedbcom-mariadbopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-mariadbopsrequest-editor/ui/create-ui.yaml @@ -293,7 +293,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -399,6 +399,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: diff --git a/charts/opskubedbcom-memcachedopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-memcachedopsrequest-editor/ui/create-ui.yaml index 6b367ad4dd..9bcf843d8f 100644 --- a/charts/opskubedbcom-memcachedopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-memcachedopsrequest-editor/ui/create-ui.yaml @@ -224,25 +224,25 @@ step: type: function type: block-layout - elements: - - label: "" - subtitle: Select a new configuration secret, apply a custom configuration, or - remove an existing setup to update your database settings - type: label-element - - type: editor - label: Current Configuration - schema: temp/properties/currentConfig - readonly: true - editorHeight: 120px - validateContent: false - if: - name: getCurrentConfig - type: function - loader: - name: getCurrentConfig - watchPaths: - - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status - elements: + - label: "" + subtitle: Select a new configuration secret, apply a custom configuration, + or remove an existing setup to update your database settings + type: label-element + - type: editor + label: Current Configuration + schema: temp/properties/currentConfig + readonly: true + editorHeight: 120px + validateContent: false + if: + name: getCurrentConfig + type: function + loader: + name: getCurrentConfig + watchPaths: + - schema/properties/metadata/properties/namespace + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -348,6 +348,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: @@ -392,7 +393,6 @@ step: schema: temp/properties/reconfigurationType type: tab-layout label: Configuration - showLabels: false type: block-layout if: name: ifRequestTypeEqualsTo|Reconfigure diff --git a/charts/opskubedbcom-milvusopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-milvusopsrequest-editor/ui/create-ui.yaml index b2014019c8..38515abbdc 100644 --- a/charts/opskubedbcom-milvusopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-milvusopsrequest-editor/ui/create-ui.yaml @@ -649,6 +649,20 @@ step: subtitle: Select a new configuration secret, apply a custom configuration, or remove an existing setup to update your database settings type: label-element + - type: editor + label: Current Configuration + schema: temp/properties/currentConfig + readonly: true + editorHeight: 120px + validateContent: false + if: + name: getCurrentConfig + type: function + loader: + name: getCurrentConfig + watchPaths: + - schema/properties/metadata/properties/namespace + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -737,7 +751,7 @@ step: label: New Apply Config subtitle: Define custom configurations for your database using key-value pairs. These parameters will overwrite existing settings.
Enter the - parameter you want to configure. + parameter you want to configure (e.g., max_connections). type: label-element - customClass: mb-2 label: Configuration @@ -754,6 +768,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: @@ -778,15 +793,6 @@ step: refresh: fetchConfigSecrets schema: temp/properties/selectedConfigurationRemove type: select - - editorHeight: 500px - hideFormatButton: true - init: - type: func - value: onRemoveConfigChange - readonly: true - schema: temp/properties/removeConfig - type: multi-file-editor - validateContent: false watcher: func: onRemoveConfigChange paths: diff --git a/charts/opskubedbcom-milvusopsrequest-editor/ui/functions.js b/charts/opskubedbcom-milvusopsrequest-editor/ui/functions.js index 83308eb603..8a5e9ac0eb 100644 --- a/charts/opskubedbcom-milvusopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-milvusopsrequest-editor/ui/functions.js @@ -731,12 +731,13 @@ export const useFunc = (model) => { const dbDetails = getValue(discriminator, '/dbDetails') let limits = {} if (type === 'node' || !type) { - limits = - dbDetails?.spec?.podTemplate?.spec?.containers?.[0]?.resources?.requests || { cpu: '', memory: '' } + limits = dbDetails?.spec?.podTemplate?.spec?.containers?.[0]?.resources?.requests || { + cpu: '', + memory: '', + } } else { - limits = - dbDetails?.spec?.topology?.distributed?.[type]?.podTemplate?.spec?.containers?.[0]?.resources?.requests || - { cpu: '', memory: '' } + limits = dbDetails?.spec?.topology?.distributed?.[type]?.podTemplate?.spec?.containers?.[0] + ?.resources?.requests || { cpu: '', memory: '' } } const avlMachines = presets.admin?.machineProfiles?.available || [] @@ -789,12 +790,13 @@ export const useFunc = (model) => { const dbDetails = getValue(discriminator, '/dbDetails') let limits = {} if (type === 'node' || !type) { - limits = - dbDetails?.spec?.podTemplate?.spec?.containers?.[0]?.resources?.requests || { cpu: '', memory: '' } + limits = dbDetails?.spec?.podTemplate?.spec?.containers?.[0]?.resources?.requests || { + cpu: '', + memory: '', + } } else { - limits = - dbDetails?.spec?.topology?.distributed?.[type]?.podTemplate?.spec?.containers?.[0]?.resources?.requests || - { cpu: '', memory: '' } + limits = dbDetails?.spec?.topology?.distributed?.[type]?.podTemplate?.spec?.containers?.[0] + ?.resources?.requests || { cpu: '', memory: '' } } const annotations = dbDetails?.metadata?.annotations || {} @@ -873,6 +875,7 @@ export const useFunc = (model) => { let configSecrets = [] let secretConfigData = [] let existingSecrets = [] + let databaseInfoResponse = {} async function fetchConfigSecrets() { const owner = storeGet('/route/params/user') @@ -887,10 +890,10 @@ export const useFunc = (model) => { try { const resp = await axios.post( - `/clusters/${owner}/${cluster}/proxy/ui.kubedb.com/v1alpha1/databaseinfos`, + `/clusters/${owner}/${cluster}/proxy/ui.kubedb.com/v1alpha1/databaseconfigurations`, { apiVersion: 'ui.kubedb.com/v1alpha1', - kind: 'DatabaseInfo', + kind: 'DatabaseConfiguration', request: { source: { ref: { @@ -908,6 +911,7 @@ export const useFunc = (model) => { }, }, ) + databaseInfoResponse = resp?.data?.response || {} configSecrets = resp?.data?.response?.availableSecrets || [] secretConfigData = resp?.data?.response?.configurations || [] } catch (e) { @@ -926,6 +930,11 @@ export const useFunc = (model) => { } } + function getCurrentConfig() { + const currentConfig = databaseInfoResponse?.appliedConfig ?? '' + return currentConfig + } + async function getConfigSecrets(type) { type = type ? type + '/' : '' const secretStatus = getValue(discriminator, `${type}createSecret/status`) @@ -1147,37 +1156,13 @@ export const useFunc = (model) => { if (!selectedConfig) { commit('wizard/model$delete', `/spec/configuration/${type}removeCustomConfig`) - return [{ name: '', content: '' }] + return } commit('wizard/model$update', { path: `/spec/configuration/${type}removeCustomConfig`, value: true, force: true, }) - - const configuration = secretConfigData.find((item) => item.componentName === selectedConfig) - - if (!configuration.data) { - return [{ name: '', content: '' }] - } - - const configObj = [] - Object.keys(configuration.data).forEach((fileName) => { - try { - const decodedString = atob(configuration.data[fileName]) - configObj.push({ - name: fileName, - content: decodedString, - }) - } catch (e) { - console.error(`Error decoding ${fileName}:`, e) - configObj.push({ - name: fileName, - content: configuration.data[fileName], - }) - } - }) - return configObj } async function onNewConfigSecretChange(type) { @@ -1636,8 +1621,8 @@ export const useFunc = (model) => { limits = dbDetails?.spec?.podTemplate?.spec?.containers?.[0]?.resources?.requests || {} } else { limits = - dbDetails?.spec?.topology?.distributed?.[type]?.podTemplate?.spec?.containers?.[0]?.resources?.requests || - {} + dbDetails?.spec?.topology?.distributed?.[type]?.podTemplate?.spec?.containers?.[0] + ?.resources?.requests || {} } const selectedMachine = getValue(discriminator, `/machine-${type}`) @@ -1722,5 +1707,6 @@ export const useFunc = (model) => { onNewConfigSecretChange, onSelectedSecretChange, isTlsEnabled, + getCurrentConfig, } } diff --git a/charts/opskubedbcom-mongodbopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-mongodbopsrequest-editor/ui/create-ui.yaml index 6e024a0025..8754d1994f 100644 --- a/charts/opskubedbcom-mongodbopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-mongodbopsrequest-editor/ui/create-ui.yaml @@ -840,6 +840,7 @@ step: schema: temp/properties/standalone/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange|standalone paths: @@ -994,6 +995,7 @@ step: schema: temp/properties/replicaSet/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange|replicaSet paths: @@ -1150,6 +1152,7 @@ step: schema: temp/properties/configServer/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange|configServer paths: @@ -1302,6 +1305,7 @@ step: schema: temp/properties/mongos/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange|mongos paths: @@ -1454,6 +1458,7 @@ step: schema: temp/properties/shard/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange|shard paths: diff --git a/charts/opskubedbcom-mssqlserveropsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-mssqlserveropsrequest-editor/ui/create-ui.yaml index 215e798348..966d5dc3b0 100644 --- a/charts/opskubedbcom-mssqlserveropsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-mssqlserveropsrequest-editor/ui/create-ui.yaml @@ -326,7 +326,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -432,6 +432,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: diff --git a/charts/opskubedbcom-mysqlopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-mysqlopsrequest-editor/ui/create-ui.yaml index 7a63bda6f2..488609f511 100644 --- a/charts/opskubedbcom-mysqlopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-mysqlopsrequest-editor/ui/create-ui.yaml @@ -301,7 +301,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -407,6 +407,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: diff --git a/charts/opskubedbcom-neo4jopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-neo4jopsrequest-editor/ui/create-ui.yaml index 87fd8a7e42..f49ad7e084 100644 --- a/charts/opskubedbcom-neo4jopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-neo4jopsrequest-editor/ui/create-ui.yaml @@ -261,6 +261,20 @@ step: subtitle: Select a new configuration secret, apply a custom configuration, or remove an existing setup to update your database settings type: label-element + - type: editor + label: Current Configuration + schema: temp/properties/currentConfig + readonly: true + editorHeight: 120px + validateContent: false + if: + name: getCurrentConfig + type: function + loader: + name: getCurrentConfig + watchPaths: + - schema/properties/metadata/properties/namespace + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -366,6 +380,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: @@ -390,15 +405,6 @@ step: refresh: fetchConfigSecrets schema: temp/properties/selectedConfigurationRemove type: select - - editorHeight: 500px - hideFormatButton: true - init: - type: func - value: onRemoveConfigChange - readonly: true - schema: temp/properties/removeConfig - type: multi-file-editor - validateContent: false watcher: func: onRemoveConfigChange paths: diff --git a/charts/opskubedbcom-neo4jopsrequest-editor/ui/functions.js b/charts/opskubedbcom-neo4jopsrequest-editor/ui/functions.js index 1a1f578114..5a1432e715 100644 --- a/charts/opskubedbcom-neo4jopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-neo4jopsrequest-editor/ui/functions.js @@ -904,6 +904,7 @@ export const useFunc = (model) => { let configSecrets = [] let secretConfigData = [] let existingSecrets = [] + let databaseInfoResponse = {} async function fetchConfigSecrets() { const owner = storeGet('/route/params/user') @@ -940,6 +941,7 @@ export const useFunc = (model) => { }, }, ) + databaseInfoResponse = resp?.data?.response || {} configSecrets = resp?.data?.response?.availableSecrets || [] secretConfigData = resp?.data?.response?.configurations || [] } catch (e) { @@ -959,6 +961,11 @@ export const useFunc = (model) => { } } + function getCurrentConfig() { + const currentConfig = databaseInfoResponse?.appliedConfig ?? '' + return currentConfig + } + async function getConfigSecrets(type) { type = type ? type + '/' : '' const secretStatus = getValue(discriminator, `${type}createSecret/status`) @@ -1236,38 +1243,12 @@ export const useFunc = (model) => { if (!selectedConfig) { commit('wizard/model$delete', `/spec/configuration/${type}removeCustomConfig`) - return [{ name: '', content: '' }] + return } commit('wizard/model$update', { path: `/spec/configuration/${type}removeCustomConfig`, value: true, }) - - const configuration = secretConfigData.find((item) => item.componentName === selectedConfig) - - if (!configuration.data) { - return [{ name: '', content: '' }] - } - - const configObj = [] - // Decode base64 and format as array of objects with name and content - Object.keys(configuration.data).forEach((fileName) => { - try { - // Decode base64 string - const decodedString = atob(configuration.data[fileName]) - configObj.push({ - name: fileName, - content: decodedString, - }) - } catch (e) { - console.error(`Error decoding ${fileName}:`, e) - configObj.push({ - name: fileName, - content: configuration.data[fileName], // Fallback to original if decode fails - }) - } - }) - return configObj } async function onNewConfigSecretChange(type) { @@ -1919,6 +1900,7 @@ export const useFunc = (model) => { setConfigFiles, isConfigSelected, fetchConfigSecrets, + getCurrentConfig, getConfigSecretsforAppyConfig, getSelectedConfigurationData, getSelectedConfigurationName, diff --git a/charts/opskubedbcom-oracleopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-oracleopsrequest-editor/ui/create-ui.yaml index 42b895485a..0fdb25071a 100644 --- a/charts/opskubedbcom-oracleopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-oracleopsrequest-editor/ui/create-ui.yaml @@ -288,6 +288,20 @@ step: subtitle: Select a new configuration secret, apply a custom configuration, or remove an existing setup to update your database settings type: label-element + - type: editor + label: Current Configuration + schema: temp/properties/currentConfig + readonly: true + editorHeight: 120px + validateContent: false + if: + name: getCurrentConfig + type: function + loader: + name: getCurrentConfig + watchPaths: + - schema/properties/metadata/properties/namespace + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -393,6 +407,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: @@ -417,15 +432,6 @@ step: refresh: fetchConfigSecrets schema: temp/properties/selectedConfigurationRemove type: select - - editorHeight: 500px - hideFormatButton: true - init: - type: func - value: onRemoveConfigChange - readonly: true - schema: temp/properties/removeConfig - type: multi-file-editor - validateContent: false watcher: func: onRemoveConfigChange paths: @@ -648,4 +654,4 @@ step: type: block-layout loader: getDbDetails type: single-step-form -type: multi-step-form \ No newline at end of file +type: multi-step-form diff --git a/charts/opskubedbcom-oracleopsrequest-editor/ui/functions.js b/charts/opskubedbcom-oracleopsrequest-editor/ui/functions.js index 650215b582..dc7f8d1612 100644 --- a/charts/opskubedbcom-oracleopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-oracleopsrequest-editor/ui/functions.js @@ -905,6 +905,7 @@ export const useFunc = (model) => { let configSecrets = [] let secretConfigData = [] let existingSecrets = [] + let databaseInfoResponse = {} async function fetchConfigSecrets() { const owner = storeGet('/route/params/user') @@ -941,6 +942,7 @@ export const useFunc = (model) => { }, }, ) + databaseInfoResponse = resp?.data?.response || {} configSecrets = resp?.data?.response?.availableSecrets || [] secretConfigData = resp?.data?.response?.configurations || [] } catch (e) { @@ -960,6 +962,11 @@ export const useFunc = (model) => { } } + function getCurrentConfig() { + const currentConfig = databaseInfoResponse?.appliedConfig ?? '' + return currentConfig + } + async function getConfigSecrets(type) { type = type ? type + '/' : '' const secretStatus = getValue(discriminator, `${type}createSecret/status`) @@ -1237,38 +1244,12 @@ export const useFunc = (model) => { if (!selectedConfig) { commit('wizard/model$delete', `/spec/configuration/${type}removeCustomConfig`) - return [{ name: '', content: '' }] + return } commit('wizard/model$update', { path: `/spec/configuration/${type}removeCustomConfig`, value: true, }) - - const configuration = secretConfigData.find((item) => item.componentName === selectedConfig) - - if (!configuration.data) { - return [{ name: '', content: '' }] - } - - const configObj = [] - // Decode base64 and format as array of objects with name and content - Object.keys(configuration.data).forEach((fileName) => { - try { - // Decode base64 string - const decodedString = atob(configuration.data[fileName]) - configObj.push({ - name: fileName, - content: decodedString, - }) - } catch (e) { - console.error(`Error decoding ${fileName}:`, e) - configObj.push({ - name: fileName, - content: configuration.data[fileName], // Fallback to original if decode fails - }) - } - }) - return configObj } async function onNewConfigSecretChange(type) { @@ -1920,6 +1901,7 @@ export const useFunc = (model) => { setConfigFiles, isConfigSelected, fetchConfigSecrets, + getCurrentConfig, getConfigSecretsforAppyConfig, getSelectedConfigurationData, getSelectedConfigurationName, diff --git a/charts/opskubedbcom-perconaxtradbopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-perconaxtradbopsrequest-editor/ui/create-ui.yaml index f49566b431..92aa649ba6 100644 --- a/charts/opskubedbcom-perconaxtradbopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-perconaxtradbopsrequest-editor/ui/create-ui.yaml @@ -303,7 +303,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -409,6 +409,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: diff --git a/charts/opskubedbcom-pgbounceropsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-pgbounceropsrequest-editor/ui/create-ui.yaml index 652b8b7e8e..fb85bd6c6b 100644 --- a/charts/opskubedbcom-pgbounceropsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-pgbounceropsrequest-editor/ui/create-ui.yaml @@ -248,7 +248,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -354,6 +354,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: diff --git a/charts/opskubedbcom-pgpoolopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-pgpoolopsrequest-editor/ui/create-ui.yaml index 175b1aa57b..88f0ecd72e 100644 --- a/charts/opskubedbcom-pgpoolopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-pgpoolopsrequest-editor/ui/create-ui.yaml @@ -251,7 +251,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -357,6 +357,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: diff --git a/charts/opskubedbcom-postgresopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-postgresopsrequest-editor/ui/create-ui.yaml index ef31303328..5d232c3388 100644 --- a/charts/opskubedbcom-postgresopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-postgresopsrequest-editor/ui/create-ui.yaml @@ -305,7 +305,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -411,6 +411,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: diff --git a/charts/opskubedbcom-qdrantopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-qdrantopsrequest-editor/ui/create-ui.yaml index e2f30afca0..1567cfd0a8 100644 --- a/charts/opskubedbcom-qdrantopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-qdrantopsrequest-editor/ui/create-ui.yaml @@ -261,6 +261,20 @@ step: subtitle: Select a new configuration secret, apply a custom configuration, or remove an existing setup to update your database settings type: label-element + - type: editor + label: Current Configuration + schema: temp/properties/currentConfig + readonly: true + editorHeight: 120px + validateContent: false + if: + name: getCurrentConfig + type: function + loader: + name: getCurrentConfig + watchPaths: + - schema/properties/metadata/properties/namespace + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -366,6 +380,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: @@ -390,15 +405,6 @@ step: refresh: fetchConfigSecrets schema: temp/properties/selectedConfigurationRemove type: select - - editorHeight: 500px - hideFormatButton: true - init: - type: func - value: onRemoveConfigChange - readonly: true - schema: temp/properties/removeConfig - type: multi-file-editor - validateContent: false watcher: func: onRemoveConfigChange paths: diff --git a/charts/opskubedbcom-qdrantopsrequest-editor/ui/functions.js b/charts/opskubedbcom-qdrantopsrequest-editor/ui/functions.js index 6a84dd3a2a..571cae4e2a 100644 --- a/charts/opskubedbcom-qdrantopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-qdrantopsrequest-editor/ui/functions.js @@ -905,6 +905,7 @@ export const useFunc = (model) => { let configSecrets = [] let secretConfigData = [] let existingSecrets = [] + let databaseInfoResponse = {} async function fetchConfigSecrets() { const owner = storeGet('/route/params/user') @@ -941,6 +942,7 @@ export const useFunc = (model) => { }, }, ) + databaseInfoResponse = resp?.data?.response || {} configSecrets = resp?.data?.response?.availableSecrets || [] secretConfigData = resp?.data?.response?.configurations || [] } catch (e) { @@ -960,6 +962,11 @@ export const useFunc = (model) => { } } + function getCurrentConfig() { + const currentConfig = databaseInfoResponse?.appliedConfig ?? '' + return currentConfig + } + async function getConfigSecrets(type) { type = type ? type + '/' : '' const secretStatus = getValue(discriminator, `${type}createSecret/status`) @@ -1237,38 +1244,12 @@ export const useFunc = (model) => { if (!selectedConfig) { commit('wizard/model$delete', `/spec/configuration/${type}removeCustomConfig`) - return [{ name: '', content: '' }] + return } commit('wizard/model$update', { path: `/spec/configuration/${type}removeCustomConfig`, value: true, }) - - const configuration = secretConfigData.find((item) => item.componentName === selectedConfig) - - if (!configuration.data) { - return [{ name: '', content: '' }] - } - - const configObj = [] - // Decode base64 and format as array of objects with name and content - Object.keys(configuration.data).forEach((fileName) => { - try { - // Decode base64 string - const decodedString = atob(configuration.data[fileName]) - configObj.push({ - name: fileName, - content: decodedString, - }) - } catch (e) { - console.error(`Error decoding ${fileName}:`, e) - configObj.push({ - name: fileName, - content: configuration.data[fileName], // Fallback to original if decode fails - }) - } - }) - return configObj } async function onNewConfigSecretChange(type) { @@ -1919,6 +1900,7 @@ export const useFunc = (model) => { setConfigFiles, isConfigSelected, fetchConfigSecrets, + getCurrentConfig, getConfigSecretsforAppyConfig, getSelectedConfigurationData, getSelectedConfigurationName, diff --git a/charts/opskubedbcom-rabbitmqopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-rabbitmqopsrequest-editor/ui/create-ui.yaml index 97ee876e97..abcd4072c9 100644 --- a/charts/opskubedbcom-rabbitmqopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-rabbitmqopsrequest-editor/ui/create-ui.yaml @@ -280,7 +280,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -386,6 +386,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: diff --git a/charts/opskubedbcom-redisopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-redisopsrequest-editor/ui/create-ui.yaml index 5e5d34182d..9444207264 100644 --- a/charts/opskubedbcom-redisopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-redisopsrequest-editor/ui/create-ui.yaml @@ -306,7 +306,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -412,6 +412,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: diff --git a/charts/opskubedbcom-singlestoreopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-singlestoreopsrequest-editor/ui/create-ui.yaml index 9207b1c52f..a0c0bd9a4d 100644 --- a/charts/opskubedbcom-singlestoreopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-singlestoreopsrequest-editor/ui/create-ui.yaml @@ -524,7 +524,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -630,6 +630,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: @@ -787,6 +788,7 @@ step: schema: temp/properties/aggregator/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange|aggregator paths: @@ -950,6 +952,7 @@ step: schema: temp/properties/leaf/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange|leaf paths: diff --git a/charts/opskubedbcom-solropsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-solropsrequest-editor/ui/create-ui.yaml index 55a38e3320..69e25f0f07 100644 --- a/charts/opskubedbcom-solropsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-solropsrequest-editor/ui/create-ui.yaml @@ -643,7 +643,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/node/properties/createSecret/properties/status - elements: - elements: - elements: @@ -750,6 +750,7 @@ step: schema: temp/properties/node/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange|node paths: @@ -905,6 +906,7 @@ step: schema: temp/properties/coordinator/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange|coordinator paths: @@ -1057,6 +1059,7 @@ step: schema: temp/properties/data/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange|data paths: @@ -1209,6 +1212,7 @@ step: schema: temp/properties/overseer/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange|overseer paths: diff --git a/charts/opskubedbcom-weaviateopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-weaviateopsrequest-editor/ui/create-ui.yaml index 7520b5c445..aee87b3d15 100644 --- a/charts/opskubedbcom-weaviateopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-weaviateopsrequest-editor/ui/create-ui.yaml @@ -261,6 +261,20 @@ step: subtitle: Select a new configuration secret, apply a custom configuration, or remove an existing setup to update your database settings type: label-element + - type: editor + label: Current Configuration + schema: temp/properties/currentConfig + readonly: true + editorHeight: 120px + validateContent: false + if: + name: getCurrentConfig + type: function + loader: + name: getCurrentConfig + watchPaths: + - schema/properties/metadata/properties/namespace + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -366,6 +380,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: @@ -390,15 +405,6 @@ step: refresh: fetchConfigSecrets schema: temp/properties/selectedConfigurationRemove type: select - - editorHeight: 500px - hideFormatButton: true - init: - type: func - value: onRemoveConfigChange - readonly: true - schema: temp/properties/removeConfig - type: multi-file-editor - validateContent: false watcher: func: onRemoveConfigChange paths: diff --git a/charts/opskubedbcom-weaviateopsrequest-editor/ui/functions.js b/charts/opskubedbcom-weaviateopsrequest-editor/ui/functions.js index a61ccc41ea..fe41e9e7f9 100644 --- a/charts/opskubedbcom-weaviateopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-weaviateopsrequest-editor/ui/functions.js @@ -906,6 +906,7 @@ export const useFunc = (model) => { let configSecrets = [] let secretConfigData = [] let existingSecrets = [] + let databaseInfoResponse = {} async function fetchConfigSecrets() { const owner = storeGet('/route/params/user') @@ -942,6 +943,7 @@ export const useFunc = (model) => { }, }, ) + databaseInfoResponse = resp?.data?.response || {} configSecrets = resp?.data?.response?.availableSecrets || [] secretConfigData = resp?.data?.response?.configurations || [] } catch (e) { @@ -961,6 +963,11 @@ export const useFunc = (model) => { } } + function getCurrentConfig() { + const currentConfig = databaseInfoResponse?.appliedConfig ?? '' + return currentConfig + } + async function getConfigSecrets(type) { type = type ? type + '/' : '' const secretStatus = getValue(discriminator, `${type}createSecret/status`) @@ -1238,38 +1245,12 @@ export const useFunc = (model) => { if (!selectedConfig) { commit('wizard/model$delete', `/spec/configuration/${type}removeCustomConfig`) - return [{ name: '', content: '' }] + return } commit('wizard/model$update', { path: `/spec/configuration/${type}removeCustomConfig`, value: true, }) - - const configuration = secretConfigData.find((item) => item.componentName === selectedConfig) - - if (!configuration.data) { - return [{ name: '', content: '' }] - } - - const configObj = [] - // Decode base64 and format as array of objects with name and content - Object.keys(configuration.data).forEach((fileName) => { - try { - // Decode base64 string - const decodedString = atob(configuration.data[fileName]) - configObj.push({ - name: fileName, - content: decodedString, - }) - } catch (e) { - console.error(`Error decoding ${fileName}:`, e) - configObj.push({ - name: fileName, - content: configuration.data[fileName], // Fallback to original if decode fails - }) - } - }) - return configObj } async function onNewConfigSecretChange(type) { @@ -1927,6 +1908,7 @@ export const useFunc = (model) => { setConfigFiles, isConfigSelected, fetchConfigSecrets, + getCurrentConfig, getConfigSecretsforAppyConfig, getSelectedConfigurationData, getSelectedConfigurationName, diff --git a/charts/opskubedbcom-zookeeperopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-zookeeperopsrequest-editor/ui/create-ui.yaml index 9256e9dbf2..2faa3dcb0d 100644 --- a/charts/opskubedbcom-zookeeperopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-zookeeperopsrequest-editor/ui/create-ui.yaml @@ -293,7 +293,7 @@ step: name: getCurrentConfig watchPaths: - schema/properties/metadata/properties/namespace - - temp/properties/standalone/properties/createSecret/properties/status + - temp/properties/createSecret/properties/status - elements: - elements: - customClass: mb-15 @@ -399,6 +399,7 @@ step: schema: temp/properties/applyConfig type: multi-file-editor validateContent: false + placeholder: Add config parameters... watcher: func: onApplyconfigChange paths: diff --git a/schemas/ui-schema.json b/schemas/ui-schema.json index f98fa2b848..1d18ca2da0 100644 --- a/schemas/ui-schema.json +++ b/schemas/ui-schema.json @@ -165,6 +165,9 @@ "editorHeight": { "type": "string" }, + "emptyMessage": { + "type": "string" + }, "forceRequired": { "type": "boolean" }, @@ -244,6 +247,9 @@ "options": { "$ref": "#/definitions/Options" }, + "placeholder": { + "type": "string" + }, "readonly": { "type": "boolean" }, @@ -774,6 +780,9 @@ "loader": { "$ref": "#/definitions/LoaderType" }, + "placeholder": { + "type": "string" + }, "readonly": { "type": "boolean" }, @@ -1187,6 +1196,9 @@ "editorHeight": { "type": "string" }, + "emptyMessage": { + "type": "string" + }, "hideCopyButton": { "type": "boolean" }, @@ -1205,6 +1217,9 @@ "loader": { "$ref": "#/definitions/LoaderType" }, + "placeholder": { + "type": "string" + }, "readonly": { "type": "boolean" },