Merge branch 'guanghongwei'

Conflicts:
	jumpserver/views.py
	static/js/base.js
	templates/head_script.html
pull/6/head
guanghongwei 2015-03-01 12:26:52 +08:00
commit da1beef94d
3 changed files with 12 additions and 24 deletions

View File

@ -1,32 +1,25 @@
#coding: utf-8 #coding: utf-8
import hashlib import hashlib
<<<<<<< HEAD
import ldap import ldap
from ldap import modlist from ldap import modlist
from Crypto.Cipher import AES from Crypto.Cipher import AES
from binascii import b2a_hex, a2b_hex from binascii import b2a_hex, a2b_hex
from ConfigParser import ConfigParser from ConfigParser import ConfigParser
import os import os
=======
import datetime import datetime
import json import json
>>>>>>> wangyong
from django.db.models import Count from django.db.models import Count
from django.shortcuts import render_to_response from django.shortcuts import render_to_response
from django.http import HttpResponse from django.http import HttpResponse
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
from django.template import RequestContext from django.template import RequestContext
<<<<<<< HEAD
from juser.models import User
=======
from django.core.paginator import Paginator, EmptyPage, InvalidPage from django.core.paginator import Paginator, EmptyPage, InvalidPage
from django.template import RequestContext
from juser.models import User from juser.models import User
from jlog.models import Log from jlog.models import Log
>>>>>>> wangyong
from jasset.models import Asset, BisGroup, IDC from jasset.models import Asset, BisGroup, IDC
BASE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) BASE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
@ -45,10 +38,6 @@ def md5_crypt(string):
return hashlib.new("md5", string).hexdigest() return hashlib.new("md5", string).hexdigest()
<<<<<<< HEAD
def base(request):
return render_to_response('base.html', context_instance=RequestContext(request))
=======
def getDaysByNum(num): def getDaysByNum(num):
today = datetime.date.today() today = datetime.date.today()
oneday = datetime.timedelta(days=1) oneday = datetime.timedelta(days=1)
@ -61,6 +50,8 @@ def getDaysByNum(num):
li_str.reverse() li_str.reverse()
t = (li_date, li_str) t = (li_date, li_str)
return t return t
def base(request):
return render_to_response('base.html', context_instance=RequestContext(request))
def index(request): def index(request):
@ -91,7 +82,6 @@ def api_user(request):
users = Log.objects.filter(is_finished=0).count() users = Log.objects.filter(is_finished=0).count()
ret = {'users': users} ret = {'users': users}
return HttpResponse(json.dumps(ret)) return HttpResponse(json.dumps(ret))
>>>>>>> wangyong
def skin_config(request): def skin_config(request):
@ -102,9 +92,10 @@ def jasset_group_add(name, comment, jtype):
if BisGroup.objects.filter(name=name): if BisGroup.objects.filter(name=name):
emg = u'该业务组已存在!' emg = u'该业务组已存在!'
else: else:
<<<<<<< HEAD
BisGroup.objects.create(name=name, comment=comment, type=type) BisGroup.objects.create(name=name, comment=comment, type=type)
smg = u'业务组%s添加成功' % name smg = u'业务组%s添加成功' % name
BisGroup.objects.create(name=name, comment=comment, type=jtype)
smg = u'业务组%s添加成功' %name
class ServerError(Exception): class ServerError(Exception):
@ -117,10 +108,6 @@ def page_list_return(total, current=1):
return range(min_page, max_page+1) return range(min_page, max_page+1)
=======
BisGroup.objects.create(name=name, comment=comment, type=jtype)
smg = u'业务组%s添加成功' %name
>>>>>>> wangyong
def jasset_host_edit(j_id, j_ip, j_idc, j_port, j_type, j_group, j_active, j_comment): def jasset_host_edit(j_id, j_ip, j_idc, j_port, j_type, j_group, j_active, j_comment):

View File

@ -59,8 +59,6 @@ function GetTableDataBox() {
return returnData; return returnData;
} }
<<<<<<< HEAD
=======
function move(from, to) { function move(from, to) {
$("#" + from + " option").each(function () { $("#" + from + " option").each(function () {
if ($(this).prop("selected") == true) { if ($(this).prop("selected") == true) {
@ -83,7 +81,7 @@ function move_all(from, to) {
$("#" + to).append(this); $("#" + to).append(this);
}); });
} }
>>>>>>> wangyong
function selectAll(){ function selectAll(){
var checklist = document.getElementsByName ("selected"); var checklist = document.getElementsByName ("selected");
@ -103,3 +101,9 @@ function selectAll(){
} }
function move_all(from, to){
$("#"+from).children().each(function(){
$("#"+to).append(this);
});
}

View File

@ -1,12 +1,9 @@
<script src="/static/js/jquery-2.1.1.js"></script> <script src="/static/js/jquery-2.1.1.js"></script>
<script src="/static/js/bootstrap.min.js"></script> <script src="/static/js/bootstrap.min.js"></script>
<script src="/static/js/base.js"></script> <script src="/static/js/base.js"></script>
<<<<<<< HEAD
<!-- pop windows --> <!-- pop windows -->
<script src="/static/js/jquery.colorbox.js"></script> <script src="/static/js/jquery.colorbox.js"></script>
=======
>>>>>>> wangyong
<!-- validator js --> <!-- validator js -->
<script src="/static/js/validator/jquery.validator.js"></script> <script src="/static/js/validator/jquery.validator.js"></script>