Skip to content

Commit

Permalink
merge: with remote
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuler committed May 27, 2024
2 parents f16ec02 + 0ea2339 commit f95cbd6
Show file tree
Hide file tree
Showing 27 changed files with 203 additions and 143 deletions.
2 changes: 1 addition & 1 deletion apps/acls/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def gen_test_msg(cls):


class AssetLoginReminderMsg(UserMessage):
subject = _('Asset login reminder')
subject = _('User login alert for asset')

def __init__(self, user, asset: Asset, login_user: User, account: Account, input_username):
self.asset = asset
Expand Down
17 changes: 10 additions & 7 deletions apps/acls/templates/acls/asset_login_reminder.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{% load i18n %}

<h3>{% trans 'Respectful' %}: {{ recipient.name }}[{{ recipient.username }}]</h3>
<h3>{% trans 'Dear' %}: {{ recipient.name }}[{{ recipient.username }}]</h3>
<hr>
<p><strong>{% trans 'User' %}:</strong> [{{ name }}({{ username }})]</p>
<p><strong>{% trans 'Assets' %}:</strong> [{{ asset }}]</p>
<p><strong>{% trans 'Account' %}:</strong> [{{ account_name }}({{ account }})]</p>
<p>{% trans 'We would like to inform you that a user has recently logged into the following asset:' %}<p>
<p><strong>{% trans 'Asset details' %}:</strong></p>
<ul>
<li><strong>{% trans 'User' %}:</strong> [{{ name }}({{ username }})]</li>
<li><strong>{% trans 'Assets' %}:</strong> [{{ asset }}]</li>
<li><strong>{% trans 'Account' %}:</strong> [{{ account_name }}({{ account }})]</li>
</ul>
<hr>

<p>{% trans 'The user has just logged in to the asset. Please ensure that this is an authorized operation. If you suspect that this is an unauthorized access, please take appropriate measures immediately.' %}</p>

<p>{% trans 'Thank you' %}!</p>
<p>{% trans 'Please review the login activity to ensure the security and proper usage of the asset. If you did not authorize this login or if you notice any suspicious activity, please take the necessary actions immediately.' %}</p>

<p>{% trans 'Thank you for your attention to this matter' %}!</p>
20 changes: 11 additions & 9 deletions apps/acls/templates/acls/user_login_reminder.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{% load i18n %}

<h3>{% trans 'Respectful' %}: {{ recipient.name }}[{{ recipient.username }}]</h3>
<h3>{% trans 'Dear' %}: {{ recipient.name }}[{{ recipient.username }}]</h3>
<hr>
<p><strong>{% trans 'User' %}:</strong> [{{ username }}]</p>
<p><strong>IP:</strong> [{{ ip }}]</p>
<p><strong>{% trans 'Login city' %}:</strong> [{{ city }}]</p>
<p><strong>{% trans 'User agent' %}:</strong> [{{ user_agent }}]</p>
<p>{% trans 'We would like to inform you that a user has recently logged:' %}<p>
<p><strong>{% trans 'User details' %}:</strong></p>
<ul>
<li><strong>{% trans 'User' %}:</strong> [{{ username }}]</li>
<li><strong>IP:</strong> [{{ ip }}]</li>
<li><strong>{% trans 'Login city' %}:</strong> [{{ city }}]</li>
<li><strong>{% trans 'User agent' %}:</strong> [{{ user_agent }}]</li>
</ul>
<hr>

<p>{% trans 'The user has just successfully logged into the system. Please ensure that this is an authorized operation. If you suspect that this is an unauthorized access, please take appropriate measures immediately.' %}</p>

<p>{% trans 'Thank you' %}!</p>

<p>{% trans 'Please review the login activity to ensure the security and proper usage of the asset. If you did not authorize this login or if you notice any suspicious activity, please take the necessary actions immediately.' %}</p>
<p>{% trans 'Thank you for your attention to this matter' %}!</p>
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{% load i18n %}
<p>{% trans 'Hello' %} {{ name }},</p>
<p>{% trans 'Dear' %} {{ name }},</p>

<p>
{% trans 'Your password has just been successfully updated' %}
</p>
<p>
<b>{% trans 'IP' %}:</b> {{ ip_address }} <br />
<b>{% trans 'IP' %}:</b> {{ ip_address }} <br/>
<b>{% trans 'Browser' %}:</b> {{ browser }}
</p>
-
<p>
{% trans 'If the password update was not initiated by you, your account may have security issues' %} <br />
{% trans 'If the password update was not initiated by you, your account may have security issues' %} <br/>
{% trans 'If you have any questions, you can contact the administrator' %}
</p>
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{% load i18n %}
<p>{% trans 'Hello' %} {{ name }},</p>
<p>{% trans 'Dear' %} {{ name }},</p>

<p>
{% trans 'Your public key has just been successfully updated' %}
</p>
<p>
<b>{% trans 'IP' %}:</b> {{ ip_address }} <br />
<b>{% trans 'IP' %}:</b> {{ ip_address }} <br/>
<b>{% trans 'Browser' %}:</b> {{ browser }}
</p>
-
<p>
{% trans 'If the public key update was not initiated by you, your account may have security issues' %} <br />
{% trans 'If the public key update was not initiated by you, your account may have security issues' %} <br/>
{% trans 'If you have any questions, you can contact the administrator' %}
</p>
1 change: 1 addition & 0 deletions apps/common/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def _find(attr):


