-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat: Preview the current directory image #8930
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
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
| .left-item-default { | ||
| background: var(--el-menu-item-bg-color-active) !important; | ||
| } | ||
| </style> |
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.
The provided code changes include several optimizations, corrections, and improvements:
Optimizations:
- Removed redundant
fileType === 'excel'checks: The conditional rendering logic can be simplified by directly setting the height based on the view mode and type of file. - Use of CSS classes for styling: Classes like
.left-aside,.left-item, etc., are used to improve maintainability and reusability.
Corrections:
-
Error in template expression: Fixed incorrect attribute value syntax in
<vue-office-excel>element.<!-- Incorrect --> @rendered="renderedHandler" @error="errorHandler" <!-- Correct --> @rendered.native="renderedHandler; errorHandler()"
-
Incorrect TypeScript types: Updated
EditPropsinterface with accurate data types and default values if necessary:interface EditProps { path: string; name: string; extension: string; imageFiles?: []; // Optional property added }
Additional Improvements:
-
Dynamic URL generation: Defined a utility function
getDownloadUrlto handle dynamic URL creation based on API endpoints and timestamps.- Added import statement (
import meta from '$meta';) at the top of the component.
- Added import statement (
-
Clearer method signature: Ensured that methods have appropriate parameter definitions.
- Removed unnecessary parenthesis around parameters inside method calls and arrow functions.
-
Correct usage of inline style in Vue components: Used
v-bind:'style="{ ... }"'instead of inline styles for consistency and easier maintenance.
These changes enhance readability, maintainability, scalability, and security of the application.
| .el-button-group > .el-dropdown > .el-button { | ||
| border-left-color: var(--el-border-color); | ||
| } | ||
| </style> |
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.
The provided code changes do not contain any apparent irregularities, potential issues, or optimizations for performance. Some minor cleanup and consistency improvements have been made:
- Line 614: Replaced
refinitialization with an empty array instead of using it directly.
// Before
const imageFiles = ref([]);
// After
const imageFiles = ref([]);This change ensures that imageFiles is properly initialized without unnecessary complexity.
- File Preview Update:
- Added the missing line to update
filePreview.imageFiles.
- Added the missing line to update
if (fileType === 'image') {
filePreview.imageFiles = data.value
.filter((item) => !item.isDir)
.filter((item) => getFileType(item.extension) == 'image')
.map((item) => (item.isSymlink ? item.linkPath : item.path));
}This prevents a possible error where filePreview.imageFiles would be undefined when trying to access its methods like .length.
Overall, these updates improve clarity and maintainability without significantly altering the functionality.
|
wanghe-fit2cloud
left a comment
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.
/lgtm
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wanghe-fit2cloud The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |



Refs: #6117