Skip to content

Conversation

fit2bot
Copy link
Contributor

@fit2bot fit2bot commented Mar 18, 2025

fix: Create ssh_key set is_active error

@fit2bot fit2bot requested a review from a team March 18, 2025 03:28
@@ -59,7 +59,8 @@ export default {
const isCreated = vm.isCreateAction || vm.meta?.action === 'clone'
if (validValues['generate_key_type'] === 'auto' && isCreated) {
const name = validValues['name']
this.$axios.get(`/core/auth/profile/pubkey/generate/?name=${name}`)
const queryParams = new URLSearchParams(validValues).toString()
this.$axios.get(`/core/auth/profile/pubkey/generate/?${queryParams}`)
.then((res) => {
vm.createSuccessHandle()
downloadText(res, `${name}.jumpserver.pem`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues were found with the provided code snippet. It is clear and concise, adhering to best practices for functional programming. The import/exports, functions, variables, and conditional logic are appropriately formatted.

In terms of improvements or extensions, considering that Vue.js uses modern JavaScript features such as JSX and dynamic imports like @ symbol followed by an underscore (_), it might not be necessary to explicitly call .then()` on asynchronous operations like axios requests, as they will already handle their own responses upon success (though there's no direct way to do this without explicit chaining).

However, since we're working within a knowledge cutoff dated September 2021, there isn't enough information available regarding what could potentially cause errors today versus those from earlier time periods, but I encourage you use modern JavaScript conventions wherever applicable:

Remember, if anything becomes outdated based on current standards and practices, you should consider migrating your codebase to TypeScript instead of plain vanilla JavaScript which has been largely deprecated in recent years.

Copy link

@w940853815 w940853815 merged commit 6aab902 into dev Mar 18, 2025
5 of 6 checks passed
@w940853815 w940853815 deleted the pr@dev@fix_set_ssh_key branch March 18, 2025 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants