Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed the ability to select one more than ssh-key in deployment #2893

Merged
merged 8 commits into from
Jun 6, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ export default defineComponent({

onMounted(() => {
selectedKeys.value = sshKeysManagement.list().filter(_key => _key.isActive === true);
// TODO: Remove the below `selectedKeys.value = [selectedKeys.value[0]];` to make the user select more than one key
// after fixing this issue: https://github.com/threefoldtech/tf-images/issues/231
selectedKeys.value = [selectedKeys.value[0]];
handleKeys();
emit("selectedKeys", selectedKeysString.value);
});
Expand All @@ -137,14 +140,17 @@ export default defineComponent({
};

function selectKey(key: SSHKeyData) {
if (isKeySelected(key)) {
const index = selectedKeys.value.findIndex(selectedKey => selectedKey.id === key.id);
if (index !== -1) {
selectedKeys.value.splice(index, 1);
}
} else {
selectedKeys.value.push(key);
}
// TODO: Update the below `selectedKeys.value = [key];` to make the user select more than one key
// after fixing this issue: https://github.com/threefoldtech/tf-images/issues/231
selectedKeys.value = [key];
// if (isKeySelected(key)) {
// const index = selectedKeys.value.findIndex(selectedKey => selectedKey.id === key.id);
// if (index !== -1) {
// selectedKeys.value.splice(index, 1);
// }
// } else {
// selectedKeys.value.push(key);
// }

handleKeys();
emit("selectedKeys", selectedKeysString.value);
Expand Down
13 changes: 8 additions & 5 deletions packages/playground/src/components/ssh_keys/SshTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,14 @@ export default defineComponent({
title: "Key Fingerprint",
key: "fingerPrint",
},
{
title: "Active",
key: "activation",
sortable: false,
},

// TODO: Update the below `Column` to make the user activate/deactivate more than one key.
// after fixing this issue: https://github.com/threefoldtech/tf-images/issues/231
// {
// title: "Active",
// key: "activation",
// sortable: false,
// },
];

const deleteSelected = () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/playground/src/views/sshkey_view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
</div>
</v-card>

<v-alert type="info"> Multiple keys support is coming up soon </v-alert>

<v-card class="mb-3 pa-3" color="transparent">
<v-col class="d-flex justify-end">
<v-btn
Expand Down
Loading