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
d40d231e
Commit
d40d231e
authored
Jul 09, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改assets
parent
cedf0e45
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
52 deletions
+36
-52
_node_tree.html
apps/assets/templates/assets/_node_tree.html
+0
-49
asset_list.html
apps/assets/templates/assets/asset_list.html
+36
-3
No files found.
apps/assets/templates/assets/_node_tree.html
View file @
d40d231e
...
...
@@ -291,42 +291,6 @@ function defaultCallback(action) {
$
(
document
).
ready
(
function
()
{
})
.
on
(
'click'
,
'.btn-refresh-hardware'
,
function
()
{
var
url
=
"{% url 'api-assets:node-refresh-hardware-info' pk=DEFAULT_PK %}"
;
var
the_url
=
url
.
replace
(
"{{ DEFAULT_PK }}"
,
current_node_id
);
function
success
(
data
)
{
rMenu
.
css
({
"visibility"
:
"hidden"
});
var
task_id
=
data
.
task
;
var
url
=
'{% url "ops:celery-task-log" pk=DEFAULT_PK %}'
.
replace
(
"{{ DEFAULT_PK }}"
,
task_id
);
window
.
open
(
url
,
''
,
'width=800,height=600'
)
}
APIUpdateAttr
({
url
:
the_url
,
method
:
"GET"
,
success
:
success
,
flash_message
:
false
});
})
.
on
(
'click'
,
'.btn-test-connective'
,
function
()
{
var
url
=
"{% url 'api-assets:node-test-connective' pk=DEFAULT_PK %}"
;
if
(
!
current_node_id
)
{
return
null
;
}
var
the_url
=
url
.
replace
(
"{{ DEFAULT_PK }}"
,
current_node_id
);
function
success
(
data
)
{
rMenu
.
css
({
"visibility"
:
"hidden"
});
var
task_id
=
data
.
task
;
var
url
=
'{% url "ops:celery-task-log" pk=DEFAULT_PK %}'
.
replace
(
"{{ DEFAULT_PK }}"
,
task_id
);
window
.
open
(
url
,
''
,
'width=800,height=600'
)
}
APIUpdateAttr
({
url
:
the_url
,
method
:
"GET"
,
success
:
success
,
flash_message
:
false
});
})
.
on
(
'click'
,
'.btn-show-current-asset'
,
function
(){
hideRMenu
();
$
(
this
).
css
(
'display'
,
'none'
);
...
...
@@ -341,17 +305,5 @@ $(document).ready(function () {
setCookie
(
'show_current_asset'
,
''
);
location
.
reload
();
})
.
on
(
'click'
,
'.btn-test-connective'
,
function
()
{
hideRMenu
();
})
.
on
(
'click'
,
'#menu_refresh_assets_amount'
,
function
()
{
hideRMenu
();
var
url
=
"{% url 'api-assets:refresh-assets-amount' %}"
;
APIUpdateAttr
({
'url'
:
url
,
'method'
:
'GET'
});
window
.
location
.
reload
();
})
</script>
\ No newline at end of file
apps/assets/templates/assets/asset_list.html
View file @
d40d231e
...
...
@@ -167,7 +167,7 @@ function initTable() {
}},
{
targets
:
5
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
update_btn
=
'<a href="{% url "assets:asset-update" pk=DEFAULT_PK %}" class="btn btn-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
"{{ DEFAULT_PK }}"
,
cellData
);
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn
_asset_
delete" data-uid="{{ DEFAULT_PK }}">{% trans "Delete" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
);
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn
-asset-
delete" data-uid="{{ DEFAULT_PK }}">{% trans "Delete" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
);
$
(
td
).
html
(
update_btn
+
del_btn
)
}}
],
...
...
@@ -325,8 +325,7 @@ $(document).ready(function(){
}
window
.
open
(
url
,
'_self'
);
})
.
on
(
'click'
,
'.btn_asset_delete'
,
function
()
{
.
on
(
'click'
,
'.btn-asset-delete'
,
function
()
{
var
$this
=
$
(
this
);
var
$data_table
=
$
(
"#asset_list_table"
).
DataTable
();
var
name
=
$
(
this
).
closest
(
"tr"
).
find
(
":nth-child(2)"
).
children
(
'a'
).
html
();
...
...
@@ -513,6 +512,40 @@ $(document).ready(function(){
update_node_action
=
"add"
}).
on
(
'click'
,
'#menu_asset_move'
,
function
()
{
update_node_action
=
"move"
}).
on
(
'click'
,
'.btn-test-connective'
,
function
()
{
var
url
=
"{% url 'api-assets:node-test-connective' pk=DEFAULT_PK %}"
;
if
(
!
current_node_id
)
{
return
null
;
}
var
the_url
=
url
.
replace
(
"{{ DEFAULT_PK }}"
,
current_node_id
);
function
success
(
data
)
{
rMenu
.
css
({
"visibility"
:
"hidden"
});
var
task_id
=
data
.
task
;
var
url
=
'{% url "ops:celery-task-log" pk=DEFAULT_PK %}'
.
replace
(
"{{ DEFAULT_PK }}"
,
task_id
);
window
.
open
(
url
,
''
,
'width=800,height=600'
)
}
APIUpdateAttr
({
url
:
the_url
,
method
:
"GET"
,
success
:
success
,
flash_message
:
false
});
}).
on
(
'click'
,
'.btn-refresh-hardware'
,
function
()
{
var
url
=
"{% url 'api-assets:node-refresh-hardware-info' pk=DEFAULT_PK %}"
;
var
the_url
=
url
.
replace
(
"{{ DEFAULT_PK }}"
,
current_node_id
);
function
success
(
data
)
{
rMenu
.
css
({
"visibility"
:
"hidden"
});
var
task_id
=
data
.
task
;
var
url
=
'{% url "ops:celery-task-log" pk=DEFAULT_PK %}'
.
replace
(
"{{ DEFAULT_PK }}"
,
task_id
);
window
.
open
(
url
,
''
,
'width=800,height=600'
)
}
APIUpdateAttr
({
url
:
the_url
,
method
:
"GET"
,
success
:
success
,
flash_message
:
false
});
})
</script>
...
...
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