Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
ac67c231
Commit
ac67c231
authored
May 16, 2018
by
BaiJiangJie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改前端rdp相关配置的选择逻辑
parent
599431f4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
67 deletions
+50
-67
_system_user.html
apps/assets/templates/assets/_system_user.html
+32
-40
gateway_create_update.html
apps/assets/templates/assets/gateway_create_update.html
+14
-14
system_user_detail.html
apps/assets/templates/assets/system_user_detail.html
+4
-7
system_user_update.html
apps/assets/templates/assets/system_user_update.html
+0
-6
No files found.
apps/assets/templates/assets/_system_user.html
View file @
ac67c231
...
...
@@ -79,59 +79,50 @@
</div>
{% endblock %}
{% block custom_foot_js %}
<script>
var
auto_generate_key
=
'#'
+
'{{ form.auto_generate_key.id_for_label }}'
;
var
protocol_id
=
'#'
+
'{{ form.protocol.id_for_label }}'
;
var
private_key_id
=
'#'
+
'{{ form.private_key_file.id_for_label }}'
;
var
auto_push_id
=
'#'
+
'{{ form.auto_push.id_for_label }}'
;
var
sudo_id
=
'#'
+
'{{ form.sudo.id_for_label }}'
;
var
shell_id
=
'#'
+
'{{ form.shell.id_for_label }}'
;
<script>
var
auto_generate_key
=
'#'
+
'{{ form.auto_generate_key.id_for_label }}'
;
var
protocol_id
=
'#'
+
'{{ form.protocol.id_for_label }}'
;
var
private_key_id
=
'#'
+
'{{ form.private_key_file.id_for_label }}'
;
var
auto_push_id
=
'#'
+
'{{ form.auto_push.id_for_label }}'
;
var
sudo_id
=
'#'
+
'{{ form.sudo.id_for_label }}'
;
var
shell_id
=
'#'
+
'{{ form.shell.id_for_label }}'
;
var
need_change_field
=
[
auto_generate_key
,
private_key_id
,
auto_push_id
,
sudo_id
,
shell_id
];
var
div_auto_generate_key
=
$
(
auto_generate_key
).
parent
().
parent
();
var
div_ssh_private_key
=
$
(
private_key_id
).
parent
().
parent
().
parent
().
parent
();
var
div_auto_push
=
$
(
auto_push_id
).
parent
().
parent
();
var
div_sudo
=
$
(
sudo_id
).
parent
().
parent
();
var
div_shell
=
$
(
shell_id
).
parent
().
parent
();
var
need_change_div
=
[
div_auto_generate_key
,
div_ssh_private_key
,
div_auto_push
,
div_sudo
,
div_shell
];
function
authFieldsDisplay
()
{
if
(
$
(
auto_generate_key
).
prop
(
'checked'
))
{
$
(
'.auth-fields'
).
addClass
(
'hidden'
);
}
else
{
$
(
'.auth-fields'
).
removeClass
(
'hidden'
);
}
}
function
protocolChange
()
{
function
protocolChange
()
{
if
(
$
(
protocol_id
+
" option:selected"
).
text
()
===
'rdp'
)
{
$
(
'.auth-fields'
).
removeClass
(
'hidden'
);
$
.
each
(
need_change_div
,
function
(
index
,
value
)
{
$
(
value
).
addClass
(
'hidden'
)
$
.
each
(
need_change_field
,
function
(
index
,
value
)
{
$
(
value
).
closest
(
'.form-group'
).
addClass
(
'hidden'
)
});
}
else
{
authFieldsDisplay
();
$
.
each
(
need_change_div
,
function
(
index
,
value
)
{
$
(
value
).
removeClass
(
'hidden'
)
$
.
each
(
need_change_field
,
function
(
index
,
value
)
{
$
(
value
).
closest
(
'.form-group'
).
removeClass
(
'hidden'
)
});
}
}
function
authFieldsDisplay
()
{
if
(
$
(
auto_generate_key
).
prop
(
'checked'
))
{
$
(
'.auth-fields'
).
addClass
(
'hidden'
);
}
else
{
$
(
'.auth-fields'
).
removeClass
(
'hidden'
);
}
}
{
%
block
document_ready
%
}
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
$
(
'.select2'
).
select2
();
authFieldsDisplay
();
protocolChange
();
});
{
%
endblock
%
}
$
(
protocol_id
).
change
(
function
(){
})
.
on
(
'change'
,
protocol_id
,
function
(){
protocolChange
();
});
$
(
auto_generate_key
).
change
(
function
()
{
})
.
on
(
'change'
,
auto_generate_key
,
function
()
{
authFieldsDisplay
();
});
</script>
});
</script>
{% endblock %}
\ No newline at end of file
apps/assets/templates/assets/gateway_create_update.html
View file @
ac67c231
...
...
@@ -68,27 +68,26 @@
{% endblock %}
{% block custom_foot_js %}
<script>
var
protocol_id
=
'#'
+
'{{ form.protocol.id_for_label }}'
;
var
private_key_id
=
'#'
+
'{{ form.private_key_file.id_for_label }}'
;
var
port
=
'#'
+
'{{ form.port.id_for_label }}'
;
var
div_ssh_private_key
=
$
(
private_key_id
).
parent
().
parent
().
parent
().
parent
();
<script>
var
protocol_id
=
'#'
+
'{{ form.protocol.id_for_label }}'
;
var
private_key_id
=
'#'
+
'{{ form.private_key_file.id_for_label }}'
;
var
port
=
'#'
+
'{{ form.port.id_for_label }}'
;
function
protocolChange
()
{
function
protocolChange
()
{
if
(
$
(
protocol_id
+
" option:selected"
).
text
()
===
'rdp'
)
{
$
(
port
).
val
(
3389
);
$
(
div_ssh_private_key
).
addClass
(
'hidden'
)
$
(
private_key_id
).
closest
(
'.form-group'
).
addClass
(
'hidden'
)
}
else
{
$
(
port
).
val
(
22
);
$
(
div_ssh_private_key
).
removeClass
(
'hidden'
)
}
$
(
private_key_id
).
closest
(
'.form-group'
).
removeClass
(
'hidden'
)
}
}
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
protocolChange
();
});
$
(
protocol_id
).
change
(
function
(){
})
.
on
(
'change'
,
protocol_id
,
function
(){
protocolChange
();
});
</script>
});
</script>
{% endblock %}
\ No newline at end of file
apps/assets/templates/assets/system_user_detail.html
View file @
ac67c231
...
...
@@ -66,12 +66,12 @@
<td>
{% trans 'Protocol' %}:
</td>
<td><b
id=
"id_protocol_type"
>
{{ system_user.protocol }}
</b></td>
</tr>
<tr
id=
"id_sudo
"
>
<tr
class=
"only-ssh
"
>
<td>
{% trans 'Sudo' %}:
</td>
<td><b>
{{ system_user.sudo }}
</b></td>
</tr>
{% if system_user.shell %}
<tr
id=
"id_shell
"
>
<tr
class=
"only-ssh
"
>
<td>
{% trans 'Shell' %}:
</td>
<td><b>
{{ system_user.shell }}
</b></td>
</tr>
...
...
@@ -107,7 +107,7 @@
</div>
<div
class=
"col-sm-4"
style=
"padding-left: 0;padding-right: 0"
>
<div
class=
"panel panel-primary
"
id=
"id_quick_update
"
>
<div
class=
"panel panel-primary
only-ssh
"
>
<div
class=
"panel-heading"
>
<i
class=
"fa fa-info-circle"
></i>
{% trans 'Quick update' %}
</div>
...
...
@@ -237,11 +237,8 @@ function updateSystemUserNode(nodes) {
jumpserver
.
nodes_selected
=
{};
$
(
document
).
ready
(
function
()
{
if
(
$
(
'#id_protocol_type'
).
text
()
===
'rdp'
){
$
(
'#id_quick_update'
).
addClass
(
'hidden'
);
$
(
'#id_sudo'
).
addClass
(
'hidden'
);
$
(
'#id_shell'
).
addClass
(
'hidden'
);
$
(
'.only-ssh'
).
addClass
(
'hidden'
)
}
$
(
'.select2'
).
select2
()
.
on
(
'select2:select'
,
function
(
evt
)
{
var
data
=
evt
.
params
.
data
;
...
...
apps/assets/templates/assets/system_user_update.html
View file @
ac67c231
...
...
@@ -15,9 +15,3 @@
</div>
{% endblock %}
{% block document_ready %}
$(document).ready(function () {
$('.select2').select2();
protocolChange();
});
{% endblock %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment