2016-09-01 15:09:58 +00:00
{% load static %}
2016-09-03 16:51:36 +00:00
{% load i18n %}
2016-09-01 15:09:58 +00:00
<!DOCTYPE html>
< html >
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
2019-03-27 04:20:43 +00:00
< title > {{ JMS_TITLE }} < / title >
2019-03-29 11:14:18 +00:00
< link rel = "shortcut icon" href = "{{ FAVICON_URL }}" type = "image/x-icon" >
2016-09-01 15:09:58 +00:00
{% include '_head_css_js.html' %}
< link href = "{% static " css / jumpserver . css " % } " rel = "stylesheet" >
2018-09-03 03:24:25 +00:00
< script type = "text/javascript" src = "{% url 'javascript-catalog' %}" > < / script >
2016-09-01 15:09:58 +00:00
< script src = "{% static " js / jumpserver . js " % } " > < / script >
2018-06-05 09:26:31 +00:00
< script type = "text/javascript" src = "{% static 'js/pwstrength-bootstrap.js' %}" > < / script >
2016-09-01 15:09:58 +00:00
< / head >
< body class = "gray-bg" >
< div class = "loginColumns animated fadeInDown" >
< div class = "row" >
< div class = "col-md-6" >
2018-09-03 03:24:25 +00:00
< h2 class = "font-bold" > {% trans 'Welcome to the Jumpserver open source fortress' %}< / h2 >
2016-09-01 15:09:58 +00:00
< p >
2018-09-03 03:24:25 +00:00
{% trans 'Jumpserver is an open source desktop system developed using Python and Django that helps Internet businesses with efficient users, assets, permissions, and audit management' %}
2016-09-01 15:09:58 +00:00
< / p >
< p >
2018-09-03 03:24:25 +00:00
{% trans 'We are from all over the world, we have great admiration and worship for the spirit of open source, we have endless pursuit for perfection, neatness and elegance' %}
2016-09-01 15:09:58 +00:00
< / p >
< p >
2018-09-03 03:24:25 +00:00
{% trans 'We focus on automatic operation and maintenance, and strive to build an easy-to-use, stable, safe and automatic board hopping machine, which is our unremitting pursuit and power' %}
2016-09-01 15:09:58 +00:00
< / p >
< p >
2018-09-03 03:24:25 +00:00
< small > {% trans 'Always young, always with tears in my eyes. Stay foolish Stay hungry' %}< / small >
2016-09-01 15:09:58 +00:00
< / p >
< / div >
< div class = "col-md-6" >
< div class = "ibox-content" >
2019-03-27 04:20:43 +00:00
< div > < img src = "{{ LOGO_URL }}" width = "82" height = "82" > < span class = "font-bold text-center" style = "font-size: 32px; font-family: inherit" > {% trans 'Reset password' %}< / span > < / div >
2016-09-01 15:09:58 +00:00
< form class = "m-t" role = "form" method = "post" action = "" >
{% csrf_token %}
{% if errors %}
< p class = "red-fonts" > {{ errors }}< / p >
{% endif %}
< div class = "form-group" >
2018-06-05 09:26:31 +00:00
< input type = "password" id = "id_new_password" class = "form-control" name = "password" placeholder = "{% trans 'Password' %}" required = "" >
{# 密码popover #}
< div id = "container" >
< div class = "popover fade bottom in" role = "tooltip" id = "popover777" style = " display: none; width:260px;" >
< div class = "arrow" style = "left: 50%;" > < / div >
< h3 class = "popover-title" style = "display: none;" > < / h3 >
< h4 > {% trans 'Your password must satisfy' %}< / h4 > < div id = "id_password_rules" style = "color: #908a8a; margin-left:20px; font-size:15px;" > < / div >
< h4 style = "margin-top: 10px;" > {% trans 'Password strength' %}< / h4 > < div id = "id_progress" > < / div >
< div class = "popover-content" > < / div >
< / div >
< / div >
2016-09-01 15:09:58 +00:00
< / div >
< div class = "form-group" >
2018-06-05 09:26:31 +00:00
< input type = "password" id = "id_confirm_password" class = "form-control" name = "password-confirm" placeholder = "{% trans 'Password again' %}" required = "" >
2016-09-01 15:09:58 +00:00
< / div >
2016-09-03 16:51:36 +00:00
< button type = "submit" class = "btn btn-primary block full-width m-b" > {% trans "Setting" %}< / button >
2016-09-01 15:09:58 +00:00
< a href = "#" >
< small > Forgot password?< / small >
< / a >
< p class = "text-muted text-center" >
< / p >
< / form >
< p class = "m-t" >
< / p >
< / div >
< / div >
< / div >
< hr / >
< div class = "row" >
2018-02-28 03:23:04 +00:00
< div class = "col-md-12" >
{% include '_copyright.html' %}
2016-09-01 15:09:58 +00:00
< / div >
< / div >
< / div >
< / body >
< / html >
2018-06-05 09:26:31 +00:00
< script >
$(document).ready(function () {
// 密码强度校验
var el = $('#id_password_rules'),
idPassword = $('#id_new_password'),
idPopover = $('#popover777'),
container = $('#container'),
progress = $('#id_progress'),
password_check_rules = {{ password_check_rules|safe }},
2018-11-22 04:27:27 +00:00
minLength = 6,
2018-08-01 02:44:43 +00:00
top = 146, left = 170,
i18n_fallback = {
"veryWeak": "{% trans 'Very weak' %}",
"weak": "{% trans 'Weak' %}",
"normal": "{% trans 'Normal' %}",
"medium": "{% trans 'Medium' %}",
"strong": "{% trans 'Strong' %}",
"veryStrong": "{% trans 'Very strong' %}"
};
2018-06-05 09:26:31 +00:00
2018-11-22 04:27:27 +00:00
jQuery.each(password_check_rules, function (idx, rules) {
if(rules.key === 'id_security_password_min_length'){
minLength = rules.value
}
});
2018-06-05 09:26:31 +00:00
// 初始化popover
2018-08-01 02:44:43 +00:00
initPopover(container, progress, idPassword, el, password_check_rules, i18n_fallback);
2018-06-05 09:26:31 +00:00
// 监听事件
idPassword.on('focus', function () {
idPopover.css('top', top);
idPopover.css('left', left);
idPopover.css('display', 'block');
});
idPassword.on('blur', function () {
idPopover.css('display', 'none');
});
idPassword.on('keyup', function(){
var password = idPassword.val();
checkPasswordRules(password, minLength);
})
})
< / script >