Skip to content

Commit

Permalink
1.5.6.3
Browse files Browse the repository at this point in the history
1.5.6.3
  • Loading branch information
hequan2017 committed Jul 26, 2017
1 parent 317768b commit a981c3e
Show file tree
Hide file tree
Showing 11 changed files with 537 additions and 427 deletions.
388 changes: 186 additions & 202 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Binary file modified db.sqlite3
Binary file not shown.
Binary file modified hostinfo/__pycache__/views.cpython-36.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions hostinfo/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from index.models import Business
import paramiko
from django.contrib.auth.decorators import permission_required, login_required
import time
#
# from hostinfo.ansible_runner.runner import PlayBookRunner
#
Expand Down
Binary file modified jigui/__pycache__/views.cpython-36.pyc
Binary file not shown.
9 changes: 5 additions & 4 deletions jigui/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.shortcuts import render, redirect
from django.shortcuts import render, redirect,HttpResponse
from jigui import models
from django.contrib.auth.decorators import permission_required,login_required

import json
@login_required(login_url="/login.html",)
def jigui(request): ##首页
jigui = models.JiguiInfo.objects.filter(id__gt=0)
Expand Down Expand Up @@ -104,10 +104,11 @@ def show(request): ## 展示

@login_required(login_url="/login.html")
def delete_jigui(request):
ret = {'status': True, 'error': None, 'data': None}
if request.method == "POST":
ids = request.POST.getlist('id')
idstring = ','.join(ids)
models.JiguiInfo.objects.extra(where=['id IN (' + idstring + ')']).delete()

jigui = models.JiguiInfo.objects.filter(id__gt=0)
return render(request, 'jigui/jigui.html', {"jigui_list": jigui, })

return HttpResponse(json.dumps(ret))
9 changes: 9 additions & 0 deletions templates/foot_script.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@

<script>

$("#CheckedAll").click(function () {
if ($(this).is(":checked")) {
$("[name=id]:checkbox").prop("checked", true);
} else {
$("[name=id]:checkbox").prop("checked", false);
}
});


$(function () {
$('#cmd').click(function () {
$.ajax({
Expand Down
458 changes: 261 additions & 197 deletions templates/host/host.html

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions templates/jigui/add.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="row">


<div class="col-lg-12">
<div class="col-lg-6">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5 style="color:red;"> {{ msg }} 机柜
Expand Down Expand Up @@ -58,57 +58,57 @@ <h5 style="color:red;"> {{ msg }} 机柜
<div class="form-group"><label class="col-sm-2 control-label">机房</label>


<div class="col-lg-4 col-sm-10">
<div class="col-lg-6 col-sm-10">
<input type="text" class="form-control" name="name" required="">
</div></div>
<div class="hr-line-dashed"></div>


<div class="form-group"><label class="col-sm-2 control-label">总数</label>

<div class="col-lg-4 col-sm-10"><input type="text" class="form-control" name="jq" required="">
<div class="col-lg-6 col-sm-10"><input type="text" class="form-control" name="jq" required="">
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label">在用</label>

<div class="col-lg-4 col-sm-10"><input type="text" class="form-control" name="zy" required="">
<div class="col-lg-6 col-sm-10"><input type="text" class="form-control" name="zy" required="">
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label">自用</label>

<div class="col-lg-4 col-sm-10"><input type="text" class="form-control" name="ziy" required=""><span class="help-block m-b-none">添加自用设备</span>
<div class="col-lg-6 col-sm-10"><input type="text" class="form-control" name="ziy" required=""><span class="help-block m-b-none">添加自用设备</span>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label">在售</label>

<div class="col-lg-4 col-sm-10"><input type="text" class="form-control" name="zs" required="">
<div class="col-lg-6 col-sm-10"><input type="text" class="form-control" name="zs" required="">
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label">整包</label>

<div class="col-lg-4 col-sm-10"><input type="text" class="form-control" name="zb" required="">
<div class="col-lg-6 col-sm-10"><input type="text" class="form-control" name="zb" required="">
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label">散户</label>

<div class="col-lg-4 col-sm-10"><input type="text" class="form-control" name="sh" required="">
<div class="col-lg-6 col-sm-10"><input type="text" class="form-control" name="sh" required="">
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label">闲置</label>
<div class="col-lg-4 col-sm-10"><input type="text" class="form-control" name="xz" required="">
<div class="col-lg-6 col-sm-10"><input type="text" class="form-control" name="xz" required="">
</div>
</div>
<div class="hr-line-dashed"></div>


<div class="form-group"><label class="col-sm-2 control-label">多选</label>
<div class="col-lg-4 col-sm-10">
<div class="col-lg-6 col-sm-10">
{% for row in dx_list %}
<label class="checkbox-inline "> <input type="checkbox" value="{{ row.id }}" name="dx" >{{ row.xuan }}</label>

Expand Down
77 changes: 64 additions & 13 deletions templates/jigui/jigui.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@


{% block page-content %}


<div class="wrapper wrapper-content animated fadeInRight">


<div class="row">
<div class="col-lg-12">
<div class="ibox float-e-margins">
Expand All @@ -50,12 +54,16 @@ <h5>机柜 </h5>

</div>
<div class="ibox-content">
<form class="form-horizontal" action="/jigui/jigui-del.html" method="POST" >

{% csrf_token %}
<div class="table-responsive">
<button class="btn btn-primary" type="submit" >批量删除
</button>

<a class="btn btn-danger" data-toggle="modal"
data-target="#myModa5" >批量删除
</a>

<form id="del_form_jigui" class="form-horizontal" >


<table class="table table-striped table-bordered table-hover dataTables-example">
<thead>

Expand Down Expand Up @@ -92,9 +100,9 @@ <h5>机柜 </h5>
</tfoot>

</table>

</form>
</div>
</form>

</div>
</div>
</div>
Expand All @@ -103,23 +111,66 @@ <h5>机柜 </h5>


</div>

<div class="modal inmodal" id="myModa5" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content animated fadeIn">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span
aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<i class="fa fa-clock-o modal-icon"></i>
<h4 class="modal-title">删除</h4>
<span id="error2" style="color:red;"></span>
<small></small>
</div>
<form id="del_form">
<div class="modal-body">


<p><strong>确定删除</strong></p>
</div>
<div class="modal-footer">
<button class="btn btn-white" data-dismiss="modal">关闭</button>
<a class="btn btn-primary jigui_del " >批量删除</a>
</div>
</form>
</div>
</div>
</div>





</div>



{% endblock %}


{% block js %}
<script>


$("#CheckedAll").click(function () {
if ($(this).is(":checked")) {
$("[name=id]:checkbox").prop("checked", true);
} else {
$("[name=id]:checkbox").prop("checked", false);
}
});


$(function () {
$('.jigui_del').click(function () {
$.ajax({
url: "/jigui/jigui-del.html",
type: 'POST',
data: $('#del_form_jigui').serialize(),
success: function (data) {
var obj = JSON.parse(data);
if (obj.status) {
location.reload()
}
}

})
})
})

</script>
{% endblock %}
2 changes: 1 addition & 1 deletion templates/jigui/xiangxi.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

<div class="wrapper wrapper-content animated fadeInRight">
<div class="row">
<div class="col-lg-12">
<div class="col-lg-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h4> <a id="ji" type="button">基本信息 </a> &nbsp;|&nbsp; <a id="gao" type="button">高级信息 </a></h4>
Expand Down

0 comments on commit a981c3e

Please sign in to comment.