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
b7915ccd
Unverified
Commit
b7915ccd
authored
Jul 23, 2019
by
老广
Committed by
GitHub
Jul 23, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3015 from jumpserver/dev
Bugfix (#3014)
parents
00e1bf6c
421e9869
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
+14
-8
_node_tree.html
apps/assets/templates/assets/_node_tree.html
+12
-6
_granted_assets.html
apps/users/templates/users/_granted_assets.html
+1
-1
user_granted_asset.html
apps/users/templates/users/user_granted_asset.html
+1
-1
No files found.
apps/assets/templates/assets/_node_tree.html
View file @
b7915ccd
...
@@ -68,10 +68,12 @@ var treeUrl = '{% url 'api-assets:node-children-tree' %}?assets=0';
...
@@ -68,10 +68,12 @@ var treeUrl = '{% url 'api-assets:node-children-tree' %}?assets=0';
// "otherMenu": "",
// "otherMenu": "",
// "showAssets": false,
// "showAssets": false,
// }
// }
var
inited
=
false
;
function
initNodeTree
(
options
)
{
function
initNodeTree
(
options
)
{
if
(
options
.
showAssets
)
{
if
(
options
.
showAssets
)
{
treeUrl
=
setUrlParam
(
treeUrl
,
'assets'
,
'1'
)
treeUrl
=
setUrlParam
(
treeUrl
,
'assets'
,
'1'
)
}
}
var
asyncTreeUrl
=
setUrlParam
(
treeUrl
,
'refresh'
,
'0'
);
var
setting
=
{
var
setting
=
{
view
:
{
view
:
{
dblClickExpand
:
false
,
dblClickExpand
:
false
,
...
@@ -84,7 +86,7 @@ function initNodeTree(options) {
...
@@ -84,7 +86,7 @@ function initNodeTree(options) {
},
},
async
:
{
async
:
{
enable
:
true
,
enable
:
true
,
url
:
t
reeUrl
,
url
:
asyncT
reeUrl
,
autoParam
:
[
"id=key"
,
"name=n"
,
"level=lv"
],
autoParam
:
[
"id=key"
,
"name=n"
,
"level=lv"
],
type
:
'get'
type
:
'get'
},
},
...
@@ -109,16 +111,20 @@ function initNodeTree(options) {
...
@@ -109,16 +111,20 @@ function initNodeTree(options) {
beforeAsync
:
options
.
beforeAsync
||
defaultCallback
(
"Before async"
)
beforeAsync
:
options
.
beforeAsync
||
defaultCallback
(
"Before async"
)
}
}
};
};
$
.
get
(
treeUrl
,
function
(
data
,
status
){
$
.
get
(
treeUrl
,
function
(
data
,
status
)
{
zNodes
=
data
;
zTree
=
$
.
fn
.
zTree
.
init
(
$
(
"#nodeTree"
),
setting
,
data
);
zTree
=
$
.
fn
.
zTree
.
init
(
$
(
"#nodeTree"
),
setting
,
zNodes
);
rootNodeAddDom
(
zTree
,
function
()
{
rootNodeAddDom
(
zTree
,
function
()
{
treeUrl
=
setUrlParam
(
treeUrl
,
'refresh'
,
'1'
);
treeUrl
=
setUrlParam
(
treeUrl
,
'refresh'
,
'1'
);
init
Tree
(
);
init
NodeTree
(
options
);
treeUrl
=
setUrlParam
(
treeUrl
,
'refresh'
,
'0'
)
treeUrl
=
setUrlParam
(
treeUrl
,
'refresh'
,
'0'
)
;
});
});
inited
=
true
;
});
});
if
(
inited
)
{
return
}
if
(
options
.
showMenu
)
{
if
(
options
.
showMenu
)
{
showMenu
=
true
;
showMenu
=
true
;
rMenu
=
$
(
"#rMenu"
);
rMenu
=
$
(
"#rMenu"
);
...
...
apps/users/templates/users/_granted_assets.html
View file @
b7915ccd
...
@@ -122,7 +122,7 @@ function initTree() {
...
@@ -122,7 +122,7 @@ function initTree() {
$
.
fn
.
zTree
.
init
(
$
(
"#assetTree"
),
setting
,
data
);
$
.
fn
.
zTree
.
init
(
$
(
"#assetTree"
),
setting
,
data
);
zTree
=
$
.
fn
.
zTree
.
getZTreeObj
(
"assetTree"
);
zTree
=
$
.
fn
.
zTree
.
getZTreeObj
(
"assetTree"
);
rootNodeAddDom
(
zTree
,
function
()
{
rootNodeAddDom
(
zTree
,
function
()
{
treeUrl
=
treeUrl
.
replace
(
'cache_policy=1'
,
'cache_policy=
2'
);
treeUrl
=
setUrlParam
(
treeUrl
,
'cache_policy'
,
'
2'
);
initTree
();
initTree
();
});
});
});
});
...
...
apps/users/templates/users/user_granted_asset.html
View file @
b7915ccd
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
<script>
<script>
var
assetTableUrl
=
"{% url 'api-perms:user-assets' pk=object.id %}?cache_policy=1"
;
var
assetTableUrl
=
"{% url 'api-perms:user-assets' pk=object.id %}?cache_policy=1"
;
var
selectUrl
=
'{% url "api-perms:user-node-assets" pk=object.id node_id=DEFAULT_PK %}?cache_policy=1&all=1'
;
var
selectUrl
=
'{% url "api-perms:user-node-assets" pk=object.id node_id=DEFAULT_PK %}?cache_policy=1&all=1'
;
var
treeUrl
=
"{% url 'api-perms:user-nodes-as-tree' pk=object.id %}?
&
cache_policy=1"
;
var
treeUrl
=
"{% url 'api-perms:user-nodes-as-tree' pk=object.id %}?cache_policy=1"
;
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
initTree
();
initTree
();
...
...
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