-
Notifications
You must be signed in to change notification settings - Fork 124
Fixed: Hidden SFTP Options #4935
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
Conversation
@@ -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}`) | |||
} |
There was a problem hiding this comment.
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})`, |
There was a problem hiding this comment.
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!
|
Fixed: Hidden SFTP Options