perf: Modify the layout to flex

pull/15760/head
wangruidong 2025-07-18 15:50:50 +08:00 committed by 老广
parent c4a348aac6
commit 6095e9c9bd
5 changed files with 148 additions and 112 deletions

View File

@ -69,23 +69,27 @@
}
.login-content {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
height: 500px;
width: 1000px;
margin-top: auto;
margin-bottom: auto;
}
body {
position: relative;
box-sizing: border-box;
min-height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
width: 100vw;
height: 100vh;
background-color: #f3f3f3;
{#height: calc(100vh - (100vh - 470px) / 3);#}
}
.captcha {
float: right;
}
@ -330,7 +334,8 @@
</h2>
<ul class=" nav navbar-top-links navbar-right">
<li class="dropdown">
<a class="dropdown-toggle login-page-language" data-bs-toggle="dropdown" href="#" target="_blank">
<a class="dropdown-toggle login-page-language" data-bs-toggle="dropdown" href="#"
target="_blank">
<i class="fa fa-globe fa-lg" style="margin-right: 2px"></i>
<span>{{ current_lang.title }}<b class="caret"></b></span>
</a>
@ -447,6 +452,7 @@
$('#password-hidden').val(passwordEncrypted); //返回给密码输入input
$('#login-form').submit(); //post提交
}
function checkHealth() {
let url = "{% url 'health' %}";
requestApi({
@ -455,6 +461,7 @@
flash_message: false,
})
}
setInterval(checkHealth, 30 * 1000);
</script>
</html>

View File

@ -15,22 +15,36 @@
<style>
.passwordBox {
max-width: 560px;
margin: 0 auto;
margin-bottom: auto;
padding: 100px 20px 20px 20px;
width: 100%;
}
.ibox-content {
padding: 30px;
}
.ibox-context-margin {
margin: 20px 0 0 0;
}
body {
box-sizing: border-box;
min-height: 100%;
display: flex;
align-items: center;
flex-direction: column;
}
.wrapper {
margin: auto;
}
</style>
{% block custom_head_css_js %} {% endblock %}
</head>
<body class="gray-bg">
<div class="passwordBox animated fadeInDown">
<div class="passwordBox animated fadeInDown">
<div class="row">
<div class="col-md-12">
<div class="ibox-content">
@ -49,7 +63,7 @@
{% include '_copyright.html' %}
</div>
</div>
</div>
</div>
</body>
{% include '_foot_js.html' %}
{% block custom_foot_js %} {% endblock %}

View File

@ -18,14 +18,9 @@
}
.markdown-footer {
position: absolute;
bottom: 0;
left: 50%;
flex-grow: 0;
flex-shrink: 0;
width: 285px;
transform: translate(-50%, -50%);
@media (min-width: 768px) {
top: 97%;
}
}
.markdown-footer p {

View File

@ -3,19 +3,39 @@
<!DOCTYPE html>
<html>
<head>
<head>
<meta charset="UTF-8">
<title> {{ INTERFACE.login_title }} </title>
<link rel="shortcut icon" href="{{ INTERFACE.favicon }}" type="image/x-icon">
{% include '_head_css_js.html' %}
<link href="{% static 'css/jumpserver.css' %}" rel="stylesheet">
<link href="{% static 'css/style.css' %}" rel="stylesheet">
<link rel="stylesheet" href="{% static 'css/otp.css' %}" />
<link rel="stylesheet" href="{% static 'css/otp.css' %}"/>
<script src="{% static "js/plugins/qrcode/qrcode.js" %}"></script>
</head>
<style>
body {
box-sizing: border-box;
min-height: 100%;
display: flex;
align-items: center;
flex-direction: column;
}
<body style="background-color: #f3f3f4">
<header>
header {
width: 100%;
flex-grow: 0;
flex-shrink: 0;
}
.wrapper {
margin: auto;
}
</style>
</head>
<body style="background-color: #f3f3f4">
<header>
<div class="logo">
<a href="{% url 'index' %}">
<img src="{{ INTERFACE.logo_logout }}" alt="" width="50px" height="50px"/>
@ -25,17 +45,17 @@
<div>
<a href="{% url 'index' %}">{% trans 'Home page' %}</a>
</div>
</header>
<body>
</header>
<div class="wrapper">
{% block body %}
{% endblock %}
</body>
<footer>
</div>
<footer>
<div style="margin-top: 100px;">
{% include '_copyright.html' %}
</div>
</footer>
{% include '_foot_js.html' %}
</body>
</footer>
{% include '_foot_js.html' %}
</body>
</html>

View File

@ -35,23 +35,23 @@
{% include '_foot_js.html' %}
{% block custom_foot_js %} {% endblock %}
<script>
function getMessagePathKey() {
function getMessagePathKey() {
var path = window.location.pathname;
var key = 'message_' + btoa(path);
return key
}
}
$(document).ready(function () {
$(document).ready(function () {
var pathKey = getMessagePathKey();
var hidden = window.localStorage.getItem(pathKey);
var hasMessage = $('.page-message').text().trim().length > 5;
if (!hidden && hasMessage) {
$(".help-message").show();
}
}).on('click', '.hide-btn', function () {
}).on('click', '.hide-btn', function () {
var pathKey = getMessagePathKey();
window.localStorage.setItem(pathKey, '1')
})
})
</script>
</html>