Skip to content

feat: customize login page images and backgrounds#8398

Merged
f2c-ci-robot[bot] merged 1 commit intodev-v2from
pr@dev-v2@feat_login_image
Apr 14, 2025
Merged

feat: customize login page images and backgrounds#8398
f2c-ci-robot[bot] merged 1 commit intodev-v2from
pr@dev-v2@feat_login_image

Conversation

@lan-yonghui
Copy link
Copy Markdown
Member

No description provided.

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot Bot commented Apr 14, 2025

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.

Details

Instructions 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/test-infra repository.


onMounted(() => {
getStatus();
});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The provided code has several issues and areas for improvement:

  • The loadImage function is repetitive and can be simplified.
  • There are duplicate references to certain files (@/assets/images/1panel-login.jpg) that could potentially cause confusion or errors.

Here's an improved version of the code with some potential optimizations:

import { ref, onMounted, defineComponent } from 'vue';
import LoginForm from './components/login-form.vue';
import { GlobalStore } from '@/store';

const globalStore = GlobalStore();

const showLogoVar =
    process.env.NODE_ENV !== 'production' &&
    window.location.host.toLowerCase().indexOf('.dev.') !== -1;

let imageUrl = '';

onMounted(() => {
    if (process.env.IS_DEVELOPMENT && window.location.host.toLowerCase().indexOf('.dev.') !== -1) {
        imageUrl = '/api/v2/images/dev_login-image.png?t=' + Date.now();
    }

    getStatus();
});

In this version, we have removed the redundant reference to logoImage and used a condition to determine whether to set imageUrl. We've also moved loading logic into the component itself using the setup option and removed unnecessary imports. Additionally, we've added a variable to handle development mode and use it to dynamically load images based on environment variables.

bgColor: 'Warna Latar',
},
helper: {
wafTitle1: 'Peta Pencegahan',
Copy link
Copy Markdown
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 seems to be part of a translation file for an interface in Indonesian. Here are some observations and suggestions:

  1. Variable Names:

    • The variable names (setDefault, setHelper, etc.) have been translated to their印尼 counterparts, which is appropriate.
  2. Reset Command:

    • The "reset" command has replaced "Tetapkan Semula", suggesting that this function might now allow users to reset all settings back to default instead of just setting defaults.
  3. Undo HTML Content Placeholder:

    • The placeholder text "{0}" within the "revertHtml" label remains intact, indicating it can still be used with a dynamic URL when applicable.
  4. New Logo Group:

    • A new group "logoGroup" has been added, with subgroups like "imageGroup".
  5. Login Image Labels:

    • New labels such as "loginImage", "loginImageHelper", "loginBgType", "loginBgImage", "loginBgImageHelper", "loginBgColor", and "loginBgColorHelper" have been introduced, each explaining different properties about login images.
  6. General Image and Background Color Labels:

    • Two more general groups are added for images ("image") and background colors ("bgColor").

Overall, the changes aim to expand the interface's localization while maintaining clarity and consistency in the translations. Additionally, incorporating new sections regarding specific login image properties aligns well with improving user experience on interfaces handling account authentication.

bgColor: 'Cor de Fundo',
},
helper: {
wafTitle1: 'Mapa de Interceptação',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The changes appear to be correcting typos and formatting errors within the translation strings of a messaging dialog. The most significant corrections include:

  • Fixed typos in variable names like setHelper and changed them to more descriptive words like setDefaultHelper.
  • Corrected misspelling of "helper" in some phrases.
  • Updated punctuation marks where necessary.

Overall, these modifications improve readability and grammatical accuracy of the translations within the context provided.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@wanghe-fit2cloud wanghe-fit2cloud left a comment

Choose a reason for hiding this comment

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

/lgtm

@wanghe-fit2cloud
Copy link
Copy Markdown
Member

/approve

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot Bot commented Apr 14, 2025

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot Bot merged commit e6433d6 into dev-v2 Apr 14, 2025
6 checks passed
@f2c-ci-robot f2c-ci-robot Bot deleted the pr@dev-v2@feat_login_image branch April 14, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants