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: Support for license import in the international version #7625

Merged
merged 1 commit into from
Jan 2, 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
1 change: 1 addition & 0 deletions backend/constant/errs.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ var (
var (
ErrLicense = "ErrLicense"
ErrLicenseCheck = "ErrLicenseCheck"
ErrXpackVersion = "ErrXpackVersion"
ErrLicenseSave = "ErrLicenseSave"
ErrLicenseSync = "ErrLicenseSync"
)
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 provided appears to be adding a new error constant ErrXpackVersion to the existing list of error constants defined in the variables section. This addition is generally appropriate if you need to handle errors related to X-pack versions, such as checking for compatibility across different Elasticsearch clusters.

Potential Issues:

  • Uniqueness: Ensure that each added error constant has a unique name within the package or module to avoid confusion and simplify debugging processes.
  • Import Statement: Make sure that any other files or modules using these error constants have imported this variable correctly.

Optimization Suggestions (if applicable):

  • Documentation: Provide comments describing what each error indicates, especially when it’s being used in error logging or user feedback mechanisms.
  • Error Handling: Consider whether any part of your application needs to use specific conditions or checks derived from these error codes for more complex logic flow.
  • Consistency: Keep all error handling consistent throughout your application; i.e., maintain similar names, messages, and return behaviors for different types of errors with similar purposes.

In summary, the update looks reasonable and does not introduce major issues but can benefit from additional documentation and consistency.

Expand Down
1 change: 1 addition & 0 deletions backend/i18n/lang/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ ErrIPExist: "IP is exit"
#license
ErrLicense: "License format error, please check and try again!"
ErrLicenseCheck: "License verification failed, please check and try again!"
ErrXpackVersion: "License verification failed, this license is version-restricted and cannot be successfully imported. Please check and try again!";
ErrLicenseSave: "Failed to save license information, error {{ .err }}, please try again!"
ErrLicenseSync: "Failed to sync license information, no license information detected in the database!"
ErrXpackNotFound: "This section is a professional edition feature, please import the license first in Panel Settings-License interface"
Expand Down
1 change: 1 addition & 0 deletions backend/i18n/lang/ru.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ ErrIPExist: "IP уже существует"
#license
ErrLicense: "Ошибка формата лицензии, пожалуйста, проверьте и попробуйте снова!"
ErrLicenseCheck: "Проверка лицензии не выполнена, пожалуйста, проверьте и попробуйте снова!"
ErrXpackVersion: "Ошибка проверки лицензии, эта лицензия ограничена по версии и не может быть успешно импортирована. Пожалуйста, проверьте и попробуйте снова!";
ErrLicenseSave: "Не удалось сохранить информацию о лицензии, ошибка {{ .err }}, пожалуйста, попробуйте снова!"
ErrLicenseSync: "Не удалось синхронизировать информацию о лицензии, в базе данных не обнаружена информация о лицензии!"
ErrXpackNotFound: "Этот раздел является функцией профессионального издания, пожалуйста, сначала импортируйте лицензию в интерфейсе Настройки панели — Лицензия"
Expand Down
1 change: 1 addition & 0 deletions backend/i18n/lang/zh-Hant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ ErrIPExist: "IP 已存在"
#license
ErrLicense: "許可證格式錯誤,請檢查後重試!"
ErrLicenseCheck: "許可證校驗失敗,請檢查後重試!"
ErrXpackVersion: "許可證校驗失敗,該許可證受版本限制,無法成功導入,請檢查後重試!";
ErrLicenseSave: "許可證資訊保存失敗,錯誤 {{ .err }}, 請重試!"
ErrLicenseSync: "許可證資訊同步失敗,資料庫中未檢測到許可證資訊!"
ErrXpackNotFound: "該部分為專業版功能,請先在 面板設定-許可證 界面導入許可證"
Expand Down
1 change: 1 addition & 0 deletions backend/i18n/lang/zh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ ErrIPExist: "IP 已存在"
#license
ErrLicense: "许可证格式错误,请检查后重试!"
ErrLicenseCheck: "许可证校验失败,请检查后重试!"
ErrXpackVersion: "许可证校验失败,该许可证受版本限制,无法成功导入,请检查后重试!"
ErrLicenseSave: "许可证信息保存失败,错误 {{ .err }},请重试!"
ErrLicenseSync: "许可证信息同步失败,数据库中未检测到许可证信息!"
ErrXpackNotFound: "该部分为专业版功能,请先在 面板设置-许可证 界面导入许可证"
Expand Down
Loading