Commit f3606dfd authored by ibuler's avatar ibuler

add install wizzird

parent 2496f1c6
...@@ -13,6 +13,7 @@ urlpatterns = patterns('jumpserver.views', ...@@ -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')),
......
...@@ -354,3 +354,7 @@ def web_terminal(request): ...@@ -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())
/*
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;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
...@@ -34,7 +34,8 @@ ...@@ -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>
This diff is collapsed.
...@@ -109,8 +109,8 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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, type: 2,
title: title, title: title,
maxmin: true, maxmin: true,
area: ['628px', '452px'], area: ['628px', '420px'],
shade: false, shade: false,
content: new_url content: new_url
}); });
return false
}
function windowOpenExec(a){ } else {
var new_url = $(a).attr('href'); layer.open({
var title = 'Jumpserver Exec Terminal';
layer.open({
type: 2, type: 2,
title: title, title: title,
maxmin: true, maxmin: true,
area: ['800px', '600px'], area: ['628px', '452px'],
shade: false, shade: false,
content: new_url content: new_url
});
}
return false
}
function windowOpenExec(a){
var new_url = $(a).attr('href');
var title = 'Jumpserver Exec Terminal';
layer.open({
type: 2,
title: title,
maxmin: true,
area: ['725x', '600px'],
shade: false,
content: new_url
}); });
console.log(new_url); console.log(new_url);
return false return false
......
...@@ -275,27 +275,40 @@ ...@@ -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, type: 2,
title: title, title: title,
maxmin: true, maxmin: true,
area: ['628px', '452px'], area: ['628px', '420px'],
shade: false, shade: false,
content: new_url content: new_url
}); });
return false
}
function windowOpenExec(a){ } else {
var new_url = $(a).attr('href'); layer.open({
var title = 'Jumpserver Exec Terminal';
layer.open({
type: 2, type: 2,
title: title, title: title,
maxmin: true, maxmin: true,
area: ['800px', '600px'], area: ['628px', '452px'],
shade: false, shade: false,
content: new_url content: new_url
});
}
return false
}
function windowOpenExec(a){
var new_url = $(a).attr('href');
var title = 'Jumpserver Exec Terminal';
layer.open({
type: 2,
title: title,
maxmin: true,
area: ['725x', '600px'],
shade: false,
content: new_url
}); });
console.log(new_url); console.log(new_url);
return false return false
......
...@@ -134,7 +134,7 @@ $('#ruleForm').validator({ ...@@ -134,7 +134,7 @@ $('#ruleForm').validator({
fields: { fields: {
"name": { "name": {
rule: "required;check_name", rule: "required",
tip: "输入规则名称", tip: "输入规则名称",
msg: {required: "规则名称必填"} msg: {required: "规则名称必填"}
}, },
......
...@@ -106,7 +106,7 @@ function remove_rule(rule_id){ ...@@ -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 );
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment