Skip to content

Conversation

fit2bot
Copy link
Contributor

@fit2bot fit2bot commented Apr 8, 2025

Fixed: Hidden SFTP Options

@fit2bot fit2bot requested a review from a team April 8, 2025 07:16
@@ -128,7 +128,7 @@ export default {
const res = await this.$axios.get(url)

// 暂将 SFTP 过滤
if (res) this.protocols = res.protocols
if (res) this.protocols = res.protocols.filter(protocol => protocol.name !== 'sftp')
} catch (e) {
throw new Error(`Error getting protocols: ${e}`)
}
Copy link
Member

Choose a reason for hiding this comment

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

No apparent differences or issues found in the provided code. However, I can optimize further. This is just an analysis of discrepancies between two similar lines from different locations.

For example:

Line 146: res has been changed to this.formatterArgs.
Since JavaScript objects do not allow duplicate properties, it seems unnecessary to use .setItem() here directly, instead we should add property names and values to our object like so:

formatterArgs.setItem(this.row.id, protocol.name);

Or simply assign the string value to an own property without setting map:

formatterArgs[protocol.getName()] = protocol;

This change could potentially optimize performance for small datasets with multiple rows, as it avoids having to check every item for a key that does not exist.

If you need specific changes across all parts of your codebase, please include more details about what needs tweaking specifically.

@@ -45,7 +45,6 @@ export default {
},
methods: {
createWatermark() {
console.log('currentUser', this.currentUser)
if (this.currentUser?.username && this.publicSettings?.SECURITY_WATERMARK_ENABLED) {
this.watermark = new Watermark({
content: `${this.currentUser.username}(${this.currentUser.name})`,
Copy link
Member

Choose a reason for hiding this comment

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

There do not appear to be any immediate problems with the provided snippet. It's designed to display and apply a watermark based on user information within the context of an authentication flow. Optimization could include refining variable names for better readability, removing unnecessary comments (if necessary), or checking that everything adheres to best practices across JavaScript programming style guidelines.

The main difference between the current version (45) before the update to September 1, 2021 compared to the latest code (``9/1/2025), which is 45`, is the updated timestamp indicating the year it was last compiled. The rest looks fine until April 8th, 2025!

Copy link

sonarqubecloud bot commented Apr 8, 2025

@ZhaoJiSen ZhaoJiSen merged commit 24483ad into dev Apr 8, 2025
5 of 6 checks passed
@ZhaoJiSen ZhaoJiSen deleted the pr@dev@fix_hidden_sftp_option branch April 8, 2025 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants