mirror of https://github.com/jumpserver/jumpserver
Bugfix (#3014)
* [Bugfix] 修复英文时间时期的bug * [bugfix] 修复session时间日期的问题 * [Bugfix] 修改时间日志格式化错误 * [Update] 修改函数名称 * [Update] 修改函数顺序 * [Bugfix] 修复节点刷新菜单一直append的bugpull/3015/head
parent
9454854f6c
commit
421e98696c
|
@ -68,10 +68,12 @@ var treeUrl = '{% url 'api-assets:node-children-tree' %}?assets=0';
|
|||
// "otherMenu": "",
|
||||
// "showAssets": false,
|
||||
// }
|
||||
var inited = false;
|
||||
function initNodeTree(options) {
|
||||
if (options.showAssets) {
|
||||
treeUrl = setUrlParam(treeUrl, 'assets', '1')
|
||||
}
|
||||
var asyncTreeUrl = setUrlParam(treeUrl, 'refresh', '0');
|
||||
var setting = {
|
||||
view: {
|
||||
dblClickExpand: false,
|
||||
|
@ -84,7 +86,7 @@ function initNodeTree(options) {
|
|||
},
|
||||
async: {
|
||||
enable: true,
|
||||
url: treeUrl,
|
||||
url: asyncTreeUrl,
|
||||
autoParam: ["id=key", "name=n", "level=lv"],
|
||||
type: 'get'
|
||||
},
|
||||
|
@ -109,16 +111,20 @@ function initNodeTree(options) {
|
|||
beforeAsync: options.beforeAsync || defaultCallback("Before async")
|
||||
}
|
||||
};
|
||||
$.get(treeUrl, function(data, status){
|
||||
zNodes = data;
|
||||
zTree = $.fn.zTree.init($("#nodeTree"), setting, zNodes);
|
||||
$.get(treeUrl, function (data, status) {
|
||||
zTree = $.fn.zTree.init($("#nodeTree"), setting, data);
|
||||
rootNodeAddDom(zTree, function () {
|
||||
treeUrl = setUrlParam(treeUrl, 'refresh', '1');
|
||||
initTree();
|
||||
treeUrl = setUrlParam(treeUrl, 'refresh', '0')
|
||||
initNodeTree(options);
|
||||
treeUrl = setUrlParam(treeUrl, 'refresh', '0');
|
||||
});
|
||||
inited = true;
|
||||
});
|
||||
|
||||
if (inited) {
|
||||
return
|
||||
}
|
||||
|
||||
if (options.showMenu) {
|
||||
showMenu = true;
|
||||
rMenu = $("#rMenu");
|
||||
|
|
|
@ -122,7 +122,7 @@ function initTree() {
|
|||
$.fn.zTree.init($("#assetTree"), setting, data);
|
||||
zTree = $.fn.zTree.getZTreeObj("assetTree");
|
||||
rootNodeAddDom(zTree, function () {
|
||||
treeUrl = treeUrl.replace('cache_policy=1', 'cache_policy=2');
|
||||
treeUrl = setUrlParam(treeUrl, 'cache_policy', '2');
|
||||
initTree();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<script>
|
||||
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 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 () {
|
||||
initTree();
|
||||
|
|
Loading…
Reference in New Issue