Commit bcc57743 authored by ibuler's avatar ibuler

ӳɹҳ

parent d6171f7f
...@@ -205,7 +205,7 @@ def print_prompt(): ...@@ -205,7 +205,7 @@ def print_prompt():
1) Type \033[32mIP ADDRESS\033[0m To Login. 1) Type \033[32mIP ADDRESS\033[0m To Login.
2) Type \033[32mP/p\033[0m To Print The Servers You Available. 2) Type \033[32mP/p\033[0m To Print The Servers You Available.
3) Type \033[32mG/g\033[0m To Print The Server Groups You Available. 3) Type \033[32mG/g\033[0m To Print The Server Groups You Available.
4) Type \033[32mG/g+gid\033[0m To Print The Server Group Hosts You Available. 4) Type \033[32mG/g(1-N)\033[0m To Print The Server Group Hosts You Available.
5) Type \033[32mE/e\033[0m To Execute Command On Several Servers. 5) Type \033[32mE/e\033[0m To Execute Command On Several Servers.
6) Type \033[32mQ/q\033[0m To Quit. 6) Type \033[32mQ/q\033[0m To Quit.
""" """
......
#coding: utf-8 # coding: utf-8
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
import json import json
...@@ -14,6 +15,7 @@ import datetime ...@@ -14,6 +15,7 @@ import datetime
import subprocess import subprocess
from django.core.paginator import Paginator, EmptyPage, InvalidPage from django.core.paginator import Paginator, EmptyPage, InvalidPage
from django.http import HttpResponse, Http404 from django.http import HttpResponse, Http404
from django.shortcuts import render_to_response
from juser.models import User, UserGroup, DEPT from juser.models import User, UserGroup, DEPT
from jasset.models import Asset, BisGroup, IDC from jasset.models import Asset, BisGroup, IDC
from jlog.models import Log from jlog.models import Log
...@@ -470,11 +472,6 @@ def verify(request, user_group=None, user=None, asset_group=None, asset=None, ed ...@@ -470,11 +472,6 @@ def verify(request, user_group=None, user=None, asset_group=None, asset=None, ed
return True return True
def get_dept_asset(request):
dept_id = get_user_dept(request)
dept_asset = DEPT.objects.get(id=dept_id).asset_set.all()
def bash(cmd): def bash(cmd):
"""执行bash命令""" """执行bash命令"""
return subprocess.call(cmd, shell=True) return subprocess.call(cmd, shell=True)
...@@ -486,3 +483,7 @@ def is_dir(dir_name, username='root', mode=0755): ...@@ -486,3 +483,7 @@ def is_dir(dir_name, username='root', mode=0755):
bash("chown %s:%s '%s'" % (username, username, dir_name)) bash("chown %s:%s '%s'" % (username, username, dir_name))
os.chmod(dir_name, mode) os.chmod(dir_name, mode)
def success(request, msg):
return render_to_response('success.html', locals())
This diff is collapsed.
...@@ -240,9 +240,7 @@ def install(request): ...@@ -240,9 +240,7 @@ def install(request):
User(id=5000, username="admin", password=md5_crypt('admin'), User(id=5000, username="admin", password=md5_crypt('admin'),
name='admin', email='admin@jumpserver.org', role='SU', is_active=True, dept=dept).save() name='admin', email='admin@jumpserver.org', role='SU', is_active=True, dept=dept).save()
User(id=5001, username="group_admin", password=md5_crypt('group_admin'), return success(request, u'安装成功')
name='group_admin', email='group_admin@jumpserver.org', role='DA', is_active=True, dept=dept2).save()
return HttpResponse('Ok')
def download(request): def download(request):
......
...@@ -2,29 +2,21 @@ ...@@ -2,29 +2,21 @@
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> 登录 | JumpServer</title>
<title>JumpServer | Login</title>
<link rel="shortcut icon" href="/static/img/facio.ico" type="image/x-icon"> <link rel="shortcut icon" href="/static/img/facio.ico" type="image/x-icon">
<link href="/static/css/bootstrap.min.css" rel="stylesheet"> <link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/font-awesome/css/font-awesome.css" rel="stylesheet"> <link href="/static/font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="/static/css/animate.css" rel="stylesheet"> <link href="/static/css/animate.css" rel="stylesheet">
<link href="/static/css/style.css" rel="stylesheet"> <link href="/static/css/style.css" rel="stylesheet">
</head> </head>
<body class="gray-bg"> <body class="gray-bg">
<div class="middle-box text-center loginscreen animated fadeInDown"> <div class="middle-box text-center loginscreen animated fadeInDown">
<div> <div>
<div> <div>
<h1 class="logo-name"><img src="/static/img/logo.png"></h1> <h1 class="logo-name"><img src="/static/img/logo.png"></h1>
</div> </div>
{% if error %} {% if error %}
<div class="alert alert-danger text-center">{{ error }}</div> <div class="alert alert-danger text-center">{{ error }}</div>
...@@ -39,7 +31,7 @@ ...@@ -39,7 +31,7 @@
</div> </div>
<button type="submit" class="btn btn-primary block full-width m-b">Login</button> <button type="submit" class="btn btn-primary block full-width m-b">Login</button>
<a href="#"><small>Forgot password?</small></a> <a href="#"><small>Forgot password? Contact Administrator. </small></a>
</form> </form>
<p class="m-t"> <small><b>Copyright</b> Jumpserver.org Organization © 2014-2015</small> </p> <p class="m-t"> <small><b>Copyright</b> Jumpserver.org Organization © 2014-2015</small> </p>
</div> </div>
......
<div class="col-sm-6">
<div class="dataTables_paginate paging_simple_numbers" id="editable_paginate">
<ul class="pagination" style="margin-top: 0; float: right">
{% if keyword %}
{% if contacts.has_previous %}
<li class="paginate_button previous" aria-controls="editable" tabindex="0" >
<a href="?keyword={{ keyword }}&page={{ contacts.previous_page_number }}">Previous</a>
</li>
{% else %}
<li class="paginate_button previous disabled" aria-controls="editable" tabindex="0" >
<a href="#">Previous</a>
</li>
{% endif %}
{% set href="" %}
{% if gid %}
{% set href=href+"&gid="+gid %}
{% endif %}
{% if did %}
{% set href=href+"&did="+did %}
{% endif %}
{% if keyword %}
{% set href=href+"&keyword"+keyword %}
{% endif %}
{% ifequal show_first 1 %}
<li class="paginate_button" aria-controls="editable" tabindex="0"><a href="?page=1{{ href }}" title="第1页">1...</a></li>
{% endifequal %}
{% for page in page_range %}
{% ifequal current_page page %}
<li class="paginate_button active" aria-controls="editable" tabindex="0"><a href="?page={{ page }}{{ href }}" title="第{{ page }}页">{{ page }}</a></li>
{% else %}
<li class="paginate_button" aria-controls="editable" tabindex="0"><a href="?page={{ page }}{{ href }}" title="第{{ page }}页">{{ page }}</a></li>
{% endifequal %}
{% endfor %}
{% ifequal show_end 1 %}
<li class="paginate_button" aria-controls="editable" tabindex="0"><a href="?page={{ p.num_pages }}{{ href }}" title="第{{ page }}页">...{{ p.num_pages }}</a></li>
{% endifequal %}
{% if contacts.has_next %}
<li class="paginate_button next" aria-controls="editable" tabindex="0" >
<a href="?page={{ contacts.next_page_number }}{{ href }}">Next</a>
</li>
{% else %}
<li class="paginate_button next disabled" aria-controls="editable" tabindex="0" >
<a href="#">Next</a>
</li>
{% endif %}
{% else %}
{% if contacts.has_previous %}
<li class="paginate_button previous" aria-controls="editable" tabindex="0" >
<a class="test" href="?page={{ contacts.previous_page_number }}{{ href }}">Previous</a>
</li>
{% else %}
<li class="paginate_button previous disabled" aria-controls="editable" tabindex="0" >
<a href="#">Previous</a>
</li>
{% endif %}
{% ifequal show_first 1 %}
<li class="paginate_button" aria-controls="editable" tabindex="0"><a class="test" href="?page=1{{ href }}" title="第1页">1...</a></li>
{% endifequal %}
{% for page in page_range %}
{% ifequal current_page page %}
<li class="paginate_button active" aria-controls="editable" tabindex="0"><a class="test" href="?page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
{% else %}
<li class="paginate_button" aria-controls="editable" tabindex="0"><a class="test" href="?page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
{% endifequal %}
{% endfor %}
{% ifequal show_end 1 %}
<li class="paginate_button" aria-controls="editable" tabindex="0"><a class="test" href="?page={{ p.num_pages }}" title="第{{ page }}页">...{{ p.num_pages }}</a></li>
{% endifequal %}
{% if contacts.has_next %}
<li class="paginate_button next" aria-controls="editable" tabindex="0" >
<a class="test" href="?page={{ contacts.next_page_number }}">Next</a>
</li>
{% else %}
<li class="paginate_button next disabled" aria-controls="editable" tabindex="0" >
<a class="test" href="#">Next</a>
</li>
{% endif %}
{% endif %}
</ul>
</div>
</div>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jumpserver | Success</title>
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="/static/css/animate.css" rel="stylesheet">
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="middle-box text-center animated fadeInDown">
<h1>成功</h1>
<h3 class="font-bold">{{ msg }}</h3>
<div class="error-desc">
The server success response the request. Congratulations.<br/>
You can go back to main page: <br/><a href="/" class="btn btn-primary m-t">仪表盘</a>
</div>
</div>
<!-- Mainly scripts -->
<script src="/static/js/jquery-2.1.1.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment