mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-11-29 18:38:32 +08:00
删除脚本模板
This commit is contained in:
parent
3088fce94c
commit
2a927e5acf
@ -5,6 +5,7 @@
|
||||
### 新增功能
|
||||
|
||||
1. 新增线程列表监控(感谢@其锋)
|
||||
2. 新增节点脚本模板(感谢@其锋)
|
||||
|
||||
### 解决BUG、优化功能
|
||||
|
||||
|
@ -68,7 +68,7 @@ public class ScriptServer extends BaseOperService<ScriptModel> {
|
||||
public void deleteItem(String id) {
|
||||
ScriptModel scriptModel = getItem(id);
|
||||
if (scriptModel != null) {
|
||||
FileUtil.del(scriptModel.getFile(true));
|
||||
FileUtil.del(scriptModel.getFile(true).getParentFile());
|
||||
}
|
||||
deleteJson(AgentConfigBean.SCRIPT, id);
|
||||
}
|
||||
|
@ -105,6 +105,7 @@ public enum NodeUrl {
|
||||
Script_Item("/script/item.json"),
|
||||
Script_Save("/script/save.json"),
|
||||
Script_Upload("/script/upload.json"),
|
||||
Script_Del("/script/del.json"),
|
||||
|
||||
|
||||
;
|
||||
|
@ -58,6 +58,13 @@ public class ScriptController extends BaseServerController {
|
||||
return NodeForward.request(getNode(), getRequest(), NodeUrl.Script_Save).toString();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "del.json", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
||||
@ResponseBody
|
||||
@UrlPermission(value = Role.System, optType = UserOperateLogV1.OptType.Save_Del)
|
||||
public String del() {
|
||||
return NodeForward.request(getNode(), getRequest(), NodeUrl.Script_Del).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入脚本
|
||||
*
|
||||
|
@ -237,6 +237,7 @@ public class UserOperateLogV1 extends BaseJsonModel {
|
||||
Script_Start(40,"执行脚本"),
|
||||
Script_Stop(41,"停止脚本"),
|
||||
Save_Upload(34, "导入脚本模板"),
|
||||
Save_Del(34, "删除脚本模板"),
|
||||
|
||||
;
|
||||
private int code;
|
||||
|
@ -40,6 +40,10 @@
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
|
||||
|
||||
#if($item)
|
||||
<a class="layui-btn layui-btn-warm" data-id="$item.id" id="delete">删除</a>
|
||||
#end
|
||||
</div>
|
||||
</div>
|
||||
#end
|
||||
@ -63,6 +67,36 @@
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#delete").click(function () {
|
||||
var id = $(this).attr("data-id");
|
||||
var type = $(this).attr("type");
|
||||
var msg = '确定删除此脚本模板吗 ' + id + '?';
|
||||
layer.confirm(msg, {
|
||||
title: '系统提示'
|
||||
}, function (index) {
|
||||
loadingAjax({
|
||||
url: './del.json',
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
success: function (data) {
|
||||
layer.msg(data.msg);
|
||||
if (200 == data.code) {
|
||||
autoClose();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function autoClose() {
|
||||
setTimeout(function () {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
parent.location.reload();
|
||||
}, 2000);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -49,7 +49,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
#end
|
||||
#if(!$array)
|
||||
#if(!$array || $array.size()<=0)
|
||||
<tr>
|
||||
<td colspan="5">没有相关信息</td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user