From 5c4b4e156aaf20cbd4aeb37dc2d5485cea56461a Mon Sep 17 00:00:00 2001 From: shofiq Date: Tue, 3 Feb 2026 15:48:53 +0600 Subject: [PATCH 1/4] add disable watcher support in db create page Signed-off-by: shofiq --- .../ui/create-ui.yaml | 14 +- .../ui/functions.js | 13 +- .../ui/create-ui.yaml | 26 ++- .../ui/functions.js | 13 +- .../ui/create-ui.yaml | 64 +++--- .../ui/functions.js | 13 +- .../ui/create-ui.yaml | 61 +++--- .../ui/functions.js | 13 +- .../ui/create-ui.yaml | 48 ++--- .../ui/functions.js | 13 +- .../ui/create-ui.yaml | 20 +- .../ui/functions.js | 13 +- .../ui/create-ui.yaml | 14 +- .../ui/functions.js | 13 +- .../ui/create-ui.yaml | 48 ++--- .../ui/functions.js | 13 +- .../ui/create-ui.yaml | 22 +- .../ui/functions.js | 24 +-- .../ui/create-ui.yaml | 14 +- .../ui/functions.js | 24 +-- .../ui/create-ui.yaml | 91 ++++---- .../ui/functions.js | 16 +- .../ui/create-ui.yaml | 22 +- .../ui/functions.js | 24 +-- .../ui/create-ui.yaml | 22 +- .../ui/functions.js | 24 +-- .../ui/create-ui.yaml | 26 ++- .../ui/functions.js | 60 ++++-- .../ui/create-ui.yaml | 16 +- .../ui/functions.js | 24 +-- .../ui/create-ui.yaml | 16 +- .../ui/functions.js | 35 +--- .../ui/create-ui.yaml | 16 +- .../ui/functions.js | 24 +-- .../ui/create-ui.yaml | 22 +- .../ui/functions.js | 13 +- .../ui/create-ui.yaml | 16 +- .../ui/functions.js | 24 +-- .../ui/create-ui.yaml | 16 +- .../ui/functions.js | 24 +-- .../ui/create-ui.yaml | 16 +- .../ui/functions.js | 29 +-- .../ui/create-ui.yaml | 48 ++--- .../ui/functions.js | 13 +- .../ui/create-ui.yaml | 65 +++--- .../ui/functions.js | 13 +- .../ui/create-ui.yaml | 16 +- .../ui/functions.js | 24 +-- schemas/ui-schema.json | 198 ++++++++++++++++-- 49 files changed, 746 insertions(+), 690 deletions(-) diff --git a/charts/kubedbcom-cassandra-editor-options/ui/create-ui.yaml b/charts/kubedbcom-cassandra-editor-options/ui/create-ui.yaml index 694bbc156c..c9fbfc89a4 100644 --- a/charts/kubedbcom-cassandra-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-cassandra-editor-options/ui/create-ui.yaml @@ -48,9 +48,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -62,9 +63,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory diff --git a/charts/kubedbcom-cassandra-editor-options/ui/functions.js b/charts/kubedbcom-cassandra-editor-options/ui/functions.js index 2c5ffe3146..404e1ac120 100644 --- a/charts/kubedbcom-cassandra-editor-options/ui/functions.js +++ b/charts/kubedbcom-cassandra-editor-options/ui/functions.js @@ -431,10 +431,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function setLimits(resource, type) { @@ -506,7 +503,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -515,9 +512,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` diff --git a/charts/kubedbcom-clickhouse-editor-options/ui/create-ui.yaml b/charts/kubedbcom-clickhouse-editor-options/ui/create-ui.yaml index b17aa39b68..9972e1b633 100644 --- a/charts/kubedbcom-clickhouse-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-clickhouse-editor-options/ui/create-ui.yaml @@ -65,10 +65,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -81,10 +81,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory @@ -166,7 +166,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/topology/properties/clickHouseKeeper/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|topology/clickHouseKeeper/spec + - disable: + name: isMachineNotCustom|topology/clickHouseKeeper/spec + watchPaths: + - schema/properties/spec/properties/topology/properties/clickHouseKeeper/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu|topology/clickHouseKeeper/spec @@ -179,7 +182,10 @@ step: paths: - schema/properties/spec/properties/topology/properties/clickHouseKeeper/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/topology/properties/clickHouseKeeper/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom|topology/clickHouseKeeper/spec + - disable: + name: isMachineNotCustom|topology/clickHouseKeeper/spec + watchPaths: + - schema/properties/spec/properties/topology/properties/clickHouseKeeper/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory|topology/clickHouseKeeper/spec diff --git a/charts/kubedbcom-clickhouse-editor-options/ui/functions.js b/charts/kubedbcom-clickhouse-editor-options/ui/functions.js index ec85c9985d..bcb9ec7912 100644 --- a/charts/kubedbcom-clickhouse-editor-options/ui/functions.js +++ b/charts/kubedbcom-clickhouse-editor-options/ui/functions.js @@ -534,7 +534,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -543,9 +543,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -1169,10 +1169,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } async function getNamespaces() { diff --git a/charts/kubedbcom-druid-editor-options/ui/create-ui.yaml b/charts/kubedbcom-druid-editor-options/ui/create-ui.yaml index 55f123daf7..2c8a0119c2 100644 --- a/charts/kubedbcom-druid-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-druid-editor-options/ui/create-ui.yaml @@ -37,10 +37,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/topology/properties/middleManagers/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|topology/middleManagers - if: - name: isMachineCustom|topology/middleManagers - type: function + - disable: + name: isMachineNotCustom|topology/middleManagers + watchPaths: + - schema/properties/spec/properties/topology/properties/middleManagers/properties/podResources/properties/machine init: type: func value: setLimits|cpu|topology/middleManagers @@ -53,10 +53,10 @@ step: paths: - schema/properties/spec/properties/topology/properties/middleManagers/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/topology/properties/middleManagers/properties/podResources/properties/machine - - disable: isMachineNotCustom|topology/middleManagers - if: - name: isMachineCustom|topology/middleManagers - type: function + - disable: + name: isMachineNotCustom|topology/middleManagers + watchPaths: + - schema/properties/spec/properties/topology/properties/middleManagers/properties/podResources/properties/machine init: type: func value: setLimits|memory|topology/middleManagers @@ -97,10 +97,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/topology/properties/historicals/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|topology/historicals - if: - name: isMachineCustom|topology/historicals - type: function + - disable: + name: isMachineNotCustom|topology/historicals + watchPaths: + - schema/properties/spec/properties/topology/properties/historicals/properties/podResources/properties/machine init: type: func value: setLimits|cpu|topology/historicals @@ -113,10 +113,10 @@ step: paths: - schema/properties/spec/properties/topology/properties/historicals/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/topology/properties/historicals/properties/podResources/properties/machine - - disable: isMachineNotCustom|topology/historicals - if: - name: isMachineCustom|topology/historicals - type: function + - disable: + name: isMachineNotCustom|topology/historicals + watchPaths: + - schema/properties/spec/properties/topology/properties/historicals/properties/podResources/properties/machine init: type: func value: setLimits|memory|topology/historicals @@ -151,10 +151,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/topology/properties/brokers/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|topology/brokers - if: - name: isMachineCustom|topology/brokers - type: function + - disable: + name: isMachineNotCustom|topology/brokers + watchPaths: + - schema/properties/spec/properties/topology/properties/brokers/properties/podResources/properties/machine init: type: func value: setLimits|cpu|topology/brokers @@ -167,10 +167,10 @@ step: paths: - schema/properties/spec/properties/topology/properties/brokers/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/topology/properties/brokers/properties/podResources/properties/machine - - disable: isMachineNotCustom|topology/brokers - if: - name: isMachineCustom|topology/brokers - type: function + - disable: + name: isMachineNotCustom|topology/brokers + watchPaths: + - schema/properties/spec/properties/topology/properties/brokers/properties/podResources/properties/machine init: type: func value: setLimits|memory|topology/brokers @@ -205,10 +205,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/topology/properties/coordinators/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|topology/coordinators - if: - name: isMachineCustom|topology/coordinators - type: function + - disable: + name: isMachineNotCustom|topology/coordinators + watchPaths: + - schema/properties/spec/properties/topology/properties/coordinators/properties/podResources/properties/machine init: type: func value: setLimits|cpu|topology/coordinators @@ -221,10 +221,10 @@ step: paths: - schema/properties/spec/properties/topology/properties/coordinators/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/topology/properties/coordinators/properties/podResources/properties/machine - - disable: isMachineNotCustom|topology/coordinators - if: - name: isMachineCustom|topology/coordinators - type: function + - disable: + name: isMachineNotCustom|topology/coordinators + watchPaths: + - schema/properties/spec/properties/topology/properties/coordinators/properties/podResources/properties/machine init: type: func value: setLimits|memory|topology/coordinators diff --git a/charts/kubedbcom-druid-editor-options/ui/functions.js b/charts/kubedbcom-druid-editor-options/ui/functions.js index 7103b9ce2d..413ec214b9 100644 --- a/charts/kubedbcom-druid-editor-options/ui/functions.js +++ b/charts/kubedbcom-druid-editor-options/ui/functions.js @@ -507,7 +507,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -516,9 +516,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -566,10 +566,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function updateAlertValue() { diff --git a/charts/kubedbcom-elasticsearch-editor-options/ui/create-ui.yaml b/charts/kubedbcom-elasticsearch-editor-options/ui/create-ui.yaml index a3bd63d712..1f02d3a7c6 100644 --- a/charts/kubedbcom-elasticsearch-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-elasticsearch-editor-options/ui/create-ui.yaml @@ -56,10 +56,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/topology/properties/master/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|topology/master - if: - name: isMachineCustom|topology/master - type: function + - disable: + name: isMachineNotCustom|topology/master + watchPaths: + - schema/properties/spec/properties/topology/properties/master/properties/podResources/properties/machine init: type: func value: setLimits|cpu|topology/master @@ -72,10 +72,10 @@ step: paths: - schema/properties/spec/properties/topology/properties/master/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/topology/properties/master/properties/podResources/properties/machine - - disable: isMachineNotCustom|topology/master - if: - name: isMachineCustom|topology/master - type: function + - disable: + name: isMachineNotCustom|topology/master + watchPaths: + - schema/properties/spec/properties/topology/properties/master/properties/podResources/properties/machine init: type: func value: setLimits|memory|topology/master @@ -116,10 +116,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/topology/properties/data/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|topology/data - if: - name: isMachineCustom|topology/data - type: function + - disable: + name: isMachineNotCustom|topology/data + watchPaths: + - schema/properties/spec/properties/topology/properties/data/properties/podResources/properties/machine init: type: func value: setLimits|cpu|topology/data @@ -132,10 +132,10 @@ step: paths: - schema/properties/spec/properties/topology/properties/data/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/topology/properties/data/properties/podResources/properties/machine - - disable: isMachineNotCustom|topology/data - if: - name: isMachineCustom|topology/data - type: function + - disable: + name: isMachineNotCustom|topology/data + watchPaths: + - schema/properties/spec/properties/topology/properties/data/properties/podResources/properties/machine init: type: func value: setLimits|memory|topology/data @@ -176,10 +176,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/topology/properties/ingest/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|topology/ingest - if: - name: isMachineCustom|topology/ingest - type: function + - disable: + name: isMachineNotCustom|topology/ingest + watchPaths: + - schema/properties/spec/properties/topology/properties/ingest/properties/podResources/properties/machine init: type: func value: setLimits|cpu|topology/ingest @@ -192,10 +192,10 @@ step: paths: - schema/properties/spec/properties/topology/properties/ingest/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/topology/properties/ingest/properties/podResources/properties/machine - - disable: isMachineNotCustom|topology/ingest - if: - name: isMachineCustom|topology/ingest - type: function + - disable: + name: isMachineNotCustom|topology/ingest + watchPaths: + - schema/properties/spec/properties/topology/properties/ingest/properties/podResources/properties/machine init: type: func value: setLimits|memory|topology/ingest @@ -231,10 +231,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -247,7 +247,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom|schema/properties/spec/properties/podResources/properties/machine + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory diff --git a/charts/kubedbcom-elasticsearch-editor-options/ui/functions.js b/charts/kubedbcom-elasticsearch-editor-options/ui/functions.js index 1809b653d0..d6f2d6adc2 100644 --- a/charts/kubedbcom-elasticsearch-editor-options/ui/functions.js +++ b/charts/kubedbcom-elasticsearch-editor-options/ui/functions.js @@ -930,7 +930,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -939,9 +939,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -984,10 +984,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function notEqualToDatabaseMode(mode) { diff --git a/charts/kubedbcom-ferretdb-editor-options/ui/create-ui.yaml b/charts/kubedbcom-ferretdb-editor-options/ui/create-ui.yaml index 6e7e30d0f3..82263a092d 100644 --- a/charts/kubedbcom-ferretdb-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-ferretdb-editor-options/ui/create-ui.yaml @@ -45,10 +45,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/server/properties/primary/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|server/primary - if: - name: isMachineCustom|server/primary - type: function + - disable: + name: isMachineNotCustom|server/primary + watchPaths: + - schema/properties/spec/properties/server/properties/primary/properties/podResources/properties/machine init: type: func value: setLimits|cpu|server/primary @@ -61,10 +61,10 @@ step: paths: - schema/properties/spec/properties/server/properties/primary/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/server/properties/primary/properties/podResources/properties/machine - - disable: isMachineNotCustom|server/primary - if: - name: isMachineCustom|server/primary - type: function + - disable: + name: isMachineNotCustom|server/primary + watchPaths: + - schema/properties/spec/properties/server/properties/primary/properties/podResources/properties/machine init: type: func value: setLimits|memory|server/primary @@ -99,10 +99,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/server/properties/secondary/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|server/secondary - if: - name: isMachineCustom|server/secondary - type: function + - disable: + name: isMachineNotCustom|server/secondary + watchPaths: + - schema/properties/spec/properties/server/properties/secondary/properties/podResources/properties/machine init: type: func value: setLimits|cpu|server/secondary @@ -115,10 +115,10 @@ step: paths: - schema/properties/spec/properties/server/properties/secondary/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/server/properties/secondary/properties/podResources/properties/machine - - disable: isMachineNotCustom|server/secondary - if: - name: isMachineCustom|server/secondary - type: function + - disable: + name: isMachineNotCustom|server/secondary + watchPaths: + - schema/properties/spec/properties/server/properties/secondary/properties/podResources/properties/machine init: type: func value: setLimits|memory|server/secondary @@ -167,10 +167,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/backend/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|backend - if: - name: isMachineCustom|backend - type: function + - disable: + name: isMachineNotCustom|backend + watchPaths: + - schema/properties/spec/properties/backend/properties/podResources/properties/machine init: type: func value: setLimits|cpu|backend @@ -183,10 +183,10 @@ step: paths: - schema/properties/spec/properties/backend/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/backend/properties/podResources/properties/machine - - disable: isMachineNotCustom|backend - if: - name: isMachineCustom|backend - type: function + - disable: + name: isMachineNotCustom|backend + watchPaths: + - schema/properties/spec/properties/backend/properties/podResources/properties/machine init: type: func value: setLimits|memory|backend diff --git a/charts/kubedbcom-ferretdb-editor-options/ui/functions.js b/charts/kubedbcom-ferretdb-editor-options/ui/functions.js index 24a4e17779..770ef8b6e9 100644 --- a/charts/kubedbcom-ferretdb-editor-options/ui/functions.js +++ b/charts/kubedbcom-ferretdb-editor-options/ui/functions.js @@ -445,7 +445,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -454,9 +454,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -993,10 +993,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function onAuthChange() { diff --git a/charts/kubedbcom-hazelcast-editor-options/ui/create-ui.yaml b/charts/kubedbcom-hazelcast-editor-options/ui/create-ui.yaml index 112bcefced..69f12ff2ff 100644 --- a/charts/kubedbcom-hazelcast-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-hazelcast-editor-options/ui/create-ui.yaml @@ -48,9 +48,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -62,9 +63,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory @@ -252,7 +254,11 @@ step: paths: - temp/backup - elements: - - disable: showArchiverAlert + - disable: + name: showArchiverAlert + watchPaths: + - schema/spec/admin/storageClasses/default + - schema/spec/mode label: Enable Archiver? schema: schema/properties/spec/properties/admin/properties/archiver/properties/enable/properties/default type: switch diff --git a/charts/kubedbcom-hazelcast-editor-options/ui/functions.js b/charts/kubedbcom-hazelcast-editor-options/ui/functions.js index 9a4ad81b48..a15195aebf 100644 --- a/charts/kubedbcom-hazelcast-editor-options/ui/functions.js +++ b/charts/kubedbcom-hazelcast-editor-options/ui/functions.js @@ -1107,10 +1107,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } async function getNamespaces() { @@ -1246,7 +1243,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -1255,9 +1252,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` diff --git a/charts/kubedbcom-ignite-editor-options/ui/create-ui.yaml b/charts/kubedbcom-ignite-editor-options/ui/create-ui.yaml index 9bc24a4dd6..8066ce5dd4 100644 --- a/charts/kubedbcom-ignite-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-ignite-editor-options/ui/create-ui.yaml @@ -48,9 +48,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -62,9 +63,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory diff --git a/charts/kubedbcom-ignite-editor-options/ui/functions.js b/charts/kubedbcom-ignite-editor-options/ui/functions.js index af857d89c2..12d702e477 100644 --- a/charts/kubedbcom-ignite-editor-options/ui/functions.js +++ b/charts/kubedbcom-ignite-editor-options/ui/functions.js @@ -1098,10 +1098,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } async function getNamespaces() { @@ -1237,7 +1234,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -1246,9 +1243,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` diff --git a/charts/kubedbcom-kafka-editor-options/ui/create-ui.yaml b/charts/kubedbcom-kafka-editor-options/ui/create-ui.yaml index 9a3607aec4..aa7f445242 100644 --- a/charts/kubedbcom-kafka-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-kafka-editor-options/ui/create-ui.yaml @@ -57,10 +57,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/topology/properties/controller/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|topology/controller - if: - name: isMachineCustom|topology/controller - type: function + - disable: + name: isMachineNotCustom|topology/controller + watchPaths: + - schema/properties/spec/properties/topology/properties/controller/properties/podResources/properties/machine init: type: func value: setLimits|cpu|topology/controller @@ -73,10 +73,10 @@ step: paths: - schema/properties/spec/properties/topology/properties/controller/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/topology/properties/controller/properties/podResources/properties/machine - - disable: isMachineNotCustom|topology/controller - if: - name: isMachineCustom|topology/controller - type: function + - disable: + name: isMachineNotCustom|topology/controller + watchPaths: + - schema/properties/spec/properties/topology/properties/controller/properties/podResources/properties/machine init: type: func value: setLimits|memory|topology/controller @@ -117,10 +117,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/topology/properties/broker/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|topology/broker - if: - name: isMachineCustom|topology/broker - type: function + - disable: + name: isMachineNotCustom|topology/broker + watchPaths: + - schema/properties/spec/properties/topology/properties/broker/properties/podResources/properties/machine init: type: func value: setLimits|cpu|topology/broker @@ -133,10 +133,10 @@ step: paths: - schema/properties/spec/properties/topology/properties/broker/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/topology/properties/broker/properties/podResources/properties/machine - - disable: isMachineNotCustom|topology/broker - if: - name: isMachineCustom|topology/broker - type: function + - disable: + name: isMachineNotCustom|topology/broker + watchPaths: + - schema/properties/spec/properties/topology/properties/broker/properties/podResources/properties/machine init: type: func value: setLimits|memory|topology/broker @@ -172,10 +172,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -188,10 +188,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory diff --git a/charts/kubedbcom-kafka-editor-options/ui/functions.js b/charts/kubedbcom-kafka-editor-options/ui/functions.js index d0d556d625..793065adf2 100644 --- a/charts/kubedbcom-kafka-editor-options/ui/functions.js +++ b/charts/kubedbcom-kafka-editor-options/ui/functions.js @@ -444,7 +444,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -453,9 +453,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -891,10 +891,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function notEqualToDatabaseMode(mode) { diff --git a/charts/kubedbcom-mariadb-editor-options/ui/create-ui.yaml b/charts/kubedbcom-mariadb-editor-options/ui/create-ui.yaml index bd7a713bc5..4b731d14cb 100644 --- a/charts/kubedbcom-mariadb-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-mariadb-editor-options/ui/create-ui.yaml @@ -44,10 +44,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -60,10 +60,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory @@ -336,7 +336,11 @@ step: paths: - temp/backup - elements: - - disable: showArchiverAlert + - disable: + name: showArchiverAlert + watchPaths: + - schema/spec/admin/storageClasses/default + - schema/spec/mode label: Enable Archiver? schema: schema/properties/spec/properties/admin/properties/archiver/properties/enable/properties/default type: switch diff --git a/charts/kubedbcom-mariadb-editor-options/ui/functions.js b/charts/kubedbcom-mariadb-editor-options/ui/functions.js index 9e7dc5ac10..efb39542d5 100644 --- a/charts/kubedbcom-mariadb-editor-options/ui/functions.js +++ b/charts/kubedbcom-mariadb-editor-options/ui/functions.js @@ -488,7 +488,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -497,9 +497,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -534,17 +534,6 @@ export const useFunc = (model) => { return cpuMemoryValue } - function setRequests(resource) { - const modelPath = `/spec/podResources/resources/requests/${resource}` - const val = getValue(model, modelPath) - commitPath = `/spec/podResources/resources/limits/${resource}` - commit('wizard/model$update', { - path: commitPath, - value: val, - force: true, - }) - } - function setMachineToCustom() { const machine = getValue(model, '/spec/admin/machineProfiles/default') return machine || 'custom' @@ -558,10 +547,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function updateAlertValue() { diff --git a/charts/kubedbcom-memcached-editor-options/ui/create-ui.yaml b/charts/kubedbcom-memcached-editor-options/ui/create-ui.yaml index e410b6614d..f5a61e9768 100644 --- a/charts/kubedbcom-memcached-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-memcached-editor-options/ui/create-ui.yaml @@ -44,9 +44,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -58,9 +59,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory diff --git a/charts/kubedbcom-memcached-editor-options/ui/functions.js b/charts/kubedbcom-memcached-editor-options/ui/functions.js index 6cd99ec320..c362495873 100644 --- a/charts/kubedbcom-memcached-editor-options/ui/functions.js +++ b/charts/kubedbcom-memcached-editor-options/ui/functions.js @@ -550,7 +550,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -559,9 +559,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -596,17 +596,6 @@ export const useFunc = (model) => { return cpuMemoryValue } - function setRequests(resource) { - const modelPath = `/spec/podResources/resources/requests/${resource}` - const val = getValue(model, modelPath) - commitPath = `/spec/podResources/resources/limits/${resource}` - commit('wizard/model$update', { - path: commitPath, - value: val, - force: true, - }) - } - function setMachineToCustom() { const machine = getValue(model, '/spec/admin/machineProfiles/default') return machine || 'custom' @@ -620,10 +609,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function getCreateNameSpaceUrl() { diff --git a/charts/kubedbcom-mongodb-editor-options/ui/create-ui.yaml b/charts/kubedbcom-mongodb-editor-options/ui/create-ui.yaml index 2ad0ca6fed..df368c2a70 100644 --- a/charts/kubedbcom-mongodb-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-mongodb-editor-options/ui/create-ui.yaml @@ -104,9 +104,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/shardTopology/properties/shard/properties/podResources/properties/machine type: select - - if: - name: isMachineCustom|shardTopology/shard - type: function + - disable: + name: isMachineNotCustom|shardTopology/shard + watchPaths: + - schema/properties/spec/properties/shardTopology/properties/shard/properties/podResources/properties/machine init: type: func value: setLimits|cpu|shardTopology/shard @@ -118,9 +119,10 @@ step: paths: - schema/properties/spec/properties/shardTopology/properties/shard/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/shardTopology/properties/shard/properties/podResources/properties/machine - - if: - name: isMachineCustom|shardTopology/shard - type: function + - disable: + name: isMachineNotCustom|shardTopology/shard + watchPaths: + - schema/properties/spec/properties/shardTopology/properties/shard/properties/podResources/properties/machine init: type: func value: setLimits|memory|shardTopology/shard @@ -162,9 +164,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/shardTopology/properties/configServer/properties/podResources/properties/machine type: select - - if: - name: isMachineCustom|shardTopology/configServer - type: function + - disable: + name: isMachineNotCustom|shardTopology/configServer + watchPaths: + - schema/properties/spec/properties/shardTopology/properties/configServer/properties/podResources/properties/machine init: type: func value: setLimits|cpu|shardTopology/configServer @@ -176,9 +179,10 @@ step: paths: - schema/properties/spec/properties/shardTopology/properties/configServer/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/shardTopology/properties/configServer/properties/podResources/properties/machine - - if: - name: isMachineCustom|shardTopology/configServer - type: function + - disable: + name: isMachineNotCustom|shardTopology/configServer + watchPaths: + - schema/properties/spec/properties/shardTopology/properties/configServer/properties/podResources/properties/machine init: type: func value: setLimits|memory|shardTopology/configServer @@ -214,9 +218,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/shardTopology/properties/mongos/properties/podResources/properties/machine type: select - - if: - name: isMachineCustom|shardTopology/mongos - type: function + - disable: + name: isMachineNotCustom|shardTopology/mongos + watchPaths: + - schema/properties/spec/properties/shardTopology/properties/mongos/properties/podResources/properties/machine init: type: func value: setLimits|cpu|shardTopology/mongos @@ -228,9 +233,10 @@ step: paths: - schema/properties/spec/properties/shardTopology/properties/mongos/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/shardTopology/properties/mongos/properties/podResources/properties/machine - - if: - name: isMachineCustom|shardTopology/mongos - type: function + - disable: + name: isMachineNotCustom|shardTopology/mongos + watchPaths: + - schema/properties/spec/properties/shardTopology/properties/mongos/properties/podResources/properties/machine init: type: func value: setLimits|memory|shardTopology/mongos @@ -265,10 +271,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|schema/properties/spec/properties/podResources/properties/machine - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -280,9 +286,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory @@ -434,9 +441,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/arbiter/properties/podResources/properties/machine type: select - - if: - name: isMachineCustom|arbiter - type: function + - disable: + name: isMachineNotCustom|arbiter + watchPaths: + - schema/properties/spec/properties/arbiter/properties/podResources/properties/machine init: type: func value: setLimits|cpu|arbiter @@ -448,9 +456,10 @@ step: paths: - schema/properties/spec/properties/arbiter/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/arbiter/properties/podResources/properties/machine - - if: - name: isMachineCustom|arbiter - type: function + - disable: + name: isMachineNotCustom|arbiter + watchPaths: + - schema/properties/spec/properties/arbiter/properties/podResources/properties/machine init: type: func value: setLimits|memory|arbiter @@ -499,9 +508,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/hidden/properties/podResources/properties/machine type: select - - if: - name: isMachineCustom|hidden - type: function + - disable: + name: isMachineNotCustom|hidden + watchPaths: + - schema/properties/spec/properties/hidden/properties/podResources/properties/machine init: type: func value: setLimits|cpu|hidden @@ -513,9 +523,10 @@ step: paths: - schema/properties/spec/properties/hidden/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/hidden/properties/podResources/properties/machine - - if: - name: isMachineCustom|hidden - type: function + - disable: + name: isMachineNotCustom|hidden + watchPaths: + - schema/properties/spec/properties/hidden/properties/podResources/properties/machine init: type: func value: setLimits|memory|hidden @@ -677,7 +688,11 @@ step: paths: - temp/backup - elements: - - disable: showArchiverAlert + - disable: + name: showArchiverAlert + watchPaths: + - schema/spec/admin/storageClasses/default + - schema/spec/mode label: Enable Archiver? schema: schema/properties/spec/properties/admin/properties/archiver/properties/enable/properties/default type: switch diff --git a/charts/kubedbcom-mongodb-editor-options/ui/functions.js b/charts/kubedbcom-mongodb-editor-options/ui/functions.js index fdce7721b9..bb0a3b4a28 100644 --- a/charts/kubedbcom-mongodb-editor-options/ui/functions.js +++ b/charts/kubedbcom-mongodb-editor-options/ui/functions.js @@ -463,11 +463,9 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } + let array = [] function getMachineListForOptions() { const machinesFromPreset = getValue(model, '/spec/admin/machineProfiles/machines') @@ -568,7 +566,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -577,9 +575,11 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + console.log({ modelPathValue }) + + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` diff --git a/charts/kubedbcom-mssqlserver-editor-options/ui/create-ui.yaml b/charts/kubedbcom-mssqlserver-editor-options/ui/create-ui.yaml index 178d4b6b87..b81c677ed3 100644 --- a/charts/kubedbcom-mssqlserver-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-mssqlserver-editor-options/ui/create-ui.yaml @@ -57,10 +57,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -73,10 +73,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory @@ -376,7 +376,11 @@ step: paths: - temp/backup - elements: - - disable: showArchiverAlert + - disable: + name: showArchiverAlert + watchPaths: + - schema/spec/admin/storageClasses/default + - schema/spec/mode label: Enable Archiver? schema: schema/properties/spec/properties/admin/properties/archiver/properties/enable/properties/default type: switch diff --git a/charts/kubedbcom-mssqlserver-editor-options/ui/functions.js b/charts/kubedbcom-mssqlserver-editor-options/ui/functions.js index fff5610424..848195e88b 100644 --- a/charts/kubedbcom-mssqlserver-editor-options/ui/functions.js +++ b/charts/kubedbcom-mssqlserver-editor-options/ui/functions.js @@ -458,7 +458,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -467,9 +467,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -504,17 +504,6 @@ export const useFunc = (model) => { return cpuMemoryValue } - function setRequests(resource) { - const modelPath = `/spec/podResources/resources/requests/${resource}` - const val = getValue(model, modelPath) - commitPath = `/spec/podResources/resources/limits/${resource}` - commit('wizard/model$update', { - path: commitPath, - value: val, - force: true, - }) - } - function isMachineCustom(path) { const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' const modelPathValue = getValue(model, fullpath) @@ -523,10 +512,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function setMachineToCustom() { diff --git a/charts/kubedbcom-mysql-editor-options/ui/create-ui.yaml b/charts/kubedbcom-mysql-editor-options/ui/create-ui.yaml index f8519f7e77..8b3fb34c9d 100644 --- a/charts/kubedbcom-mysql-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-mysql-editor-options/ui/create-ui.yaml @@ -112,10 +112,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -128,10 +128,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory @@ -403,7 +403,11 @@ step: paths: - temp/backup - elements: - - disable: showArchiverAlert + - disable: + name: showArchiverAlert + watchPaths: + - schema/spec/admin/storageClasses/default + - schema/spec/mode label: Enable Archiver? schema: schema/properties/spec/properties/admin/properties/archiver/properties/enable/properties/default type: switch diff --git a/charts/kubedbcom-mysql-editor-options/ui/functions.js b/charts/kubedbcom-mysql-editor-options/ui/functions.js index 91706befdd..2c9b50ab9f 100644 --- a/charts/kubedbcom-mysql-editor-options/ui/functions.js +++ b/charts/kubedbcom-mysql-editor-options/ui/functions.js @@ -507,7 +507,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -516,9 +516,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -553,17 +553,6 @@ export const useFunc = (model) => { return cpuMemoryValue } - function setRequests(resource) { - const modelPath = `/spec/podResources/resources/requests/${resource}` - const val = getValue(model, modelPath) - const commitPath = `/spec/podResources/resources/limits/${resource}` - commit('wizard/model$update', { - path: commitPath, - value: val, - force: true, - }) - } - function setMachineToCustom() { const machine = getValue(model, '/spec/admin/machineProfiles/default') return machine || 'custom' @@ -577,10 +566,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function updateAlertValue() { diff --git a/charts/kubedbcom-oracle-editor-options/ui/create-ui.yaml b/charts/kubedbcom-oracle-editor-options/ui/create-ui.yaml index cf55d4c9dc..4a10aa6664 100644 --- a/charts/kubedbcom-oracle-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-oracle-editor-options/ui/create-ui.yaml @@ -48,13 +48,14 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu + loader: setLimits|cpu label: CPU schema: schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu type: input @@ -62,13 +63,15 @@ step: func: setRequests|cpu paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - schema/properties/spec/properties/podResources/properties/machine + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory + loader: setLimits|memory label: Memory schema: schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/memory type: input @@ -76,6 +79,7 @@ step: func: setRequests|memory paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/memory + - schema/properties/spec/properties/podResources/properties/machine showLabels: true type: horizontal-layout label: Machine Profile @@ -253,7 +257,11 @@ step: paths: - temp/backup - elements: - - disable: showArchiverAlert + - disable: + name: showArchiverAlert + watchPaths: + - schema/spec/admin/storageClasses/default + - schema/spec/mode label: Enable Archiver? schema: schema/properties/spec/properties/admin/properties/archiver/properties/enable/properties/default type: switch diff --git a/charts/kubedbcom-oracle-editor-options/ui/functions.js b/charts/kubedbcom-oracle-editor-options/ui/functions.js index 517285f4f7..c170723a1e 100644 --- a/charts/kubedbcom-oracle-editor-options/ui/functions.js +++ b/charts/kubedbcom-oracle-editor-options/ui/functions.js @@ -317,7 +317,6 @@ const modeDetails = { }, } - export const useFunc = (model) => { const { getValue, setDiscriminatorValue, commit, storeGet, discriminator } = useOperator( model, @@ -454,10 +453,10 @@ export const useFunc = (model) => { return [] } + let array = [] function getMachineListForOptions() { const machinesFromPreset = getValue(model, '/spec/admin/machineProfiles/machines') const available = getValue(model, '/spec/admin/machineProfiles/available') - let array = [] if (available.length) { array = available.map((machine) => { @@ -679,8 +678,7 @@ export const useFunc = (model) => { storageClass = retainClassList.length ? retainClassList[0] : simpleClassList[0] } - const isChangeable = isToggleOn('storageClasses', - ) + const isChangeable = isToggleOn('storageClasses') if (isChangeable && storageClass) { commit('wizard/model$update', { path: '/spec/admin/storageClasses/default', @@ -693,9 +691,7 @@ export const useFunc = (model) => { function showAlerts() { // // // // watchDependency('discriminator#/monitoring') const isMonitorEnabled = getValue(discriminator, '/monitoring') - return ( - isMonitorEnabled && isToggleOn('alert') - ) + return isMonitorEnabled && isToggleOn('alert') } function onBackupSwitch() { @@ -1049,8 +1045,7 @@ export const useFunc = (model) => { function showIssuer() { // // // // watchDependency('model#/spec/admin/tls/default') const isTlsEnabled = getValue(model, '/spec/admin/tls/default') - const isIssuerToggleEnabled = isToggleOn('clusterIssuers', - ) + const isIssuerToggleEnabled = isToggleOn('clusterIssuers') return isTlsEnabled && isIssuerToggleEnabled } function onAuthChange() { @@ -1084,10 +1079,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } async function getNamespaces() { const params = storeGet('/route/params') @@ -1221,11 +1213,51 @@ export const useFunc = (model) => { const commitPath = type ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` + + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` + const modelPathValue = getValue(model, fullpath) + commit('wizard/model$update', { path: commitPath, value: val, force: true, }) + + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + + let commitCpuMemory, ModelPathValue + if (resource && type) { + const fullPath = `/spec/${type}/podResources/machine` + ModelPathValue = getValue(model, fullPath) + commitCpuMemory = `spec/${type}/podResources/resources/requests/${resource}` + } else { + const fullPath = `/spec/podResources/machine` + ModelPathValue = getValue(model, fullPath) + commitCpuMemory = `spec/podResources/resources/requests/${resource}` + } + let cpuMemoryValue + array.forEach((item) => { + if (item.value === ModelPathValue) { + // Parse subText like "CPU: 2, Memory: 2Gi" + const subText = item.subText || '' + if (resource === 'cpu') { + // Extract CPU value + const cpuMatch = subText.match(/CPU:\s*([^,]+)/) + cpuMemoryValue = cpuMatch ? cpuMatch[1].trim() : '' + } else if (resource === 'memory') { + // Extract Memory value + const memoryMatch = subText.match(/Memory:\s*(.+)/) + cpuMemoryValue = memoryMatch ? memoryMatch[1].trim() : '' + } + } + }) + commit('wizard/model$update', { + path: commitCpuMemory, + value: cpuMemoryValue, + force: true, + }) + return cpuMemoryValue } function toggleTls() { @@ -1400,7 +1432,6 @@ export const useFunc = (model) => { return show } - return { showReferSecretSwitch, onReferSecretChange, @@ -1467,5 +1498,4 @@ export const useFunc = (model) => { onArchiverChange, showArchiverAlert, } - } diff --git a/charts/kubedbcom-perconaxtradb-editor-options/ui/create-ui.yaml b/charts/kubedbcom-perconaxtradb-editor-options/ui/create-ui.yaml index 960d8c59c1..6db0dcef2c 100644 --- a/charts/kubedbcom-perconaxtradb-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-perconaxtradb-editor-options/ui/create-ui.yaml @@ -33,10 +33,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -49,10 +49,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory diff --git a/charts/kubedbcom-perconaxtradb-editor-options/ui/functions.js b/charts/kubedbcom-perconaxtradb-editor-options/ui/functions.js index c787866f30..614d8ec5d2 100644 --- a/charts/kubedbcom-perconaxtradb-editor-options/ui/functions.js +++ b/charts/kubedbcom-perconaxtradb-editor-options/ui/functions.js @@ -467,7 +467,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -476,9 +476,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -513,17 +513,6 @@ export const useFunc = (model) => { return cpuMemoryValue } - function setRequests(resource) { - const modelPath = `/spec/podResources/resources/requests/${resource}` - const val = getValue(model, modelPath) - const commitPath = `/spec/podResources/resources/limits/${resource}` - commit('wizard/model$update', { - path: commitPath, - value: val, - force: true, - }) - } - function setMachineToCustom() { const machine = getValue(model, '/spec/admin/machineProfiles/default') return machine || 'custom' @@ -537,10 +526,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function showMonitoringSection() { diff --git a/charts/kubedbcom-pgbouncer-editor-options/ui/create-ui.yaml b/charts/kubedbcom-pgbouncer-editor-options/ui/create-ui.yaml index f11c4cdd7e..a30ff76bf8 100644 --- a/charts/kubedbcom-pgbouncer-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-pgbouncer-editor-options/ui/create-ui.yaml @@ -48,10 +48,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -64,10 +64,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory diff --git a/charts/kubedbcom-pgbouncer-editor-options/ui/functions.js b/charts/kubedbcom-pgbouncer-editor-options/ui/functions.js index 2aa6e55bf1..e7ff7a9ffb 100644 --- a/charts/kubedbcom-pgbouncer-editor-options/ui/functions.js +++ b/charts/kubedbcom-pgbouncer-editor-options/ui/functions.js @@ -317,8 +317,6 @@ const modeDetails = { }, } - - export const useFunc = (model) => { const { getValue, setDiscriminatorValue, commit, storeGet, discriminator } = useOperator( model, @@ -350,7 +348,7 @@ export const useFunc = (model) => { queryParams, ) const resources = (resp && resp.data && resp.data.items) || [] - + const fileredResources = resources .filter((item) => item.spec?.type === `kubedb.com/${type}`) .map((item) => { @@ -548,7 +546,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -557,9 +555,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -594,17 +592,6 @@ export const useFunc = (model) => { return cpuMemoryValue } - function setRequests(resource) { - const modelPath = `/spec/podResources/resources/requests/${resource}` - const val = getValue(model, modelPath) - commitPath = `/spec/podResources/resources/limits/${resource}` - commit('wizard/model$update', { - path: commitPath, - value: val, - force: true, - }) - } - function setMachineToCustom() { const machine = getValue(model, '/spec/admin/machineProfiles/default') return machine || 'custom' @@ -618,10 +605,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function updateAlertValue() { @@ -934,16 +918,14 @@ export const useFunc = (model) => { function showAlerts() { // watchDependency('discriminator#/monitoring') const isMonitorEnabled = getValue(discriminator, '/monitoring') - const isAlertToggleEnabled = isToggleOn('alert', - ) + const isAlertToggleEnabled = isToggleOn('alert') return isMonitorEnabled && isAlertToggleEnabled } function showIssuer() { // watchDependency('model#/spec/admin/tls/default') const isTlsEnabled = getValue(model, '/spec/admin/tls/default') - const isIssuerToggleEnabled = isToggleOn('clusterIssuers', - ) + const isIssuerToggleEnabled = isToggleOn('clusterIssuers') return isTlsEnabled && isIssuerToggleEnabled } @@ -1103,5 +1085,4 @@ export const useFunc = (model) => { setBackup, getDefault, } - } diff --git a/charts/kubedbcom-pgpool-editor-options/ui/create-ui.yaml b/charts/kubedbcom-pgpool-editor-options/ui/create-ui.yaml index fffc1778a0..6d20de7acb 100644 --- a/charts/kubedbcom-pgpool-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-pgpool-editor-options/ui/create-ui.yaml @@ -49,10 +49,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -65,10 +65,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory diff --git a/charts/kubedbcom-pgpool-editor-options/ui/functions.js b/charts/kubedbcom-pgpool-editor-options/ui/functions.js index 7e5f690534..fc3904eac0 100644 --- a/charts/kubedbcom-pgpool-editor-options/ui/functions.js +++ b/charts/kubedbcom-pgpool-editor-options/ui/functions.js @@ -435,7 +435,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -444,9 +444,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -481,17 +481,6 @@ export const useFunc = (model) => { return cpuMemoryValue } - function setRequests(resource) { - const modelPath = `/spec/podResources/resources/requests/${resource}` - const val = getValue(model, modelPath) - commitPath = `/spec/podResources/resources/limits/${resource}` - commit('wizard/model$update', { - path: commitPath, - value: val, - force: true, - }) - } - function setMachineToCustom() { const machine = getValue(model, '/spec/admin/machineProfiles/default') return machine || 'custom' @@ -1074,10 +1063,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } async function getNamespaces() { diff --git a/charts/kubedbcom-postgres-editor-options/ui/create-ui.yaml b/charts/kubedbcom-postgres-editor-options/ui/create-ui.yaml index d196f788a0..602048a514 100644 --- a/charts/kubedbcom-postgres-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-postgres-editor-options/ui/create-ui.yaml @@ -64,10 +64,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -80,10 +80,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory @@ -384,7 +384,11 @@ step: paths: - temp/backup - elements: - - disable: showArchiverAlert + - disable: + name: showArchiverAlert + watchPaths: + - schema/spec/admin/storageClasses/default + - schema/spec/mode label: Enable Archiver? schema: schema/properties/spec/properties/admin/properties/archiver/properties/enable/properties/default type: switch diff --git a/charts/kubedbcom-postgres-editor-options/ui/functions.js b/charts/kubedbcom-postgres-editor-options/ui/functions.js index 921b3d885d..72addf9198 100644 --- a/charts/kubedbcom-postgres-editor-options/ui/functions.js +++ b/charts/kubedbcom-postgres-editor-options/ui/functions.js @@ -616,7 +616,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -625,9 +625,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -1365,10 +1365,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function EqualToDatabaseMode(mode) { diff --git a/charts/kubedbcom-proxysql-editor-options/ui/create-ui.yaml b/charts/kubedbcom-proxysql-editor-options/ui/create-ui.yaml index 3d9248107a..4e5f715424 100644 --- a/charts/kubedbcom-proxysql-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-proxysql-editor-options/ui/create-ui.yaml @@ -48,10 +48,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -64,10 +64,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory diff --git a/charts/kubedbcom-proxysql-editor-options/ui/functions.js b/charts/kubedbcom-proxysql-editor-options/ui/functions.js index 7c6137bcaf..cff140b13a 100644 --- a/charts/kubedbcom-proxysql-editor-options/ui/functions.js +++ b/charts/kubedbcom-proxysql-editor-options/ui/functions.js @@ -563,7 +563,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -572,9 +572,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -609,17 +609,6 @@ export const useFunc = (model) => { return cpuMemoryValue } - function setRequests(resource) { - const modelPath = `/spec/podResources/resources/requests/${resource}` - const val = getValue(model, modelPath) - const commitPath = `/spec/podResources/resources/limits/${resource}` - commit('wizard/model$update', { - path: commitPath, - value: val, - force: true, - }) - } - function setMachineToCustom() { const machine = getValue(model, '/spec/admin/machineProfiles/default') return machine || 'custom' @@ -1246,10 +1235,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function EqualToDatabaseMode(mode) { diff --git a/charts/kubedbcom-rabbitmq-editor-options/ui/create-ui.yaml b/charts/kubedbcom-rabbitmq-editor-options/ui/create-ui.yaml index 035922e50e..2379101dd9 100644 --- a/charts/kubedbcom-rabbitmq-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-rabbitmq-editor-options/ui/create-ui.yaml @@ -48,10 +48,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -64,10 +64,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory diff --git a/charts/kubedbcom-rabbitmq-editor-options/ui/functions.js b/charts/kubedbcom-rabbitmq-editor-options/ui/functions.js index bd26d4184f..9924642428 100644 --- a/charts/kubedbcom-rabbitmq-editor-options/ui/functions.js +++ b/charts/kubedbcom-rabbitmq-editor-options/ui/functions.js @@ -577,7 +577,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -586,9 +586,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -623,17 +623,6 @@ export const useFunc = (model) => { return cpuMemoryValue } - function setRequests(resource) { - const modelPath = `/spec/podResources/resources/requests/${resource}` - const val = getValue(model, modelPath) - commitPath = `/spec/podResources/resources/limits/${resource}` - commit('wizard/model$update', { - path: commitPath, - value: val, - force: true, - }) - } - function setMachineToCustom() { const machine = getValue(model, '/spec/admin/machineProfiles/default') return machine || 'custom' @@ -1203,10 +1192,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } async function getNamespaces() { diff --git a/charts/kubedbcom-redis-editor-options/ui/create-ui.yaml b/charts/kubedbcom-redis-editor-options/ui/create-ui.yaml index 614844cc52..bd079643f2 100644 --- a/charts/kubedbcom-redis-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-redis-editor-options/ui/create-ui.yaml @@ -91,10 +91,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -107,10 +107,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory diff --git a/charts/kubedbcom-redis-editor-options/ui/functions.js b/charts/kubedbcom-redis-editor-options/ui/functions.js index b7fb39b8f1..b4d97638ea 100644 --- a/charts/kubedbcom-redis-editor-options/ui/functions.js +++ b/charts/kubedbcom-redis-editor-options/ui/functions.js @@ -968,10 +968,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function isNotEqualToModelPathValue(value, modelPath) { @@ -1169,7 +1166,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -1178,9 +1175,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -1225,17 +1222,6 @@ export const useFunc = (model) => { return !!agent } - function setRequests(resource) { - const modelPath = `/spec/podResources/resources/requests/${resource}` - const val = getValue(model, modelPath) - const commitPath = `/spec/podResources/resources/limits/${resource}` - commit('wizard/model$update', { - path: commitPath, - value: val, - force: true, - }) - } - function setStorageClass() { const deletionPolicy = getValue(model, 'spec/deletionPolicy') || '' let storageClass = getValue(model, 'spec/storageClass/name') || '' @@ -1378,7 +1364,10 @@ export const useFunc = (model) => { const endpointsObject = Object.values(endpoints) const length = Object.keys(endpointsObject?.[0])?.length if (length !== replicas) - return { isInvalid: true, message: `Endpoints length should be equal to replicas(${replicas})` } + return { + isInvalid: true, + message: `Endpoints length should be equal to replicas(${replicas})`, + } else { return {} } diff --git a/charts/kubedbcom-singlestore-editor-options/ui/create-ui.yaml b/charts/kubedbcom-singlestore-editor-options/ui/create-ui.yaml index 01f3dd4248..529f253501 100644 --- a/charts/kubedbcom-singlestore-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-singlestore-editor-options/ui/create-ui.yaml @@ -62,10 +62,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/topology/properties/aggregator/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|topology/aggregator - if: - name: isMachineCustom|topology/aggregator - type: function + - disable: + name: isMachineNotCustom|topology/aggregator + watchPaths: + - schema/properties/spec/properties/topology/properties/aggregator/properties/podResources/properties/machine init: type: func value: setLimits|cpu|topology/aggregator @@ -78,10 +78,10 @@ step: paths: - schema/properties/spec/properties/topology/properties/aggregator/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/topology/properties/aggregator/properties/podResources/properties/machine - - disable: isMachineNotCustom|topology/aggregator - if: - name: isMachineCustom|topology/aggregator - type: function + - disable: + name: isMachineNotCustom|topology/aggregator + watchPaths: + - schema/properties/spec/properties/topology/properties/aggregator/properties/podResources/properties/machine init: type: func value: setLimits|memory|topology/aggregator @@ -127,10 +127,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/topology/properties/leaf/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|topology/leaf - if: - name: isMachineCustom|topology/leaf - type: function + - disable: + name: isMachineNotCustom|topology/leaf + watchPaths: + - schema/properties/spec/properties/topology/properties/leaf/properties/podResources/properties/machine init: type: func value: setLimits|cpu|topology/leaf @@ -143,10 +143,10 @@ step: paths: - schema/properties/spec/properties/topology/properties/leaf/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/topology/properties/leaf/properties/podResources/properties/machine - - disable: isMachineNotCustom|topology/leaf - if: - name: isMachineCustom|topology/leaf - type: function + - disable: + name: isMachineNotCustom|topology/leaf + watchPaths: + - schema/properties/spec/properties/topology/properties/leaf/properties/podResources/properties/machine init: type: func value: setLimits|memory|topology/leaf @@ -181,10 +181,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -197,10 +197,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory diff --git a/charts/kubedbcom-singlestore-editor-options/ui/functions.js b/charts/kubedbcom-singlestore-editor-options/ui/functions.js index 768f9db149..a3a9fe4111 100644 --- a/charts/kubedbcom-singlestore-editor-options/ui/functions.js +++ b/charts/kubedbcom-singlestore-editor-options/ui/functions.js @@ -829,10 +829,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function isRancherManaged() { @@ -987,7 +984,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -996,9 +993,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` diff --git a/charts/kubedbcom-solr-editor-options/ui/create-ui.yaml b/charts/kubedbcom-solr-editor-options/ui/create-ui.yaml index a2a7cf2d2e..a1c41b86f2 100644 --- a/charts/kubedbcom-solr-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-solr-editor-options/ui/create-ui.yaml @@ -34,6 +34,7 @@ step: type: radio - elements: - label: Replica number + customClass: mb-16 schema: schema/properties/spec/properties/replicas type: input if: @@ -63,10 +64,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/topology/properties/overseer/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|topology/overseer - if: - name: isMachineCustom|topology/overseer - type: function + - disable: + name: isMachineNotCustom|topology/overseer + watchPaths: + - schema/properties/spec/properties/topology/properties/overseer/properties/podResources/properties/machine init: type: func value: setLimits|cpu|topology/overseer @@ -79,10 +80,10 @@ step: paths: - schema/properties/spec/properties/topology/properties/overseer/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/topology/properties/overseer/properties/podResources/properties/machine - - disable: isMachineNotCustom|topology/overseer - if: - name: isMachineCustom|topology/overseer - type: function + - disable: + name: isMachineNotCustom|topology/overseer + watchPaths: + - schema/properties/spec/properties/topology/properties/overseer/properties/podResources/properties/machine init: type: func value: setLimits|memory|topology/overseer @@ -125,10 +126,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/topology/properties/data/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|topology/data - if: - name: isMachineCustom|topology/data - type: function + - disable: + name: isMachineNotCustom|topology/data + watchPaths: + - schema/properties/spec/properties/topology/properties/data/properties/podResources/properties/machine init: type: func value: setLimits|cpu|topology/data @@ -141,10 +142,10 @@ step: paths: - schema/properties/spec/properties/topology/properties/data/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/topology/properties/data/properties/podResources/properties/machine - - disable: isMachineNotCustom|topology/data - if: - name: isMachineCustom|topology/data - type: function + - disable: + name: isMachineNotCustom|topology/data + watchPaths: + - schema/properties/spec/properties/topology/properties/data/properties/podResources/properties/machine init: type: func value: setLimits|memory|topology/data @@ -189,10 +190,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/topology/properties/coordinator/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom|topology/coordinator - if: - name: isMachineCustom|topology/coordinator - type: function + - disable: + name: isMachineNotCustom|topology/coordinator + watchPaths: + - schema/properties/spec/properties/topology/properties/coordinator/properties/podResources/properties/machine init: type: func value: setLimits|cpu|topology/coordinator @@ -205,10 +206,10 @@ step: paths: - schema/properties/spec/properties/topology/properties/coordinator/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/topology/properties/coordinator/properties/podResources/properties/machine - - disable: isMachineNotCustom|topology/coordinator - if: - name: isMachineCustom|topology/coordinator - type: function + - disable: + name: isMachineNotCustom|topology/coordinator + watchPaths: + - schema/properties/spec/properties/topology/properties/coordinator/properties/podResources/properties/machine init: type: func value: setLimits|memory|topology/coordinator @@ -243,10 +244,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -259,10 +260,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory diff --git a/charts/kubedbcom-solr-editor-options/ui/functions.js b/charts/kubedbcom-solr-editor-options/ui/functions.js index 8a634d91ab..b1d126fb38 100644 --- a/charts/kubedbcom-solr-editor-options/ui/functions.js +++ b/charts/kubedbcom-solr-editor-options/ui/functions.js @@ -742,10 +742,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function isRancherManaged() { @@ -863,7 +860,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -872,9 +869,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` diff --git a/charts/kubedbcom-zookeeper-editor-options/ui/create-ui.yaml b/charts/kubedbcom-zookeeper-editor-options/ui/create-ui.yaml index 3e2dafe30e..a785a25042 100644 --- a/charts/kubedbcom-zookeeper-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-zookeeper-editor-options/ui/create-ui.yaml @@ -44,10 +44,10 @@ step: loader: getMachineListForOptions schema: schema/properties/spec/properties/podResources/properties/machine type: select - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|cpu @@ -60,10 +60,10 @@ step: paths: - schema/properties/spec/properties/podResources/properties/resources/properties/requests/properties/cpu - schema/properties/spec/properties/podResources/properties/machine - - disable: isMachineNotCustom - if: - name: isMachineCustom - type: function + - disable: + name: isMachineNotCustom + watchPaths: + - schema/properties/spec/properties/podResources/properties/machine init: type: func value: setLimits|memory diff --git a/charts/kubedbcom-zookeeper-editor-options/ui/functions.js b/charts/kubedbcom-zookeeper-editor-options/ui/functions.js index 17e1f6dc45..df79a9bd0e 100644 --- a/charts/kubedbcom-zookeeper-editor-options/ui/functions.js +++ b/charts/kubedbcom-zookeeper-editor-options/ui/functions.js @@ -553,7 +553,7 @@ export const useFunc = (model) => { ? `/spec/${type}/podResources/resources/limits/${resource}` : `/spec/podResources/resources/limits/${resource}` - const fullpath = `/spec/podResources/machine` + const fullpath = type ? `/spec/${type}/podResources/machine` : `/spec/podResources/machine` const modelPathValue = getValue(model, fullpath) commit('wizard/model$update', { @@ -562,9 +562,9 @@ export const useFunc = (model) => { force: true, }) - if (modelPathValue === 'custom') { - return - } + if (!modelPathValue) return + if (modelPathValue === 'custom') return val + let commitCpuMemory, ModelPathValue if (resource && type) { const fullPath = `/spec/${type}/podResources/machine` @@ -599,17 +599,6 @@ export const useFunc = (model) => { return cpuMemoryValue } - function setRequests(resource) { - const modelPath = `/spec/podResources/resources/requests/${resource}` - const val = getValue(model, modelPath) - commitPath = `/spec/podResources/resources/limits/${resource}` - commit('wizard/model$update', { - path: commitPath, - value: val, - force: true, - }) - } - function setMachineToCustom() { const machine = getValue(model, '/spec/admin/machineProfiles/default') return machine || 'custom' @@ -1133,10 +1122,7 @@ export const useFunc = (model) => { } function isMachineNotCustom(path) { - const fullpath = path ? `/spec/${path}/podResources/machine` : '/spec/podResources/machine' - const modelPathValue = getValue(model, fullpath) - // watchDependency(`model#${fullpath}`) - return modelPathValue !== 'custom' && !!modelPathValue + return !isMachineCustom(path) } function onAuthChange() { diff --git a/schemas/ui-schema.json b/schemas/ui-schema.json index 3176b085f8..d0700c641a 100644 --- a/schemas/ui-schema.json +++ b/schemas/ui-schema.json @@ -25,7 +25,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "if": { "$ref": "#/definitions/IfType" @@ -72,7 +79,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "element": { "additionalProperties": false, @@ -130,7 +144,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "disableUnselect": { "type": "boolean" @@ -291,7 +312,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "elements": { "items": { @@ -354,7 +382,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "elements": { "items": { @@ -523,7 +558,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "if": { "$ref": "#/definitions/IfType" @@ -598,7 +640,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "editorHeight": { "type": "string" @@ -743,7 +792,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "forceRequired": { "type": "boolean" @@ -793,7 +849,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "header": { "type": "string" @@ -843,7 +906,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "hasIcon": { "type": "boolean" @@ -926,7 +996,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "header": { "type": "string" @@ -979,7 +1056,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "editorHeight": { "type": "string" @@ -1080,7 +1164,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "if": { "$ref": "#/definitions/IfType" @@ -1185,7 +1276,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "if": { "$ref": "#/definitions/IfType" @@ -1235,7 +1333,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "if": { "$ref": "#/definitions/IfType" @@ -1279,7 +1384,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "disableUnselect": { "type": "boolean" @@ -1335,7 +1447,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "header": { "type": "string" @@ -1417,7 +1536,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "fullwidth": { "type": "boolean" @@ -1511,7 +1637,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "height": { "type": "string" @@ -1588,7 +1721,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "disableUnselect": { "type": "boolean" @@ -1650,7 +1790,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "if": { "$ref": "#/definitions/IfType" @@ -1703,7 +1850,14 @@ "type": "string" }, "disable": { - "type": ["boolean", "string"] + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/LoaderType" + } + ] }, "if": { "$ref": "#/definitions/IfType" From 016b3647ee79b199d60077c545f4d880f0ee31a1 Mon Sep 17 00:00:00 2001 From: shofiq Date: Tue, 3 Feb 2026 15:57:15 +0600 Subject: [PATCH 2/4] fix rank name validation in cassandra create page Signed-off-by: shofiq --- charts/kubedbcom-cassandra-editor-options/ui/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kubedbcom-cassandra-editor-options/ui/functions.js b/charts/kubedbcom-cassandra-editor-options/ui/functions.js index 404e1ac120..4262924cbc 100644 --- a/charts/kubedbcom-cassandra-editor-options/ui/functions.js +++ b/charts/kubedbcom-cassandra-editor-options/ui/functions.js @@ -558,7 +558,7 @@ export const useFunc = (model) => { return 'The value must start with a letter, can include letters, numbers, hyphens (-), and underscores (_).' } } - return true + return '' } function updateAlertValue() { From 862210bb08cf498134ce6eb973c9e449ff7279e9 Mon Sep 17 00:00:00 2001 From: shofiq Date: Tue, 3 Feb 2026 16:28:51 +0600 Subject: [PATCH 3/4] remove console log Signed-off-by: shofiq --- charts/kubedbcom-mongodb-editor-options/ui/functions.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/charts/kubedbcom-mongodb-editor-options/ui/functions.js b/charts/kubedbcom-mongodb-editor-options/ui/functions.js index bb0a3b4a28..f134b05627 100644 --- a/charts/kubedbcom-mongodb-editor-options/ui/functions.js +++ b/charts/kubedbcom-mongodb-editor-options/ui/functions.js @@ -575,8 +575,6 @@ export const useFunc = (model) => { force: true, }) - console.log({ modelPathValue }) - if (!modelPathValue) return if (modelPathValue === 'custom') return val From f83d9c7bcb1257afb648b02924cd77b984c5c980 Mon Sep 17 00:00:00 2001 From: shofiq Date: Tue, 3 Feb 2026 17:54:54 +0600 Subject: [PATCH 4/4] fix alignment issue in machine profile for pgpool create page Signed-off-by: shofiq --- charts/kubedbcom-pgpool-editor-options/ui/create-ui.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/charts/kubedbcom-pgpool-editor-options/ui/create-ui.yaml b/charts/kubedbcom-pgpool-editor-options/ui/create-ui.yaml index 6d20de7acb..50c51e1a98 100644 --- a/charts/kubedbcom-pgpool-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-pgpool-editor-options/ui/create-ui.yaml @@ -41,8 +41,7 @@ step: or select a predefined profile. type: label-element - elements: - - customClass: mt-10 - init: + - init: type: func value: setMachineToCustom label: Machine