add install wizzird

pull/26/head
ibuler 2015-12-15 14:45:37 +08:00
parent 2496f1c654
commit f3606dfd96
12 changed files with 1376 additions and 37 deletions

View File

@ -13,6 +13,7 @@ urlpatterns = patterns('jumpserver.views',
url(r'^file/download/$', 'download', name='file_download'), url(r'^file/download/$', 'download', name='file_download'),
url(r'^setting', 'setting', name='setting'), url(r'^setting', 'setting', name='setting'),
url(r'^terminal/$', 'web_terminal', name='terminal'), url(r'^terminal/$', 'web_terminal', name='terminal'),
url(r'^install/$', 'install', name='install'),
url(r'^juser/', include('juser.urls')), url(r'^juser/', include('juser.urls')),
url(r'^jasset/', include('jasset.urls')), url(r'^jasset/', include('jasset.urls')),
url(r'^jlog/', include('jlog.urls')), url(r'^jlog/', include('jlog.urls')),

View File

@ -354,3 +354,7 @@ def web_terminal(request):
role_name = request.GET.get('role') role_name = request.GET.get('role')
web_terminal_uri = 'ws://%s/terminal?id=%s&role=%s' % (WEB_SOCKET_HOST, asset_id, role_name) web_terminal_uri = 'ws://%s/terminal?id=%s&role=%s' % (WEB_SOCKET_HOST, asset_id, role_name)
return render_to_response('jlog/web_terminal.html', locals()) return render_to_response('jlog/web_terminal.html', locals())
def install(request):
return render_to_response('test.html', locals())

View File

@ -0,0 +1,380 @@
/*
Common
*/
.wizard,
.tabcontrol
{
display: block;
width: 100%;
overflow: hidden;
}
.wizard a,
.tabcontrol a
{
outline: 0;
}
.wizard ul,
.tabcontrol ul
{
list-style: none !important;
padding: 0;
margin: 0;
}
.wizard ul > li,
.tabcontrol ul > li
{
display: block;
padding: 0;
}
/* Accessibility */
.wizard > .steps .current-info,
.tabcontrol > .steps .current-info
{
position: absolute;
left: -999em;
}
.wizard > .content > .title,
.tabcontrol > .content > .title
{
position: absolute;
left: -999em;
}
/*
Wizard
*/
.wizard > .steps
{
position: relative;
display: block;
width: 100%;
}
.wizard.vertical > .steps
{
display: inline;
float: left;
width: 30%;
}
.wizard > .steps > ul > li
{
width: 25%;
}
.wizard > .steps > ul > li,
.wizard > .actions > ul > li
{
float: left;
}
.wizard.vertical > .steps > ul > li
{
float: none;
width: 100%;
}
.wizard > .steps a,
.wizard > .steps a:hover,
.wizard > .steps a:active
{
display: block;
width: auto;
margin: 0 0.5em 0.5em;
padding: 8px;
text-decoration: none;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.wizard > .steps .disabled a,
.wizard > .steps .disabled a:hover,
.wizard > .steps .disabled a:active
{
background: #eee;
color: #aaa;
cursor: default;
}
.wizard > .steps .current a,
.wizard > .steps .current a:hover,
.wizard > .steps .current a:active
{
background: #1AB394;
color: #fff;
cursor: default;
}
.wizard > .steps .done a,
.wizard > .steps .done a:hover,
.wizard > .steps .done a:active
{
background: #6fd1bd;
color: #fff;
}
.wizard > .steps .error a,
.wizard > .steps .error a:hover,
.wizard > .steps .error a:active
{
background: #ED5565 ;
color: #fff;
}
.wizard > .content
{
background: #eee;
display: block;
margin: 5px 5px 10px 5px;
min-height: 120px;
overflow: hidden;
position: relative;
width: auto;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.wizard-big.wizard > .content {
min-height: 320px;
}
.wizard.vertical > .content
{
display: inline;
float: left;
margin: 0 2.5% 0.5em 2.5%;
width: 65%;
}
.wizard > .content > .body
{
float: left;
position: absolute;
width: 95%;
height: 95%;
padding: 2.5%;
}
.wizard > .content > .body ul
{
list-style: disc !important;
}
.wizard > .content > .body ul > li
{
display: list-item;
}
.wizard > .content > .body > iframe
{
border: 0 none;
width: 100%;
height: 100%;
}
.wizard > .content > .body input
{
display: block;
border: 1px solid #ccc;
}
.wizard > .content > .body input[type="checkbox"]
{
display: inline-block;
}
.wizard > .content > .body input.error
{
background: rgb(251, 227, 228);
border: 1px solid #fbc2c4;
color: #8a1f11;
}
.wizard > .content > .body label
{
display: inline-block;
margin-bottom: 0.5em;
}
.wizard > .content > .body label.error
{
color: #8a1f11;
display: inline-block;
margin-left: 1.5em;
}
.wizard > .actions
{
position: relative;
display: block;
text-align: right;
width: 100%;
}
.wizard.vertical > .actions
{
display: inline;
float: right;
margin: 0 2.5%;
width: 95%;
}
.wizard > .actions > ul
{
display: inline-block;
text-align: right;
}
.wizard > .actions > ul > li
{
margin: 0 0.5em;
}
.wizard.vertical > .actions > ul > li
{
margin: 0 0 0 1em;
}
.wizard > .actions a,
.wizard > .actions a:hover,
.wizard > .actions a:active
{
background: #1AB394;
color: #fff;
display: block;
padding: 0.5em 1em;
text-decoration: none;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.wizard > .actions .disabled a,
.wizard > .actions .disabled a:hover,
.wizard > .actions .disabled a:active
{
background: #eee;
color: #aaa;
}
.wizard > .loading
{
}
.wizard > .loading .spinner
{
}
/*
Tabcontrol
*/
.tabcontrol > .steps
{
position: relative;
display: block;
width: 100%;
}
.tabcontrol > .steps > ul
{
position: relative;
margin: 6px 0 0 0;
top: 1px;
z-index: 1;
}
.tabcontrol > .steps > ul > li
{
float: left;
margin: 5px 2px 0 0;
padding: 1px;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.tabcontrol > .steps > ul > li:hover
{
background: #edecec;
border: 1px solid #bbb;
padding: 0;
}
.tabcontrol > .steps > ul > li.current
{
background: #fff;
border: 1px solid #bbb;
border-bottom: 0 none;
padding: 0 0 1px 0;
margin-top: 0;
}
.tabcontrol > .steps > ul > li > a
{
color: #5f5f5f;
display: inline-block;
border: 0 none;
margin: 0;
padding: 10px 30px;
text-decoration: none;
}
.tabcontrol > .steps > ul > li > a:hover
{
text-decoration: none;
}
.tabcontrol > .steps > ul > li.current > a
{
padding: 15px 30px 10px 30px;
}
.tabcontrol > .content
{
position: relative;
display: inline-block;
width: 100%;
height: 35em;
overflow: hidden;
border-top: 1px solid #bbb;
padding-top: 20px;
}
.tabcontrol > .content > .body
{
float: left;
position: absolute;
width: 95%;
height: 95%;
padding: 2.5%;
}
.tabcontrol > .content > .body ul
{
list-style: disc !important;
}
.tabcontrol > .content > .body ul > li
{
display: list-item;
}

6
static/js/plugins/steps/jquery.steps.min.js vendored Executable file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,8 @@
if (s1 == ''){ if (s1 == ''){
$('#index').addClass('active') $('#index').addClass('active')
} else { } else {
$("#"+s1).addClass('active'); //$("#"+s1).addClass('active');
$('#'+s1+' .'+s2).addClass('active'); //$('#'+s1+' .'+s2).addClass('active');
console.log(s1)
} }
</script> </script>

634
templates/install.html Normal file
View File

@ -0,0 +1,634 @@
<html><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="/static/css/plugins/steps/jquery.steps.css" rel="'stylesheet">
<link href="/static/css/animate.css" rel="stylesheet">
<link href="/static/css/style.css" rel="stylesheet">
<style type="text/css"></style></head>
<script src="/static/js/plugins/steps/jquery.steps.min.js"></script>
<body>
<div id="wrapper">
<nav class="navbar-default navbar-static-side" role="navigation">
<div class="sidebar-collapse">
<ul class="nav" id="side-menu">
<li class="nav-header">
<div class="dropdown profile-element"> <span>
<img alt="image" class="img-circle" src="img/profile_small.jpg" />
</span>
<a data-toggle="dropdown" class="dropdown-toggle" href="#">
<span class="clear"> <span class="block m-t-xs"> <strong class="font-bold">David Williams</strong>
</span> <span class="text-muted text-xs block">Art Director <b class="caret"></b></span> </span> </a>
<ul class="dropdown-menu animated fadeInRight m-t-xs">
<li><a href="profile.html">Profile</a></li>
<li><a href="contacts.html">Contacts</a></li>
<li><a href="mailbox.html">Mailbox</a></li>
<li class="divider"></li>
<li><a href="login.html">Logout</a></li>
</ul>
</div>
<div class="logo-element">
IN+
</div>
</li>
<li>
<a href="index.html"><i class="fa fa-th-large"></i> <span class="nav-label">Dashboards</span> <span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="index.html">Dashboard v.1</a></li>
<li><a href="dashboard_2.html">Dashboard v.2</a></li>
<li><a href="dashboard_3.html">Dashboard v.3</a></li>
<li><a href="dashboard_4_1.html">Dashboard v.4</a></li>
</ul>
</li>
<li>
<a href="layouts.html"><i class="fa fa-diamond"></i> <span class="nav-label">Layouts</span> <span class="label label-primary pull-right">NEW</span></a>
</li>
<li>
<a href="#"><i class="fa fa-bar-chart-o"></i> <span class="nav-label">Graphs</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="graph_flot.html">Flot Charts</a></li>
<li><a href="graph_morris.html">Morris.js Charts</a></li>
<li><a href="graph_rickshaw.html">Rickshaw Charts</a></li>
<li><a href="graph_chartjs.html">Chart.js</a></li>
<li><a href="graph_peity.html">Peity Charts</a></li>
<li><a href="graph_sparkline.html">Sparkline Charts</a></li>
</ul>
</li>
<li>
<a href="mailbox.html"><i class="fa fa-envelope"></i> <span class="nav-label">Mailbox </span><span class="label label-warning pull-right">16/24</span></a>
<ul class="nav nav-second-level">
<li><a href="mailbox.html">Inbox</a></li>
<li><a href="mail_detail.html">Email view</a></li>
<li><a href="mail_compose.html">Compose email</a></li>
<li><a href="email_template.html">Email templates</a></li>
</ul>
</li>
<li>
<a href="widgets.html"><i class="fa fa-flask"></i> <span class="nav-label">Widgets</span> </a>
</li>
<li class="active">
<a href="#"><i class="fa fa-edit"></i> <span class="nav-label">Forms</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="form_basic.html">Basic form</a></li>
<li><a href="form_advanced.html">Advanced Plugins</a></li>
<li class="active"><a href="form_wizard.html">Wizard</a></li>
<li><a href="form_file_upload.html">File Upload</a></li>
<li><a href="form_editors.html">Text Editor</a></li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-desktop"></i> <span class="nav-label">App Views</span> <span class="pull-right label label-primary">SPECIAL</span></a>
<ul class="nav nav-second-level">
<li><a href="contacts.html">Contacts</a></li>
<li><a href="profile.html">Profile</a></li>
<li><a href="projects.html">Projects</a></li>
<li><a href="project_detail.html">Project detail</a></li>
<li><a href="file_manager.html">File manager</a></li>
<li><a href="calendar.html">Calendar</a></li>
<li><a href="faq.html">FAQ</a></li>
<li><a href="timeline.html">Timeline</a></li>
<li><a href="pin_board.html">Pin board</a></li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-files-o"></i> <span class="nav-label">Other Pages</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="search_results.html">Search results</a></li>
<li><a href="lockscreen.html">Lockscreen</a></li>
<li><a href="invoice.html">Invoice</a></li>
<li><a href="login.html">Login</a></li>
<li><a href="login_two_columns.html">Login v.2</a></li>
<li><a href="register.html">Register</a></li>
<li><a href="404.html">404 Page</a></li>
<li><a href="500.html">500 Page</a></li>
<li><a href="empty_page.html">Empty page</a></li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-globe"></i> <span class="nav-label">Miscellaneous</span><span class="label label-info pull-right">NEW</span></a>
<ul class="nav nav-second-level">
<li><a href="toastr_notifications.html">Notification</a></li>
<li><a href="nestable_list.html">Nestable list</a></li>
<li><a href="timeline_2.html">Timeline v.2</a></li>
<li><a href="forum_main.html">Forum view</a></li>
<li><a href="google_maps.html">Google maps</a></li>
<li><a href="code_editor.html">Code editor</a></li>
<li><a href="modal_window.html">Modal window</a></li>
<li><a href="validation.html">Validation</a></li>
<li><a href="tree_view.html">Tree view</a></li>
<li><a href="chat_view.html">Chat view</a></li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-flask"></i> <span class="nav-label">UI Elements</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="typography.html">Typography</a></li>
<li><a href="icons.html">Icons</a></li>
<li><a href="draggable_panels.html">Draggable Panels</a></li>
<li><a href="buttons.html">Buttons</a></li>
<li><a href="video.html">Video</a></li>
<li><a href="tabs_panels.html">Tabs & Panels</a></li>
<li><a href="notifications.html">Notifications & Tooltips</a></li>
<li><a href="badges_labels.html">Badges, Labels, Progress</a></li>
</ul>
</li>
<li>
<a href="grid_options.html"><i class="fa fa-laptop"></i> <span class="nav-label">Grid options</span></a>
</li>
<li>
<a href="#"><i class="fa fa-table"></i> <span class="nav-label">Tables</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="table_basic.html">Static Tables</a></li>
<li><a href="table_data_tables.html">Data Tables</a></li>
<li><a href="jq_grid.html">jqGrid</a></li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-picture-o"></i> <span class="nav-label">Gallery</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="basic_gallery.html">Lightbox Gallery</a></li>
<li><a href="carousel.html">Bootstrap Carusela</a></li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-sitemap"></i> <span class="nav-label">Menu Levels </span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="#">Third Level <span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li>
<a href="#">Third Level Item</a>
</li>
<li>
<a href="#">Third Level Item</a>
</li>
<li>
<a href="#">Third Level Item</a>
</li>
</ul>
</li>
<li><a href="#">Second Level Item</a></li>
<li>
<a href="#">Second Level Item</a></li>
<li>
<a href="#">Second Level Item</a></li>
</ul>
</li>
<li>
<a href="css_animation.html"><i class="fa fa-magic"></i> <span class="nav-label">CSS Animations </span><span class="label label-info pull-right">62</span></a>
</li>
<li class="landing_link">
<a target="_blank" href="Landing_page/index.html"><i class="fa fa-star"></i> <span class="nav-label">Landing Page</span> <span class="label label-warning pull-right">NEW</span></a>
</li>
<li class="special_link">
<a href="package.html"><i class="fa fa-database"></i> <span class="nav-label">Package</span></a>
</li>
</ul>
</div>
</nav>
<div id="page-wrapper" class="gray-bg">
<div class="row border-bottom">
<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
<form role="search" class="navbar-form-custom" method="post" action="search_results.html">
<div class="form-group">
<input type="text" placeholder="Search for something..." class="form-control" name="top-search" id="top-search">
</div>
</form>
</div>
<ul class="nav navbar-top-links navbar-right">
<li>
<span class="m-r-sm text-muted welcome-message">Welcome to INSPINIA+ Admin Theme.</span>
</li>
<li class="dropdown">
<a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
<i class="fa fa-envelope"></i> <span class="label label-warning">16</span>
</a>
<ul class="dropdown-menu dropdown-messages">
<li>
<div class="dropdown-messages-box">
<a href="profile.html" class="pull-left">
<img alt="image" class="img-circle" src="img/a7.jpg">
</a>
<div class="media-body">
<small class="pull-right">46h ago</small>
<strong>Mike Loreipsum</strong> started following <strong>Monica Smith</strong>. <br>
<small class="text-muted">3 days ago at 7:58 pm - 10.06.2014</small>
</div>
</div>
</li>
<li class="divider"></li>
<li>
<div class="dropdown-messages-box">
<a href="profile.html" class="pull-left">
<img alt="image" class="img-circle" src="img/a4.jpg">
</a>
<div class="media-body ">
<small class="pull-right text-navy">5h ago</small>
<strong>Chris Johnatan Overtunk</strong> started following <strong>Monica Smith</strong>. <br>
<small class="text-muted">Yesterday 1:21 pm - 11.06.2014</small>
</div>
</div>
</li>
<li class="divider"></li>
<li>
<div class="dropdown-messages-box">
<a href="profile.html" class="pull-left">
<img alt="image" class="img-circle" src="img/profile.jpg">
</a>
<div class="media-body ">
<small class="pull-right">23h ago</small>
<strong>Monica Smith</strong> love <strong>Kim Smith</strong>. <br>
<small class="text-muted">2 days ago at 2:30 am - 11.06.2014</small>
</div>
</div>
</li>
<li class="divider"></li>
<li>
<div class="text-center link-block">
<a href="mailbox.html">
<i class="fa fa-envelope"></i> <strong>Read All Messages</strong>
</a>
</div>
</li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
<i class="fa fa-bell"></i> <span class="label label-primary">8</span>
</a>
<ul class="dropdown-menu dropdown-alerts">
<li>
<a href="mailbox.html">
<div>
<i class="fa fa-envelope fa-fw"></i> You have 16 messages
<span class="pull-right text-muted small">4 minutes ago</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="profile.html">
<div>
<i class="fa fa-twitter fa-fw"></i> 3 New Followers
<span class="pull-right text-muted small">12 minutes ago</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="grid_options.html">
<div>
<i class="fa fa-upload fa-fw"></i> Server Rebooted
<span class="pull-right text-muted small">4 minutes ago</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<div class="text-center link-block">
<a href="notifications.html">
<strong>See All Alerts</strong>
<i class="fa fa-angle-right"></i>
</a>
</div>
</li>
</ul>
</li>
<li>
<a href="login.html">
<i class="fa fa-sign-out"></i> Log out
</a>
</li>
</ul>
</nav>
</div>
<div class="row wrapper border-bottom white-bg page-heading">
<div class="col-lg-10">
<h2>Wizard</h2>
<ol class="breadcrumb">
<li>
<a href="index.html">Home</a>
</li>
<li>
<a>Forms</a>
</li>
<li class="active">
<strong>Wizard</strong>
</li>
</ol>
</div>
<div class="col-lg-2">
</div>
</div>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="row">
<div class="col-lg-5">
<div class="jumbotron">
<h1>Steps</h1>
<p>Smart UI component which allows you to easily create wizard-like interfaces.</p>
<p><a href="http://www.jquery-steps.com/GettingStarted" target="_blank" class="btn btn-primary btn-lg" role="button">Learn more about jQuery Steps</a>
</p>
</div>
</div>
<div class="col-lg-7">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Basic Wizzard</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">
<p>
This is basic example of Step
</p>
<div id="wizard">
<h1>First Step</h1>
<div class="step-content">
<div class="text-center m-t-md">
<h2>Hello in Step 1</h2>
<p>
This is the first content.
</p>
</div>
</div>
<h1>Second Step</h1>
<div class="step-content">
<div class="text-center m-t-md">
<h2>This is step 2</h2>
<p>
This content is diferent than the first one.
</p>
</div>
</div>
<h1>Third Step</h1>
<div class="step-content">
<div class="text-center m-t-md">
<h2>This is step 3</h2>
<p>
This is last content.
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>Wizard with Validation</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">
<h2>
Validation Wizard Form
</h2>
<p>
This example show how to use Steps with jQuery Validation plugin.
</p>
<form id="form" action="#" class="wizard-big">
<h1>Account</h1>
<fieldset>
<h2>Account Information</h2>
<div class="row">
<div class="col-lg-8">
<div class="form-group">
<label>Username *</label>
<input id="userName" name="userName" type="text" class="form-control required">
</div>
<div class="form-group">
<label>Password *</label>
<input id="password" name="password" type="text" class="form-control required">
</div>
<div class="form-group">
<label>Confirm Password *</label>
<input id="confirm" name="confirm" type="text" class="form-control required">
</div>
</div>
<div class="col-lg-4">
<div class="text-center">
<div style="margin-top: 20px">
<i class="fa fa-sign-in" style="font-size: 180px;color: #e5e5e5 "></i>
</div>
</div>
</div>
</div>
</fieldset>
<h1>Profile</h1>
<fieldset>
<h2>Profile Information</h2>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label>First name *</label>
<input id="name" name="name" type="text" class="form-control required">
</div>
<div class="form-group">
<label>Last name *</label>
<input id="surname" name="surname" type="text" class="form-control required">
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label>Email *</label>
<input id="email" name="email" type="text" class="form-control required email">
</div>
<div class="form-group">
<label>Address *</label>
<input id="address" name="address" type="text" class="form-control">
</div>
</div>
</div>
</fieldset>
<h1>Warning</h1>
<fieldset>
<div class="text-center" style="margin-top: 120px">
<h2>You did it Man :-)</h2>
</div>
</fieldset>
<h1>Finish</h1>
<fieldset>
<h2>Terms and Conditions</h2>
<input id="acceptTerms" name="acceptTerms" type="checkbox" class="required"> <label for="acceptTerms">I agree with the Terms and Conditions.</label>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<div class="pull-right">
10GB of <strong>250GB</strong> Free.
</div>
<div>
<strong>Copyright</strong> Example Company &copy; 2014-2015
</div>
</div>
</div>
</div>
<!-- Mainly scripts -->
<script src="js/jquery-2.1.1.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- // <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
// <script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script> -->
<!-- Custom and plugin javascript -->
<!-- // <script src="js/inspinia.js"></script>
// <script src="js/plugins/pace/pace.min.js"></script> -->
<!-- Steps -->
<script src="js/plugins/staps/jquery.steps.min.js"></script>
<!-- Jquery Validate -->
<!-- // <script src="js/plugins/validate/jquery.validate.min.js"></script> -->
<script>
$(document).ready(function(){
$("#wizard").steps();
$("#form").steps({
bodyTag: "fieldset",
onStepChanging: function (event, currentIndex, newIndex)
{
// Always allow going backward even if the current step contains invalid fields!
if (currentIndex > newIndex)
{
return true;
}
// Forbid suppressing "Warning" step if the user is to young
if (newIndex === 3 && Number($("#age").val()) < 18)
{
return false;
}
var form = $(this);
// Clean up if user went backward before
if (currentIndex < newIndex)
{
// To remove error styles
$(".body:eq(" + newIndex + ") label.error", form).remove();
$(".body:eq(" + newIndex + ") .error", form).removeClass("error");
}
// Disable validation on fields that are disabled or hidden.
form.validate().settings.ignore = ":disabled,:hidden";
// Start validation; Prevent going forward if false
return form.valid();
},
onStepChanged: function (event, currentIndex, priorIndex)
{
// Suppress (skip) "Warning" step if the user is old enough.
if (currentIndex === 2 && Number($("#age").val()) >= 18)
{
$(this).steps("next");
}
// Suppress (skip) "Warning" step if the user is old enough and wants to the previous step.
if (currentIndex === 2 && priorIndex === 3)
{
$(this).steps("previous");
}
},
onFinishing: function (event, currentIndex)
{
var form = $(this);
// Disable validation on fields that are disabled.
// At this point it's recommended to do an overall check (mean ignoring only disabled fields)
form.validate().settings.ignore = ":disabled";
// Start validation; Prevent form submission if false
return form.valid();
},
onFinished: function (event, currentIndex)
{
var form = $(this);
// Submit form input
form.submit();
}
}).validate({
errorPlacement: function (error, element)
{
element.before(error);
},
rules: {
confirm: {
equalTo: "#password"
}
}
});
});
</script>
</body>
</html>

View File

@ -109,8 +109,8 @@
} }
}); });
$('#exec_cmd').click(function(){ $('#exec_cmd').click(function(){
var url = '{% url "role_get" %} '; var url = '{% url "role_get" %}';
var new_url = '{% url "exec_cmd" %}?role='; var new_url = '{% url "exec_cmd" %}?role=';
var check_array = []; var check_array = [];
$(".gradeX input:checked").closest('tr').find('.hostname a').each(function() { $(".gradeX input:checked").closest('tr').find('.hostname a').each(function() {
@ -155,11 +155,10 @@
}); });
$('.conn').click(function(){ $('.conn').click(function(){
var url='{% url "role_get" %}?id=' + $(this).attr('value'); var url='{% url "role_get" %}?id=' + $(this).attr('value'); // 获取用户有权限的角色
var href = $(this).attr('href'); var href = $(this).attr('href');
var new_url = '{% url "terminal" %}?id=' + $(this).attr('value') + '&role='; var new_url = '{% url "terminal" %}?id=' + $(this).attr('value') + '&role='; // webterminal socket url
var hostname = $(this).closest('tr').find('.hostname a')[0].innerHTML; var hostname = $(this).closest('tr').find('.hostname a')[0].innerHTML;
var title = 'Jumpserver Web Terminal' + '<span class="text-info"> '+ hostname +'</span>';
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: url, url: url,
@ -168,17 +167,19 @@
var dataArray = data.split(','); var dataArray = data.split(',');
if (data == 'error' || data == '' || data == null || data == undefined){ if (data == 'error' || data == '' || data == null || data == undefined){
layer.alert('没有授权系统用户') layer.alert('没有授权系统用户')
} else if (dataArray.length == 1 && data != 'error' && navigator.platform == 'Win32') { }
else if (dataArray.length == 1 && data != 'error' && navigator.platform == 'Win32'){
var title = 'Jumpserver Web Terminal' + '<span class="text-info"> '+ hostname +'</span>';
layer.open({ layer.open({
type: 2, type: 2,
title: title, title: title,
maxmin: true, maxmin: true,
shade: false, shade: false,
area: ['628px', '420px'], area: ['628px', '420px'],
content: new_url + data content: new_url+data
}); });
} else if (dataArray.length == 1 && data != 'error'){ } else if (dataArray.length == 1 && data != 'error'){
layer.open({ layer.open({
type: 2, type: 2,
title: title, title: title,
maxmin: true, maxmin: true,
@ -186,12 +187,13 @@
area: ['628px', '452px'], area: ['628px', '452px'],
content: new_url+data content: new_url+data
}); });
//window.open(new_url + data, '', 'location=no, resizeable=no, height=410, width=625, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,status=no'); }
} else { else {
aUrl = ''; aUrl = '';
$.each(dataArray, function(index, value){ $.each(dataArray, function(index, value){
aUrl += '<a onclick="windowOpen(this); return false" class="btn btn-xs btn-primary newa" href=' + new_url + value + ' value=' + hostname + '>' + value + '</a> ' aUrl += '<a onclick="windowOpen(this); return false" class="btn btn-xs btn-primary newa" href=' + new_url + value + ' value=' + hostname + '>' + value + '</a> '
}); });
console.log(aUrl);
layer.alert(aUrl, { layer.alert(aUrl, {
skin: 'layui-layer-molv', skin: 'layui-layer-molv',
title: '授权多个系统用户,请选择一个连接', title: '授权多个系统用户,请选择一个连接',
@ -209,27 +211,40 @@
var new_url = $(a).attr('href'); var new_url = $(a).attr('href');
var hostname = $(a).attr('value'); var hostname = $(a).attr('value');
var title = 'Jumpserver Web Terminal - ' + '<span class="text-info"> '+ hostname +'</span>'; var title = 'Jumpserver Web Terminal - ' + '<span class="text-info"> '+ hostname +'</span>';
layer.open({ if (navigator.platform == 'Win32'){
layer.open({
type: 2,
title: title,
maxmin: true,
area: ['628px', '420px'],
shade: false,
content: new_url
});
} else {
layer.open({
type: 2, type: 2,
title: title, title: title,
maxmin: true, maxmin: true,
area: ['628px', '452px'], area: ['628px', '452px'],
shade: false, shade: false,
content: new_url content: new_url
}); });
}
return false return false
} }
function windowOpenExec(a){ function windowOpenExec(a){
var new_url = $(a).attr('href'); var new_url = $(a).attr('href');
var title = 'Jumpserver Exec Terminal'; var title = 'Jumpserver Exec Terminal';
layer.open({ layer.open({
type: 2, type: 2,
title: title, title: title,
maxmin: true, maxmin: true,
area: ['800px', '600px'], area: ['725x', '600px'],
shade: false, shade: false,
content: new_url content: new_url
}); });
console.log(new_url); console.log(new_url);
return false return false

View File

@ -275,27 +275,40 @@
var new_url = $(a).attr('href'); var new_url = $(a).attr('href');
var hostname = $(a).attr('value'); var hostname = $(a).attr('value');
var title = 'Jumpserver Web Terminal - ' + '<span class="text-info"> '+ hostname +'</span>'; var title = 'Jumpserver Web Terminal - ' + '<span class="text-info"> '+ hostname +'</span>';
layer.open({ if (navigator.platform == 'Win32'){
layer.open({
type: 2,
title: title,
maxmin: true,
area: ['628px', '420px'],
shade: false,
content: new_url
});
} else {
layer.open({
type: 2, type: 2,
title: title, title: title,
maxmin: true, maxmin: true,
area: ['628px', '452px'], area: ['628px', '452px'],
shade: false, shade: false,
content: new_url content: new_url
}); });
}
return false return false
} }
function windowOpenExec(a){ function windowOpenExec(a){
var new_url = $(a).attr('href'); var new_url = $(a).attr('href');
var title = 'Jumpserver Exec Terminal'; var title = 'Jumpserver Exec Terminal';
layer.open({ layer.open({
type: 2, type: 2,
title: title, title: title,
maxmin: true, maxmin: true,
area: ['800px', '600px'], area: ['725x', '600px'],
shade: false, shade: false,
content: new_url content: new_url
}); });
console.log(new_url); console.log(new_url);
return false return false

View File

@ -134,7 +134,7 @@ $('#ruleForm').validator({
fields: { fields: {
"name": { "name": {
rule: "required;check_name", rule: "required",
tip: "输入规则名称", tip: "输入规则名称",
msg: {required: "规则名称必填"} msg: {required: "规则名称必填"}
}, },

View File

@ -106,7 +106,7 @@ function remove_rule(rule_id){
if (confirm("确认删除")) { if (confirm("确认删除")) {
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "/jperm/perm_rule_delete/", url: "{% url 'rule_del' %}",
data: "id=" + rule_id, data: "id=" + rule_id,
success: function(msg){ success: function(msg){
alert( "成功: " + msg ); alert( "成功: " + msg );

281
templates/test.html Normal file
View File

@ -0,0 +1,281 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jumpserver Install</title>
<!-- <link href="css/bootstrap.min.css" rel="stylesheet"> -->
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<!-- <link href="font-awesome/css/font-awesome.css" rel="stylesheet"> -->
<!-- <link href="css/plugins/iCheck/custom.css" rel="stylesheet"> -->
<link href="/static/css/plugins/steps/jquery.steps.css" rel="stylesheet">
<!-- <link href="css/animate.css" rel="stylesheet"> -->
<!-- <link href="css/style.css" rel="stylesheet"> -->
<link href="/static/css/style.css" rel="stylesheet">
<style>
.wizard-big.wizard > .content {
min-height: 320px;
}
</style>
</head>
<body>
<div id="wrapper">
<div class="row" >
<div class="col-sm-12" >
<div class="ibox">
<div class="ibox-title">
<h5>向导</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>
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="ibox-content" style="height: 900px;">
<h2>
安装向导
</h2>
<p>
请输入相关信息完成安装
</p>
<form id="form" action="#" class="wizard-big" >
<h1>管理员账户</h1>
<fieldset>
<h2>管理员账号是首次登陆的账号</h2>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label>用户名 *</label>
<input id="username" name="username" type="text" class="form-control required">
</div>
<div class="form-group">
<label>密码 *</label>
<input id="password" name="password" type="password" class="form-control required">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label>邮件 *</label>
<input id="email" name="email" type="email" class="form-control required">
</div>
<div class="form-group">
<label>确认密码 *</label>
<input id="password" name="password" type="password" class="form-control">
</div>
</div>
{# <div class="col-sm-8" style="height: 100%">#}
{# <div class="form-group">#}
{# <label>Username *</label>#}
{# <input id="userName" name="userName" type="text" class="form-control required">#}
{# </div>#}
{# <div class="form-group">#}
{# <label>Password *</label>#}
{# <input id="password" name="password" type="password" class="form-control required">#}
{# </div>#}
{# <div class="form-group">#}
{# <label>Confirm Password *</label>#}
{# <input id="confirm" name="confirm" type="password" class="form-control required">#}
{# </div>#}
{# <div class="form-group">#}
{# <label>Email *</label>#}
{# <input id="email" name="email" type="text" class="form-control required">#}
{# </div>#}
{# </div>#}
<div class="col-sm-4">
<div class="text-center">
<div style="margin-top: 20px">
<i class="fa fa-sign-in" style="font-size: 180px;color: #e5e5e5 "></i>
</div>
</div>
</div>
</div>
</fieldset>
<h1>数据库</h1>
<fieldset>
<h2>数据库连接信息</h2>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label>地址 *</label>
<input id="host" name="host" type="text" class="form-control required">
</div>
<div class="form-group">
<label>端口 *</label>
<input id="port" name="port" type="text" class="form-control required">
</div>
<div class="form-group">
<label>数据库 *</label>
<input id="db" name="db" type="text" class="form-control required">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label>用户名 *</label>
<input id="dbuser" name="dbuser" type="text" class="form-control required">
</div>
<div class="form-group">
<label>密码 *</label>
<input id="dbpass" name="dbpass" type="password" class="form-control">
</div>
<div class="form-group">
<div></div>
<a href="{% url 'user_add' %}" class="btn btn-sm btn-warning" style="float: right"> 测试连接 </a>
</div>
</div>
</div>
</fieldset>
<h1>邮件设置</h1>
<fieldset>
<h2>邮件设置</h2>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label>SMTP *</label>
<input id="host" name="host" type="text" class="form-control required">
</div>
<div class="form-group">
<label>端口 *</label>
<input id="port" name="port" type="text" class="form-control required">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label>邮件地址 *</label>
<input id="dbuser" name="dbuser" type="text" class="form-control required">
</div>
<div class="form-group">
<label>密码 *</label>
<input id="dbpass" name="dbpass" type="password" class="form-control">
</div>
</div>
</div>
</fieldset>
<h1>完成</h1>
<fieldset>
<h2>Terms and Conditions</h2>
<input id="acceptTerms" name="acceptTerms" type="checkbox" class="required"> <label for="acceptTerms">I agree with the Terms and Conditions.</label>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Mainly scripts -->
<!-- // <script src="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="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
<script src="/static/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<!-- // <script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script> -->
<!-- Custom and plugin javascript -->
<!-- // <script src="js/inspinia.js"></script> -->
<!-- // <script src="js/plugins/pace/pace.min.js"></script> -->
<!-- Steps -->
<script src="/static/js/plugins/steps/jquery.steps.min.js"></script>
<!-- Jquery Validate -->
<script src="/static/js/plugins/validate/jquery.validate.min.js"></script>
<script>
$(document).ready(function(){
// $("#wizard").steps();
$("#form").steps({
bodyTag: "fieldset",
onStepChanging: function (event, currentIndex, newIndex)
{
// Always allow going backward even if the current step contains invalid fields!
if (currentIndex > newIndex)
{
return true;
}
// Forbid suppressing "Warning" step if the user is to young
if (newIndex === 3 && Number($("#age").val()) < 18)
{
return false;
}
var form = $(this);
// Clean up if user went backward before
if (currentIndex < newIndex)
{
// To remove error styles
$(".body:eq(" + newIndex + ") label.error", form).remove();
$(".body:eq(" + newIndex + ") .error", form).removeClass("error");
}
// Disable validation on fields that are disabled or hidden.
form.validate().settings.ignore = ":disabled,:hidden";
// Start validation; Prevent going forward if false
return form.valid();
},
onStepChanged: function (event, currentIndex, priorIndex)
{
// Suppress (skip) "Warning" step if the user is old enough.
if (currentIndex === 2 && Number($("#age").val()) >= 18)
{
$(this).steps("next");
}
// Suppress (skip) "Warning" step if the user is old enough and wants to the previous step.
if (currentIndex === 2 && priorIndex === 3)
{
$(this).steps("previous");
}
},
onFinishing: function (event, currentIndex)
{
var form = $(this);
// Disable validation on fields that are disabled.
// At this point it's recommended to do an overall check (mean ignoring only disabled fields)
form.validate().settings.ignore = ":disabled";
// Start validation; Prevent form submission if false
return form.valid();
},
onFinished: function (event, currentIndex)
{
var form = $(this);
// Submit form input
form.submit();
}
}).validate({
errorPlacement: function (error, element)
{
element.before(error);
},
rules: {
confirm: {
equalTo: "#password"
}
}
});
});
</script>
</body>
</html>