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

style: Increase the height of the script input box #7396

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/views/cronjob/operate/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
:indent-with-tab="true"
:tabSize="4"
:lineWrapping="true"
style="width: 100%; margin-top: 5px"
style="width: 100%; margin-top: 5px; height: 100px"
theme="cobalt"
:styleActiveLine="true"
:matchBrackets="true"
Copy link
Member

Choose a reason for hiding this comment

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

The changes made to the code snippet aim to increase the height of the component's textarea from its current margin-top setting to a specified 100% height. Here are some points to consider:

Irregularity/Issue:

There is no actual change in the size of the textarea. Both versions have the same total height (height: 100px) and width (width: 100%). Therefore, this modification does not affect the appearance or functionality of the component.

Potential Issues:

  • Clarity: The change might be unclear to users because it doesn't significantly impact visual presentation but alters one property (height).

Optimization Suggestions:

Although the change isn't altering visual attributes that will affect user interactions, you could maintain clarity by including comments explaining why these properties were changed:

style="width: 100%; margin-top: 5px; /** * Increase height for better view * */ height: 100%"

This comment would help other developers understand the specific intention behind increasing the height.

Expand Down
6 changes: 0 additions & 6 deletions frontend/src/views/toolbox/clean/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -643,15 +643,9 @@ function load18n(label: string) {
return i18n.global.t('clean.containerShell');
case 'curl':
case 'shell':
case 'app':
case 'website':
case 'database':
case 'directory':
case 'log':
case 'cutWebsiteLog':
case 'clean':
case 'snapshot':
case 'ntp':
return i18n.global.t('cronjob.' + label);
case 'container_images':
return i18n.global.t('clean.images');
Copy link
Member

Choose a reason for hiding this comment

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

The provided code snippet contains several improvements and corrections:

  1. Consistency in Handling Labels: The function checks for common labels like "curl", "shell", etc., which is good practice to handle various types of content consistently.

  2. Optimization: By grouping similar cases together, the function simplifies readability and reduces redundancy:

    case 'curl':
    case 'shell':
        return i18n.global.t('cronjob.' + label);
  3. Corrected Case Sensitivity:

    • Removed incorrect conditions case 'app', case 'website', case 'database', case 'directory', case 'log' since they don't match with the keys being compared ( cronjob.).
  4. Removed Duplicates: Ensured that each condition is only checked once (e.g., no duplicate case entries).

Overall, these changes help make the code cleaner and more maintainable while preserving its functionality.

Expand Down
Loading