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
33b1de0d
Commit
33b1de0d
authored
Dec 12, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 优化一下
parent
bcfe82f1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
28 deletions
+45
-28
command_execution_create.html
apps/ops/templates/ops/command_execution_create.html
+4
-1
command_execution_list.html
apps/ops/templates/ops/command_execution_list.html
+41
-27
No files found.
apps/ops/templates/ops/command_execution_create.html
View file @
33b1de0d
...
@@ -263,7 +263,10 @@ function execute() {
...
@@ -263,7 +263,10 @@ function execute() {
var
editor
;
var
editor
;
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
systemUserId
=
$
(
'#system-users-select'
).
val
();
systemUserId
=
$
(
'#system-users-select'
).
val
();
$
(
".select2"
).
select2
().
on
(
'select2:select'
,
function
(
evt
)
{
$
(
".select2"
).
select2
({
dropdownAutoWidth
:
true
,
width
:
'auto'
}).
on
(
'select2:select'
,
function
(
evt
)
{
var
data
=
evt
.
params
.
data
;
var
data
=
evt
.
params
.
data
;
systemUserId
=
data
.
id
;
systemUserId
=
data
.
id
;
initTree
();
initTree
();
...
...
apps/ops/templates/ops/command_execution_list.html
View file @
33b1de0d
...
@@ -3,6 +3,18 @@
...
@@ -3,6 +3,18 @@
{% load static %}
{% load static %}
{% load common_tags %}
{% load common_tags %}
{% block custom_head_css_js %}
<link
href=
"{% static "
css
/
plugins
/
footable
/
footable
.
core
.
css
"
%}"
rel=
"stylesheet"
>
<link
href=
"{% static 'css/plugins/datepicker/datepicker3.css' %}"
rel=
"stylesheet"
>
<link
href=
"{% static 'css/plugins/select2/select2.min.css' %}"
rel=
"stylesheet"
>
<script
src=
"{% static 'js/plugins/select2/select2.full.min.js' %}"
></script>
<style>
#search_btn
{
margin-bottom
:
0
;
}
</style>
{% endblock %}
{% block content_left_head %}
{% block content_left_head %}
{% endblock %}
{% endblock %}
...
@@ -39,46 +51,49 @@
...
@@ -39,46 +51,49 @@
</form>
</form>
{% endblock %}
{% endblock %}
{% block table_
head
%}
{% block table_
container
%}
<t
h
class=
"text-center"
></th
>
<t
able
class=
"footable table table-stripped table-bordered toggle-arrow-tiny"
data-page=
"false"
>
<th
class=
"text-center"
>
{% trans 'Hosts' %}
</th
>
<th
ead
>
<th
class=
"text-center"
>
{% trans 'User' %}
</th>
<th
class=
"text-center"
>
</th>
<th
class=
"text-center"
>
{% trans 'Command
' %}
</th>
<th
class=
"text-center"
>
{% trans 'Hosts
' %}
</th>
<th
class=
"text-center"
>
{% trans 'Run as
' %}
</th>
<th
class=
"text-center"
>
{% trans 'User
' %}
</th>
<th
class=
"text-center"
>
{% trans 'Output
' %}
</th>
<th
class=
"text-center"
>
{% trans 'Command
' %}
</th>
<th
class=
"text-center"
>
{% trans 'Finished
' %}
</th>
<th
class=
"text-center"
>
{% trans 'Run as
' %}
</th>
<th
class=
"text-center"
>
{% trans 'Success
' %}
</th>
<th
class=
"text-center"
>
{% trans 'Output
' %}
</th>
<th
class=
"text-center"
>
{% trans 'Date start
' %}
</th>
<th
class=
"text-center"
>
{% trans 'Finished
' %}
</th>
<th
class=
"text-center"
>
{% trans 'Date finished
' %}
</th>
<th
class=
"text-center"
>
{% trans 'Success
' %}
</th>
{% endblock %}
<th
class=
"text-center"
>
{% trans 'Date start' %}
</th>
</thead>
{% block table_body %}
<tbody>
{% for object in object_list %}
{% for object in object_list %}
<tr
class=
"gradeX"
>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
><input
type=
"checkbox"
class=
"cbx-term"
>
</td>
<td
>
{{ forloop.counter }}
</td>
<td
class=
"text-center hosts"
>
{{ object.get_hosts_names }}
</td>
<td
class=
"text-center hosts"
value=
"{{ object.get_hosts_names }}"
>
</td>
<td
class=
"text-center"
>
{{ object.user }}
</td>
<td
class=
"text-center"
>
{{ object.user
.name
}}
</td>
<td
class=
"text-center"
>
{{ object.command| truncatechars:16 }}
</td>
<td
class=
"text-center"
>
{{ object.command| truncatechars:16 }}
</td>
<td
class=
"text-center"
>
{{ object.run_as }}
</td>
<td
class=
"text-center"
>
{{ object.run_as
.username
}}
</td>
<td
class=
"text-center"
><a
href=
"{% url "
ops:celery-task-log
"
pk=
object.id
%}"
target=
"_blank"
>
查看
</a></td>
<td
class=
"text-center"
><a
href=
"{% url "
ops:celery-task-log
"
pk=
object.id
%}"
target=
"_blank"
>
查看
</a></td>
<td
class=
"text-center"
>
{{ object.is_finished | state_show | safe }}
</td>
<td
class=
"text-center"
>
{{ object.is_finished | state_show | safe }}
</td>
<td
class=
"text-center"
>
{{ object.is_success | state_show | safe }}
</td>
<td
class=
"text-center"
>
{{ object.is_success | state_show | safe }}
</td>
<td
class=
"text-center"
>
{{ object.date_start }}
</td>
<td
class=
"text-center"
>
{{ object.date_start }}
</td>
<td
class=
"text-center"
>
{{ object.date_finished }}
</td>
</tr>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
{% endblock %}
{% endblock %}
{% block custom_foot_js %}
{% block custom_foot_js %}
<script
src=
"{% static 'js/plugins/datepicker/bootstrap-datepicker.js' %}"
></script>
<script
src=
"{% static 'js/plugins/datepicker/bootstrap-datepicker.js' %}"
></script>
<script
src=
"{% static "
js
/
plugins
/
footable
/
footable
.
all
.
min
.
js
"
%}"
></script>
<script>
<script>
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
$
(
'table'
).
DataTable
({
{
#
$
(
'table'
).
DataTable
({
#
}
"searching"
:
false
,
{
#
"searching"
:
false
,
#
}
"paging"
:
false
,
{
#
"paging"
:
false
,
#
}
"bInfo"
:
false
,
{
#
"bInfo"
:
false
,
#
}
"order"
:
[]
{
#
"order"
:
[]
#
}
});
{
#
});
#
}
{
#
$
(
'.footable'
).
footable
();
#
}
$
(
'.select2'
).
select2
({
$
(
'.select2'
).
select2
({
dropdownAutoWidth
:
true
,
dropdownAutoWidth
:
true
,
width
:
'auto'
width
:
'auto'
...
@@ -92,7 +107,7 @@ $(document).ready(function() {
...
@@ -92,7 +107,7 @@ $(document).ready(function() {
autoclose
:
true
autoclose
:
true
});
});
$
(
".hosts"
).
each
(
function
(
i
)
{
$
(
".hosts"
).
each
(
function
(
i
)
{
var
data
=
$
(
this
).
text
(
);
var
data
=
$
(
this
).
attr
(
'value'
);
var
data_list
=
data
.
split
(
","
);
var
data_list
=
data
.
split
(
","
);
if
(
data_list
.
length
===
1
&&
data_list
[
0
]
===
""
)
{
if
(
data_list
.
length
===
1
&&
data_list
[
0
]
===
""
)
{
data_list
.
pop
();
data_list
.
pop
();
...
@@ -101,7 +116,6 @@ $(document).ready(function() {
...
@@ -101,7 +116,6 @@ $(document).ready(function() {
$
(
this
).
html
(
html
);
$
(
this
).
html
(
html
);
});
});
$
(
'[data-toggle="popover"]'
).
popover
();
$
(
'[data-toggle="popover"]'
).
popover
();
})
})
</script>
</script>
{% endblock %}
{% 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