def add_encrypted_field_set(label):
return
if label:
with translation.override('en'):
encrypted_field_set.add(str(label))
54 changes: 33 additions & 21 deletions apps/i18n/core/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-05-27 16:41+0800\n"
"POT-Creation-Date: 2024-05-22 18:28+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -858,7 +858,7 @@ msgstr ""

#: accounts/serializers/account/account.py:453 acls/serializers/base.py:116
#: acls/templates/acls/asset_login_reminder.html:5
#: acls/templates/acls/user_login_reminder.html:5
#: acls/templates/acls/user_login_reminder.html:7
#: assets/models/cmd_filter.py:24 assets/models/label.py:16 audits/models.py:54
#: audits/models.py:90 audits/models.py:172 audits/models.py:269
#: audits/serializers.py:171 authentication/models/connection_token.py:32
Expand Down Expand Up @@ -1095,7 +1095,6 @@ msgstr ""

#: accounts/templates/accounts/change_secret_failed_info.html:5
#: acls/templates/acls/asset_login_reminder.html:3
#: acls/templates/acls/user_login_reminder.html:3
msgid "Respectful"
msgstr ""

Expand Down Expand Up @@ -1263,7 +1262,7 @@ msgid "User login reminder"
msgstr ""

#: acls/notifications.py:42
msgid "Asset login reminder"
msgid "User login alert for asset"
msgstr ""

#: acls/serializers/base.py:11 acls/serializers/login_acl.py:11
Expand Down Expand Up @@ -1324,27 +1323,44 @@ msgid ""
msgstr ""

#: acls/templates/acls/asset_login_reminder.html:12
#: acls/templates/acls/user_login_reminder.html:13
msgid "Thank you"
msgstr ""

#: acls/templates/acls/user_login_reminder.html:7 audits/models.py:194
#: acls/templates/acls/user_login_reminder.html:3
msgid "Dear"
msgstr ""

#: acls/templates/acls/user_login_reminder.html:5
msgid ""
"We would like to inform you that a user has recently logged into the "
"following asset:"
msgstr ""

#: acls/templates/acls/user_login_reminder.html:6
msgid "Asset details"
msgstr ""

#: acls/templates/acls/user_login_reminder.html:9 audits/models.py:194
#: audits/models.py:263
#: authentication/templates/authentication/_msg_different_city.html:11
#: tickets/models/ticket/login_confirm.py:11
msgid "Login city"
msgstr ""

#: acls/templates/acls/user_login_reminder.html:8 audits/models.py:197
#: acls/templates/acls/user_login_reminder.html:10 audits/models.py:197
#: audits/models.py:264 audits/serializers.py:68
msgid "User agent"
msgstr ""

#: acls/templates/acls/user_login_reminder.html:11
#: acls/templates/acls/user_login_reminder.html:13
msgid ""
"The user has just successfully logged into the system. Please ensure that "
"this is an authorized operation. If you suspect that this is an unauthorized "
"access, please take appropriate measures immediately."
"Please review the login activity to ensure the security and proper usage of "
"the asset. If you did not authorize this login or if you notice any "
"suspicious activity, please take the necessary actions immediately."
msgstr ""

#: acls/templates/acls/user_login_reminder.html:15
msgid "Thank you for your attention to this matter"
msgstr ""

#: assets/api/asset/asset.py:180
Expand Down Expand Up @@ -3975,7 +3991,7 @@ msgstr ""

#: jumpserver/context_processor.py:14
msgid "JumpServer Open Source Bastion Host"
msgstr ""
msgstr "JumpServer"

#: jumpserver/views/celery_flower.py:22
msgid "<h1>Flower service unavailable, check it</h1>"
Expand Down Expand Up @@ -4390,12 +4406,12 @@ msgid "Server performance"
msgstr ""

#: ops/notifications.py:25
msgid "Terminal health check warning"
msgid "Component health check warning"
msgstr ""

#: ops/notifications.py:70
#, python-brace-format
msgid "The terminal is offline: {name}"
msgid "The component is offline: {name}"
msgstr ""

#: ops/notifications.py:75
Expand Down Expand Up @@ -4685,7 +4701,7 @@ msgid "day"
msgstr ""

#: perms/notifications.py:15
msgid "You permed assets is about to expire"
msgid "The asset you authorized is about to expire"
msgstr ""

#: perms/notifications.py:20
Expand Down Expand Up @@ -5802,10 +5818,6 @@ msgstr ""
msgid "Virtual app"
msgstr ""

#: settings/serializers/feature.py:148
msgid "vApp"
msgstr ""

#: settings/serializers/feature.py:150
msgid ""
"Virtual applications, you can use the Linux operating system as an "
Expand Down Expand Up @@ -6223,7 +6235,7 @@ msgid "Registration periodic import ldap user task"
msgstr ""

#: settings/templates/ldap/_msg_import_ldap_user.html:2
msgid "Sync task Finish"
msgid "Sync task finish"
msgstr ""

#: settings/templates/ldap/_msg_import_ldap_user.html:6
Expand Down Expand Up @@ -6479,7 +6491,7 @@ msgstr ""

#: templates/_without_nav_base.html:26
msgid "Home page"
msgstr ""
msgstr "Home"

#: templates/resource_download.html:18 templates/resource_download.html:33
#: users/const.py:65
Expand Down

0 comments on commit f95cbd6

Please sign in to comment.