mirror of
https://github.com/portainer/portainer.git
synced 2025-07-20 22:09:41 +02:00
feat(k8s/config): disable edit used config keys (#4754)
* feat(k8s/config): tag used data keys * feat(k8s/config): disabled edit of used data keys
This commit is contained in:
parent
c84da11a91
commit
20f8d03366
3 changed files with 36 additions and 4 deletions
|
@ -19,7 +19,11 @@ class KubernetesConfigurationDataController {
|
|||
this.showAdvancedMode = this.showAdvancedMode.bind(this);
|
||||
}
|
||||
|
||||
onChangeKey() {
|
||||
onChangeKey(entry) {
|
||||
if (entry.Used) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.state.duplicateKeys = KubernetesFormValidationHelper.getDuplicates(_.map(this.formValues.Data, (data) => data.Key));
|
||||
this.isValid = Object.keys(this.state.duplicateKeys).length === 0;
|
||||
}
|
||||
|
@ -28,7 +32,11 @@ class KubernetesConfigurationDataController {
|
|||
this.formValues.Data.push(new KubernetesConfigurationFormValuesEntry());
|
||||
}
|
||||
|
||||
removeEntry(index) {
|
||||
removeEntry(index, entry) {
|
||||
if (entry.Used) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.formValues.Data.splice(index, 1);
|
||||
this.onChangeKey();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue