From c0b4ce78a8ee9572fbef95aaee638b4812704eec Mon Sep 17 00:00:00 2001 From: samiul Date: Tue, 23 Dec 2025 18:36:50 +0600 Subject: [PATCH] fix redis announce Signed-off-by: samiul --- .../ui/create-ui.yaml | 16 +++++++++++----- .../ui/functions.js | 15 ++++++++++++++- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/charts/kubedbcom-redis-editor-options/ui/create-ui.yaml b/charts/kubedbcom-redis-editor-options/ui/create-ui.yaml index baebd0bfd5..417dd3228c 100644 --- a/charts/kubedbcom-redis-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-redis-editor-options/ui/create-ui.yaml @@ -143,7 +143,7 @@ step: value: setAnnounce label: Announce Redis Endpoints ? watcher: - func: setAnnounce + func: commitAnnounceChanges paths: - temp/announce schema: temp/announce @@ -160,12 +160,18 @@ step: value: hostname schema: schema/properties/spec/properties/cluster/properties/announce/properties/type type: select - - type: array-item-form - element: - label: Shard Endpoints (comma-separated, e.g. "endpoint1,endpoint2,endpoint3") - type: input + - type: array-object-form label: Shards + buttonClass: is-light is-outlined schema: schema/properties/spec/properties/cluster/properties/announce/properties/shards + elements: + - label: Shard Endpoints + schema: endpoints + buttonClass: is-light is-outlined + type: array-item-form + element: + label: Endpoint + type: input if: type: function name: showAnnounce diff --git a/charts/kubedbcom-redis-editor-options/ui/functions.js b/charts/kubedbcom-redis-editor-options/ui/functions.js index 44112b7cde..b5a5708f54 100644 --- a/charts/kubedbcom-redis-editor-options/ui/functions.js +++ b/charts/kubedbcom-redis-editor-options/ui/functions.js @@ -1097,6 +1097,15 @@ export const useFunc = (model) => { value: null, force: true, }) + return false + } + + function commitAnnounceChanges() { + commit('wizard/model$update', { + path: '/spec/cluster/announce', + value: null, + force: true, + }) } function setBackup() { @@ -1383,7 +1392,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 {} } @@ -1463,5 +1475,6 @@ export const useFunc = (model) => { updateAlertValue, validateEndpoints, zonesOnChange, + commitAnnounceChanges, } }