Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions charts/kubedbcom-cassandra-editor-options/ui/create-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
15 changes: 6 additions & 9 deletions charts/kubedbcom-cassandra-editor-options/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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', {
Expand All @@ -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`
Expand Down Expand Up @@ -561,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() {
Expand Down
26 changes: 16 additions & 10 deletions charts/kubedbcom-clickhouse-editor-options/ui/create-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
13 changes: 5 additions & 8 deletions charts/kubedbcom-clickhouse-editor-options/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand All @@ -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`
Expand Down Expand Up @@ -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() {
Expand Down
64 changes: 32 additions & 32 deletions charts/kubedbcom-druid-editor-options/ui/create-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
13 changes: 5 additions & 8 deletions charts/kubedbcom-druid-editor-options/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand All @@ -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`
Expand Down Expand Up @@ -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() {
Expand Down
Loading
Loading