Commit 2733aa62 authored by Alain Takoudjou's avatar Alain Takoudjou

Fix path not found issue

parent 7beebddd
...@@ -168,27 +168,39 @@ $(document).ready(function () { ...@@ -168,27 +168,39 @@ $(document).ready(function () {
if (!key){ if (!key){
key = '0'; key = '0';
} }
$(tree).fancytree({ $.ajax({
activate: function(event, data) { type: "POST",
var node = data.node; url: $SCRIPT_ROOT + '/getPath',
}, data: {file: "instance_root"}
click: function(event, data) { })
if (!data.node.isFolder()){ .done(function(data) {
selectedFile = data.node.data.path; if (data.code === 1) {
} $(tree).fancytree({
}, activate: function(event, data) {
source: { var node = data.node;
url: $SCRIPT_ROOT + "/fileBrowser", },
data:{opt: 20, dir: path, key: key, listfiles: 'yes'}, click: function(event, data) {
cache: false if (!data.node.isFolder()){
}, selectedFile = data.node.data.path;
lazyload: function(event, data) { }
var node = data.node; },
data.result = { source: {
url: $SCRIPT_ROOT + "/fileBrowser", url: $SCRIPT_ROOT + "/fileBrowser",
data: {opt: 20, dir: node.data.path , key: node.key, listfiles: 'yes'} data:{opt: 20, dir: path, key: key, listfiles: 'yes'},
} cache: false
}, },
lazyload: function(event, data) {
var node = data.node;
data.result = {
url: $SCRIPT_ROOT + "/fileBrowser",
data: {opt: 20, dir: node.data.path , key: node.key, listfiles: 'yes'}
}
},
});
}
else {
$("#noServices").show();
}
}); });
} }
......
...@@ -84,6 +84,9 @@ ...@@ -84,6 +84,9 @@
<div id='inline_content' style='padding:10px; background:#fff;'> <div id='inline_content' style='padding:10px; background:#fff;'>
<div style='border: solid 1px #678dad; height: 300px; overflow: auto;'> <div style='border: solid 1px #678dad; height: 300px; overflow: auto;'>
<div id="fileTree"></div> <div id="fileTree"></div>
<div id="noServices" style='display:none'>
<h2>You don't have any services yet! Please run your services to choose custom log files</h2>
</div>
</div> </div>
<input type=submit value="Add file" id="addfile" class="button"> <input type=submit value="Add file" id="addfile" class="button">
</div> </div>
......
...@@ -508,7 +508,7 @@ def getPath(): ...@@ -508,7 +508,7 @@ def getPath():
list = [] list = []
for p in files: for p in files:
path = realpath(app.config, p) path = realpath(app.config, p)
if not p: if not path:
list = [] list = []
break break
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment