This commit is contained in:
guanghongwei
2015-04-09 11:27:36 +08:00
parent 2b14fefb5c
commit ff77cc28fa
12 changed files with 195 additions and 24 deletions

View File

@@ -24,6 +24,7 @@
<!-- highcharts -->
<script src="/static/js/highcharts/highcharts.js"></script>
<script src="/static/js/dropzone/dropzone.js"></script>
<!-- active menu -->
<script>
var str = document.location.pathname.split("/")[1];

View File

@@ -8,3 +8,4 @@
<!-- validator js -->
<script src="/static/js/validator/jquery.validator.js"></script>
<script src="/static/js/validator/zh_CN.js"></script>

View File

@@ -0,0 +1,44 @@
{% load mytags %}
<html>
<head>
{% include 'link_css.html' %}
<style type="text/css">
body
{
background: #FFFFFF;
}
</style>
</head>
<body>
<div class="row">
<div class="contact-box">
<h2 class="text-center">{{ cmd_group.name }} 命令详情</h2>
<div class="ibox-content">
<table class="table table-striped table-bordered table-hover " id="editable" >
<thead>
<tr>
<td class="text-center" width="120">ID</td>
<td class="text-center">名称</td>
<td class="text-center">部门</td>
</tr>
</thead>
<tbody>
<tr class="gradeX">
<td class="text-center">{{ cmd_group.id }}</td>
<td class="text-center">{{ cmd_group.name }}</td>
<td class="text-center">{{ cmd_group.dept.name }}</td>
</tr>
<tr>
<td colspan="1" class="text-center">命令:</td>
<td colspan="6" class="text-center">
<b>{{ cmd_group.cmd }}</b>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>

View File

@@ -69,7 +69,7 @@
<td class="text-center"><a href="/juser/user_list/?gid={{ group.id }}">{{ group.id | member_count }} </a> </td>
<td class="text-center"><a href="/jasset/group_list/?sid={{ group.id }}">{{ group.id | ugrp_perm_agrp_count }} </a> </td>
<td class="text-center"><a href="/jasset/host_list/?sid={{ group.id }}"> {{ group.id | ugrp_perm_asset_count }} </a> </td>
<td class="text-center"> {{ group.id | ugrp_perm_asset_count }} </td>
<td class="text-center"><a value="/jperm/cmd_detail/?id={{ group.id }}" class="iframe">{{ group.id | sudo_cmd_count }}</a> </td>
<td class="text-center"> {{ group.comment }} </td>
<td class="text-center">
<a href="../sudo_edit/?id={{ group.id }}" class="btn btn-xs btn-danger">sudo授权</a>
@@ -104,7 +104,20 @@
<script>
$(document).ready(function(){
$(".iframe").colorbox({iframe:true, width:"70%", height:"70%"});
$(".iframe").on('click', function(){
var url= $(this).attr("value");
$.layer({
type: 2,
title: '命令详情',
maxmin: true,
shift: 'top',
border: [2, 0.3, '#1AB394'],
shade: [0.5, '#000000'],
shadeClose: true,
area : ['800px' , '600px'],
iframe: {src: url}
});
});
$("#refresh").click(function(){
$.get('/jperm/sudo_refresh/',
{'test':''},

View File

@@ -7,3 +7,5 @@
<link href="/static/css/vaildator/jquery.validator.css" rel="stylesheet">
<link href="/static/css/magnific/magnific-popup.css" rel="stylesheet">
<link href="/static/css/plugins/fullcalendar/fullcalendar.css" rel="stylesheet">
<link href="/static/css/plugins/dropzone/basic.css" rel="stylesheet">
<link href="/static/css/plugins/dropzone/dropzone.css" rel="stylesheet">

80
templates/upload.html Normal file
View File

@@ -0,0 +1,80 @@
{% extends 'base.html' %}
{% load mytags %}
{% load humanize %}
{% block content %}
{% include 'nav_cat_bar.html' %}
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Dropzone Area</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-wrench"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="#">Config option 1</a>
</li>
<li><a href="#">Config option 2</a>
</li>
</ul>
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="ibox-content">
<form id="my-awesome-dropzone" class="dropzone" action="#">
<div class="dropzone-previews"></div>
<button type="submit" class="btn btn-primary pull-right">Submit this form!</button>
</form>
<div>
<div class="m text-right"><small>DropzoneJS is an open source library that provides drag'n'drop file uploads with image previews: <a href="https://github.com/enyo/dropzone" target="_blank">https://github.com/enyo/dropzone</a></small> </div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
Dropzone.options.myAwesomeDropzone = {
autoProcessQueue: false,
uploadMultiple: true,
parallelUploads: 100,
maxFiles: 100,
url: '/upload/',
// Dropzone settings
init: function() {
var myDropzone = this;
this.element.querySelector("button[type=submit]").addEventListener("click", function(e) {
e.preventDefault();
e.stopPropagation();
myDropzone.processQueue();
});
this.on("sendingmultiple", function() {
});
this.on("successmultiple", function(files, response) {
alert(files)
});
this.on("errormultiple", function(files, response) {
});
}
}
});
</script>
{% endblock %}