资产管理页面开始,增加添加资产页面,修改base页面等

pull/6/head
halcyon 2015-01-05 18:21:34 +08:00
parent ccb4876d88
commit 7a86ba0b51
7 changed files with 150 additions and 8 deletions

8
jasset/urls.py Normal file
View File

@ -0,0 +1,8 @@
# coding:utf-8
from django.conf.urls import patterns, include, url
from jasset.views import *
urlpatterns = patterns('',
url(r'^$', index),
url(r'jadd', jadd),
)

View File

@ -1,3 +1,16 @@
#coding:utf-8
from django.shortcuts import render
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
# Create your views here.
def index(request):
return render_to_response('jasset/jasset.html',)
def jadd(request):
if request.method == 'POST':
pass
return render_to_response('jasset/jadd.html',)

View File

@ -3,10 +3,7 @@ from django.contrib import admin
from jumpserver import views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'jumpserver.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^jasset/', include('jasset.urls')),
url(r'^admin/', include(admin.site.urls)),
(r'^base/$', views.base),
)

View File

@ -21,7 +21,7 @@
<div class="row border-bottom">
{% include 'nav_bar_header.html' %}
</div>
{{ content }}
{% block content %}{% endblock %}
{% include 'footer.html' %}
</div>
</div>

113
templates/jasset/jadd.html Normal file
View File

@ -0,0 +1,113 @@
{% extends 'base.html' %}
{% block content %}
<h1>添加主机</h1>
<div class="row">
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>请在以下填写主机详细信息</h5>
</div>
<div class="ibox-content">
<form method="get" class="form-horizontal">
<div class="form-group"><label class="col-sm-2 control-label">IP地址</label>
<div class="col-sm-10"><input type="text" placeholder="192.168.1.1" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label">端口号</label>
<div class="col-sm-10"><input type="text" placeholder="22" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label"> 登录方式 </label>
<div class="col-sm-10">
<div class="radio i-checks"><label> <input type="radio" checked="" value="option1" name="a" onclick="show(this)"> <i> LDAP </i></label></div>
<div class="radio i-checks"><label> <input type="radio" value="option2" name="a" onclick="show(this)"> <i> SSH_KEY </i></label></div>
<div class="radio i-checks"><label> <input type="radio" value="option3" name="a" onclick="show(this)"> <i> SSH_PASSWORD </i></label></div>
<div class="radio i-checks"><label> <input type="radio" value="option4" name="a" onclick="show(this)"> <i> JUMPSER_MAP </i></label></div>
</div>
<div name="a1" id=a1 style="display:none;">
<div class="form-group"><label class="col-sm-2 col-sm-offset-1 control-label"> 普通用户名 </label>
<div class="col-sm-8"><input type="text" placeholder="lilei" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 col-sm-offset-1 control-label"> 普通用户密码 </label>
<div class="col-sm-8"><input type="password" placeholder="Password" class="form-control" name="password"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 col-sm-offset-1 control-label"> 超管用户名 </label>
<div class="col-sm-8"><input type="text" placeholder="root" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 col-sm-offset-1 control-label"> 超管用户密码 </label>
<div class="col-sm-8"><input type="password" placeholder="Password" class="form-control" name="password"></div>
</div>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label"> 所属IDC </label>
<div class="col-sm-10"><input type="text" placeholder="北京联通" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label"> 所属业务组 </label>
<div class="col-sm-10"><input type="text" placeholder="数据库" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label"> 是否激活 </label>
<div class="col-sm-10">
<div class="radio i-checks"><label> <input type="radio" checked="" value="o1" name="b"> <i> 激活 </i></label></div>
<div class="radio i-checks"><label> <input type="radio" value="o2" name="b"> <i> 禁用 </i></label></div>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label"> 密码 </label>
<div class="col-sm-10"><input type="password" placeholder="Password" class="form-control" name="password"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-2 control-label"> 备注 </label>
<div class="col-sm-10"><input type="text" placeholder="hadoop01" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="col-sm-4 col-sm-offset-5">
<button class="btn btn-white" type="submit"> 重置 </button>
<button class="btn btn-primary" type="submit"> 提交 </button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script>
var showFlag={};
function show(o){
showFlag[o.name]=o.value;
if(showFlag.a=="option4"){
document.getElementById("a1").style.display="";
}
else{
document.getElementById("a1").style.display="none";
}};
</script>
{% endblock %}

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>资产管理</title>
</head>
<body>
<h1>welocome!</h1>
</body>
</html>

View File

@ -25,7 +25,7 @@
<a href="mailbox.html"><i class="fa fa-cube"></i> <span class="nav-label">资产管理</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="/asset/showlist/">查看资产</a></li>
<li><a href="/asset/add/">添加资产</a></li>
<li><a href="/jasset/jadd/">添加资产</a></li>
<li><a href="/idc/showlist/">查看机房</a></li>
<li><a href="/idc/add/">添加机房</a></li>
</ul>
@ -54,7 +54,8 @@
</ul>
</li>
<li class="special_link">
<!--<li class="special_link">-->
<li>
<a href="http://www.jumpserver.org" target="_blank"><i class="fa fa-database"></i> <span class="nav-label">访问官网</span></a>
</li>
</ul>