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

feat: Update international address #7685

Merged
merged 1 commit into from
Jan 10, 2025
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
6 changes: 5 additions & 1 deletion frontend/src/components/license-import/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ const handleExceed: UploadProps['onExceed'] = (files) => {
};

const toLxware = () => {
window.open('https://www.lxware.cn/1panel' + '', '_blank', 'noopener,noreferrer');
if (!globalStore.isIntl) {
window.open('https://www.lxware.cn/1panel' + '', '_blank', 'noopener,noreferrer');
} else {
window.open('https://1panel.hk/pricing' + '', '_blank', 'noopener,noreferrer');
}
};

const submit = async () => {
Copy link
Member

Choose a reason for hiding this comment

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

The code difference is a minor conditional statement inside the toLxware function that changes the link based on whether globalStore.isIntl is true or false. This will likely improve clarity and maintainability of the function but doesn't introduce any immediate errors. It's good practice to add comments explaining this conditional logic.

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/system-upgrade/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const toLxware = () => {
if (!globalStore.isIntl) {
window.open('https://www.lxware.cn/1panel' + '', '_blank', 'noopener,noreferrer');
} else {
window.open('https://1panel.hk' + '', '_blank', 'noopener,noreferrer');
window.open('https://1panel.hk/pricing' + '', '_blank', 'noopener,noreferrer');
}
};

Copy link
Member

Choose a reason for hiding this comment

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

There is no significant issue with the provided JavaScript code. However, there might be an unintended change:

if (!globalStore.isIntl) {

This should likely check !globalStore.intl instead of isIntl. Assuming this was intended to differentiate between internationalization settings.

Potential optimization suggestion:

For performance reasons, especially considering it's only a redirect or open call, there's not much to optimize here beyond ensuring that all paths ('https://www.lxware.cn/1panel', 'https://1panel.hk/pricing') work correctly and efficiently. This kind of operation is generally low-latency, so further optimizations won't have substantial impact.

Expand Down
6 changes: 5 additions & 1 deletion frontend/src/views/setting/license/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ const license = reactive({
});

const toLxware = () => {
window.open('https://www.lxware.cn/1panel' + '', '_blank', 'noopener,noreferrer');
if (!globalStore.isIntl) {
window.open('https://www.lxware.cn/1panel' + '', '_blank', 'noopener,noreferrer');
} else {
window.open('https://1panel.hk/pricing' + '', '_blank', 'noopener,noreferrer');
}
};

const loadInfo = () => {
Copy link
Member

Choose a reason for hiding this comment

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

The code appears to be attempting to conditionally redirect users based on an isIntl property of a globalStore. Here are the key points:

  1. Logic: The function checks if globalStore.isIntl is truthy. If it's not (undefined, null, false, etc.), it redirects to 'https://www.lxware.cn/1panel'. Otherwise, it redirects to 'https://1panel.hk/pricing'.

  2. Potential Issues:

    • Ensure that globalStore.isIntl is correctly defined and maintained throughout the application.
    • Consider adding logging or debugging statements to check the value of isIntl.
  3. Optimization Suggestions:

    • Since the redirect logic doesn't involve complex computations, there isn't much room for optimization in this part of the code.

Overall, the code seems well-written from an execution standpoint but could benefit from more comprehensive error handling and proper testing around the dependency globalStore.

Expand Down
Loading