Example #1
0
def project(request):
    title = u'TOMCAT-工程列表'
    global username, role, clientip
    username = request.user.username
    try:
        role = request.user.userprofile.role
    except:
        role = 'none'
    clientip = request.META['REMOTE_ADDR']
    logger.info('%s is requesting %s' % (clientip, request.get_full_path()))
    return render(request, LimitAccess(role, 'tomcat/tomcat_project.html'), {
        'title': title,
        'clientip': clientip,
        'role': role,
        'username': username,
    })
Example #2
0
def Id(request):
    global username, role, clientip
    username = request.user.username
    try:
        role = request.user.userprofile.role
    except:
        role = 'none'
    global clientip
    clientip = request.META['REMOTE_ADDR']
    title = u'SALTSTACK-ID管理'
    logger.info('%s is requesting. %s' % (clientip, request.get_full_path()))
    return render(request, LimitAccess(role, 'saltstack/saltstack_id.html'), {
        'clientip': clientip,
        'title': title,
        'role': role,
        'username': username,
    })
Example #3
0
def OpHistory(request):
    global username, role, clientip
    username = request.user.username
    try:
        role = request.user.userprofile.role
    except:
        role = 'none'
    global clientip
    clientip = request.META['REMOTE_ADDR']
    title = u'升级-操作记录'
    logger.info('%s is requesting. %s' % (clientip, request.get_full_path()))
    return render(request, LimitAccess(role, 'upgrade/op_history.html'), {
        'clientip': clientip,
        'title': title,
        'role': role,
        'username': username,
    })
Example #4
0
def command(request):
    global username, role, clientip
    username = request.user.username
    try:
        role = request.user.userprofile.role
    except:
        role = 'none'
    clientip = request.META['REMOTE_ADDR']
    title = u'SALTSTACK-命令管理'
    logger.info('%s is requesting.' % clientip)
    return render(request, LimitAccess(role, 'saltstack/saltstack_index.html'),
                  {
                      'clientip': clientip,
                      'title': title,
                      'role': role,
                      'username': username,
                  })
Example #5
0
def Operate(request):
    global username, role, clientip
    username = request.user.username
    try:
        role = request.user.userprofile.role
    except:
        role = 'none'
    global clientip
    clientip = request.META['REMOTE_ADDR']
    title = u'升级-基本操作'
    logger.info('%s is requesting.' % clientip)
    return render(
        request, LimitAccess(role, 'upgrade/upgrade_operate.html'), {
            'clientip': clientip,
            'title': title,
            'role': role,
            'username': username,
            'upgrade_api': settings.UPGRADE_API,
        })
Example #6
0
def Domains(request):
    title = u'monitor-监控列表'
    global username, role, clientip
    username = request.user.username
    try:
        role = request.user.userprofile.role
    except:
        role = 'none'
    if request.META.has_key('HTTP_X_FORWARDED_FOR'):
        clientip = request.META['HTTP_X_FORWARDED_FOR']
    else:
        clientip = request.META['REMOTE_ADDR']
    logger.info('%s is requesting %s' % (clientip, request.get_full_path()))
    return render(request, LimitAccess(role, 'monitor/domains.html'), {
        'title': title,
        'clientip': clientip,
        'role': role,
        'username': username,
    })
Example #7
0
def index(request):
    title = u'检测中心'
    global username, role, clientip
    username = request.user.username
    try:
        role = request.user.userprofile.role
    except:
        role = 'none'
    clientip = request.META['REMOTE_ADDR']
    logger.info('%s is requesting %s' %(clientip, request.get_full_path()))
    return render(
        request,
        LimitAccess(role, 'detect/detect_index.html'),
        {
            #'title': title,
            'clientip':clientip,
            'role': role,
            'username': username,
        }
    )
Example #8
0
def home(request):
    title = u'默认主页'
    global username, role, clientip
    username = request.user.username
    try:
        role = request.user.userprofile.role
    except:
        role = 'none'
    group = request.user.get_group_permissions()
    if request.user.has_perm('check_tomcat.add_tomcat_url'):
        auth = 'welcome!'
    else:
        auth = 'back off!'
    clientip = request.META['REMOTE_ADDR']
    logger.info('%s is requesting %s' % (clientip, request.get_full_path()))
    return render(
        request, LimitAccess(role, 'home/home.html'), {
            'title': title,
            'clientip': clientip,
            'role': role,
            'username': username,
            'auth': auth,
            'group': group,
        })