This commit is contained in:
midoks
2023-08-26 23:02:17 +08:00
parent ea462aa51d
commit 9586eeda07
2 changed files with 16 additions and 1 deletions
+15
View File
@@ -139,6 +139,19 @@ def dtGetFilePath():
return mw.returnJson(False, '无效目录')
def dtRemoveFilePath:
args = getArgs()
data = checkArgs(args, ['file'])
if not data[0]:
return data[1]
dir_path = getServerDir() + '/trace'
path = dir_path + '/' + args['file']
if os.path.exists(path):
mw.execShell('rm -rf ' + path)
return mw.returnJson(True, '删除成功!')
def dtFileList():
dir_path = getServerDir() + '/trace'
if not os.path.exists(dir_path):
@@ -191,5 +204,7 @@ if __name__ == "__main__":
print(dtFileList())
elif func == 'get_file_path':
print(dtGetFilePath())
elif func == 'remove_file_path':
print(dtRemoveFilePath())
else:
print('error')
@@ -107,7 +107,7 @@ function dtFileList(){
var tli = '';
for (var i = 0; i < alist.length; i++) {
if (i==0){
tli +='<li class="data-file-list active" data-index="'+i+'" data-file="'+alist[i]['name']+'">\
tli +='<li title="双击打开浏览" class="data-file-list active" data-index="'+i+'" data-file="'+alist[i]['name']+'">\
<span class="file">'+alist[i]['name']+'</span>\
<span class="tootls">\
<span class="glyphicon glyphicon-trash" aria-hidden="true" title="删除常用命令信息"></span>\