Fix create ssh key modal not pop up in rancher integration mode (#269)

Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
Andy Lee 2025-05-07 15:50:29 +08:00 committed by GitHub
parent 960df31667
commit 5682bf4c3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,13 +1,11 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { randomStr } from '@shell/utils/string'; import { randomStr } from '@shell/utils/string';
import { clone } from '@shell/utils/object';
import { LabeledInput } from '@components/Form/LabeledInput'; import { LabeledInput } from '@components/Form/LabeledInput';
import LabeledSelect from '@shell/components/form/LabeledSelect'; import LabeledSelect from '@shell/components/form/LabeledSelect';
import ModalWithCard from '@shell/components/ModalWithCard'; import ModalWithCard from '@shell/components/ModalWithCard';
import { _VIEW, _EDIT } from '@shell/config/query-params'; import { _VIEW, _EDIT } from '@shell/config/query-params';
import { NAMESPACE } from '@shell/config/types'; import { NAMESPACE } from '@shell/config/types';
import { HCI } from '../../types'; import { HCI } from '../../types';
@ -131,6 +129,7 @@ export default {
checkedSsh(val) { checkedSsh(val) {
// if click on Create a New... // if click on Create a New...
if (val.includes(_NEW)) { if (val.includes(_NEW)) {
this.checkedSsh = this.checkedSsh.filter((key) => key !== _NEW);
this.show(); this.show();
} }
} }
@ -234,9 +233,7 @@ export default {
}, },
update() { update() {
const sshKeys = this.checkedSsh.filter((key) => key !== _NEW); this.$emit('update:sshKey', clone(this.checkedSsh));
this.$emit('update:sshKey', sshKeys);
}, },
} }
}; };