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 @@ -37,8 +37,12 @@

<v-card-text>
<v-alert type="info" class="mb-5">
The keys selected here will be forwarded to your deployment. To change keys, simply toggle on the keys you
wish to select/deselect.
<!--
TODO: Return the message back when return the multiple keys feature.
The keys selected here will be forwarded to your deployment. To change keys, simply toggle on the keys you
wish to select/deselect.
-->
To change the key that you want to use over the deployment, simply click on it.
</v-alert>

<v-tooltip
Expand Down Expand Up @@ -128,6 +132,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 +144,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