feat: 自定义footer (#12795)

Co-authored-by: feng <1304903146@qq.com>
Co-authored-by: feng626 <57284900+feng626@users.noreply.github.com>
pull/12801/head
fit2bot 2024-03-12 14:36:20 +08:00 committed by GitHub
parent d0117b5a91
commit cbd812ab5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 42 additions and 49 deletions

View File

@ -12,8 +12,7 @@ default_interface = dict((
('login_title', _('JumpServer Open Source Bastion Host')),
('theme', 'classic_green'),
('theme_info', {}),
('beian_link', ''),
('beian_text', '')
('footer_content', ''),
))
default_context = {

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3294ac306300777a26f8bb7e637f0c7253a1bd63d7e99fe7394c43c4686eb57a
size 174018
oid sha256:ae77da5492a55a89e2e236abd214aaad7ac339914b3bf9561bbe0202235367de
size 173946

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-11 18:22+0800\n"
"POT-Creation-Date: 2024-03-12 14:19+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"
@ -9178,14 +9178,10 @@ msgid "Theme"
msgstr "テーマ"
#: xpack/plugins/interface/models.py:42
msgid "Beian link"
msgstr "公安オンライン申告ジャンプリンク"
msgid "Footer content"
msgstr "フッターの内容"
#: xpack/plugins/interface/models.py:43
msgid "Beian text"
msgstr "公安網登録番号"
#: xpack/plugins/interface/models.py:46 xpack/plugins/interface/models.py:87
#: xpack/plugins/interface/models.py:45 xpack/plugins/interface/models.py:86
msgid "Interface setting"
msgstr "インターフェイスの設定"

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a5a2e571ec46b7ba7f4f4f69287e2c25d4e9319c40a52de3b12ddbefded9b6f8
size 142448
oid sha256:f2458e4f094bf4dd660e6f12436fb0e22533f5080a022e19b20a2138ffb3cb47
size 142385

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: JumpServer 0.3.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-11 18:22+0800\n"
"POT-Creation-Date: 2024-03-12 14:19+0800\n"
"PO-Revision-Date: 2021-05-20 10:54+0800\n"
"Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: JumpServer team<ibuler@qq.com>\n"
@ -9051,14 +9051,10 @@ msgid "Theme"
msgstr "主题"
#: xpack/plugins/interface/models.py:42
msgid "Beian link"
msgstr "公安联网备案跳转链接"
msgid "Footer content"
msgstr "页脚内容"
#: xpack/plugins/interface/models.py:43
msgid "Beian text"
msgstr "公安联网备案号"
#: xpack/plugins/interface/models.py:46 xpack/plugins/interface/models.py:87
#: xpack/plugins/interface/models.py:45 xpack/plugins/interface/models.py:86
msgid "Interface setting"
msgstr "界面设置"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

View File

@ -9,6 +9,28 @@
<script src="{% static "js/jumpserver.js" %}?v=9"></script>
<script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
<script src="{% static 'js/plugins/select2/i18n/zh-CN.js' %}"></script>
<script src="{% static 'js/plugins/markdown-it.min.js' %}"></script>
{% if INTERFACE.footer_content %}
<style>
.markdown-footer a {
color: inherit;
}
.markdown-footer {
position: absolute;
left: 50%;
transform: translate(-50%, -50%);
@media (min-width: 768px) {
top: 97%;
}
}
</style>
<div id="markdown-output" class="markdown-footer"></div>
{% endif %}
<script type="text/markdown"> {{ INTERFACE.footer_content }} </script>
<script>
activeNav("{{ FORCE_SCRIPT_NAME }}");
$(document).ready(function () {
@ -18,34 +40,12 @@
$('.tooltip').tooltip();
}
$.fn.select2.defaults.set('language', getUserLang())
const md = window.markdownit();
const markdownContent = document.querySelector('script[type="text/markdown"]').textContent;
document.getElementById('markdown-output').innerHTML = md.render(markdownContent);
});
</script>
{% if INTERFACE.beian_text %}
<style>
.footer_beian a {
color: #737373;
}
.footer_beian {
position: absolute;
left: 50%;
transform: translate(-50%, -50%);
@media (min-width: 768px) {
top: 97%;
}
}
.footer_beian img {
width: 16px;
height: 16px;
object-fit: contain;
}
</style>
<div class="footer_beian">
<img alt="beian" src="{% static "img/beian.png" %}"/>
<a target="_blank" rel="noopener noreferrer"
href={{ INTERFACE.beian_link }}>
{{ INTERFACE.beian_text }}
</a>
</div>
{% endif %}