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
179018bf
Commit
179018bf
authored
Dec 18, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:jumpserver/jumpserver into dev
parents
583214e9
fb44ef09
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
0 deletions
+35
-0
_asset_list_modal.html
apps/assets/templates/assets/_asset_list_modal.html
+4
-0
label_create_update.html
apps/assets/templates/assets/label_create_update.html
+1
-0
asset_permission_create_update.html
...perms/templates/perms/asset_permission_create_update.html
+1
-0
jumpserver.js
apps/static/js/jumpserver.js
+29
-0
No files found.
apps/assets/templates/assets/_asset_list_modal.html
View file @
179018bf
...
...
@@ -57,6 +57,10 @@
<script>
var
zTree2
,
asset_table2
=
0
;
function
initTable2
()
{
if
(
asset_table2
){
return
}
var
options
=
{
ele
:
$
(
'#asset_list_modal_table'
),
ajax_url
:
'{% url "api-assets:asset-list" %}?show_current_asset=1'
,
...
...
apps/assets/templates/assets/label_create_update.html
View file @
179018bf
...
...
@@ -32,6 +32,7 @@ $(document).ready(function () {
}).
on
(
'click'
,
'.select2-selection__rendered'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
"#asset_list_modal"
).
modal
();
initSelectedAssets2Table
();
})
.
on
(
'click'
,
'#btn_asset_modal_confirm'
,
function
()
{
var
assets
=
asset_table2
.
selected
;
...
...
apps/perms/templates/perms/asset_permission_create_update.html
View file @
179018bf
...
...
@@ -113,6 +113,7 @@ $(document).ready(function () {
e
.
preventDefault
();
e
.
stopPropagation
();
$
(
"#asset_list_modal"
).
modal
();
initSelectedAssets2Table
();
}
})
})
...
...
apps/static/js/jumpserver.js
View file @
179018bf
...
...
@@ -812,3 +812,32 @@ function initPopover($container, $progress, $idPassword, $el, password_check_rul
$idPassword
.
pwstrength
(
options
);
popoverPasswordRules
(
password_check_rules
,
$el
);
}
// 解决input框中的资产和弹出表格中资产的显示不一致
function
initSelectedAssets2Table
(){
var
inputAssets
=
$
(
'#id_assets'
).
val
();
var
selectedAssets
=
asset_table2
.
selected
.
concat
();
// input assets无,table assets选中,则取消勾选(再次click)
if
(
selectedAssets
.
length
!==
0
){
$
.
each
(
selectedAssets
,
function
(
index
,
assetId
){
if
(
$
.
inArray
(
assetId
,
inputAssets
)
===
-
1
){
$
(
'#'
+
assetId
).
trigger
(
'click'
);
// 取消勾选
}
});
}
// input assets有,table assets没选,则选中(click)
if
(
inputAssets
!==
null
){
asset_table2
.
selected
=
inputAssets
;
$
.
each
(
inputAssets
,
function
(
index
,
assetId
){
var
dom
=
document
.
getElementById
(
assetId
);
if
(
dom
!==
null
){
var
selected
=
dom
.
parentElement
.
parentElement
.
className
.
indexOf
(
'selected'
)
}
if
(
selected
===
-
1
){
$
(
'#'
+
assetId
).
trigger
(
'click'
);
}
});
}
}
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