Skip to content

Commit

Permalink
feat: 优化excel模板, 添加国际化相关翻译(closed #2437)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpyoung3 committed Nov 19, 2024
2 parents f2f2a69 + 3625e1d commit c020c1d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion apps/node_man/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ def _get_member__alias_map(cls) -> Dict[Enum, str]:
cls.LOGIN_PORT: _("登录端口"),
cls.LOGIN_ACCOUNT: _("登录账号"),
cls.AUTH_TYPE: _("认证方式"),
cls.CREDENTIALS: _("密码/密钥"),
cls.CREDENTIALS: _("密钥/密码"),
cls.OUTER_IP: _("外网 IP"),
cls.LOGIN_IP: _("登录 IP"),
cls.BIZ: _("业务"),
Expand Down
18 changes: 10 additions & 8 deletions apps/node_man/handlers/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,23 @@ def generate_excel_template(cls):
ExcelTools.set_font_style(describe_row_cell, font_size=12, color="000000")

if key == constants.ExcelField.OS_TYPE:
ExcelTools.create_dropdown(excel, 4, col, key.value, MAIN_SHEET_NAME, all_os)
ExcelTools.create_dropdown(excel, 4, col, str(excel_field[key]), MAIN_SHEET_NAME, all_os)
elif key == constants.ExcelField.INSTALL_CHANNEL:
ExcelTools.create_dropdown(excel, 4, col, key.value, MAIN_SHEET_NAME, all_install_channel)
ExcelTools.create_dropdown(excel, 4, col, str(excel_field[key]), MAIN_SHEET_NAME, all_install_channel)
elif key == constants.ExcelField.AUTH_TYPE:
ExcelTools.create_dropdown(excel, 4, col, key.value, MAIN_SHEET_NAME, all_auth_type)
ExcelTools.create_dropdown(excel, 4, col, str(excel_field[key]), MAIN_SHEET_NAME, all_auth_type)
elif key == constants.ExcelField.BIZ:
ExcelTools.create_dropdown(excel, 4, col, key.value, MAIN_SHEET_NAME, all_biz)
ExcelTools.create_dropdown(excel, 4, col, str(excel_field[key]), MAIN_SHEET_NAME, all_biz)
elif key == constants.ExcelField.CLOUD:
ExcelTools.create_dropdown(excel, 4, col, key.value, MAIN_SHEET_NAME, all_cloud)
ExcelTools.create_dropdown(excel, 4, col, str(excel_field[key]), MAIN_SHEET_NAME, all_cloud)
elif key == constants.ExcelField.AP:
ExcelTools.create_dropdown(excel, 4, col, key.value, MAIN_SHEET_NAME, all_ap)
ExcelTools.create_dropdown(excel, 4, col, str(excel_field[key]), MAIN_SHEET_NAME, all_ap)
elif key == constants.ExcelField.ADDRESS_TYPE:
ExcelTools.create_dropdown(excel, 4, col, key.value, MAIN_SHEET_NAME, all_addressing)
ExcelTools.create_dropdown(excel, 4, col, str(excel_field[key]), MAIN_SHEET_NAME, all_addressing)
elif key == constants.ExcelField.DATA_COMPRESSION:
ExcelTools.create_dropdown(excel, 4, col, key.value, MAIN_SHEET_NAME, all_enable_compression)
ExcelTools.create_dropdown(
excel, 4, col, str(excel_field[key]), MAIN_SHEET_NAME, all_enable_compression
)
else:
pass

Expand Down
Binary file modified locale/en/LC_MESSAGES/django.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -6688,7 +6688,7 @@ msgid "认证方式"
msgstr "Authentication"

#: apps/node_man/constants.py: 1247
msgid "密码/密钥"
msgid "密钥/密码"
msgstr "Key/Password"

#: apps/node_man/constants.py: 1248
Expand Down

0 comments on commit c020c1d

Please sign in to comment.