deleteZookeeperData.jsp
1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<%@page import="java.io.StringWriter"%>
<%@page import="com.taobao.pamirs.schedule.ConsoleManager"%>
<%@ page contentType="text/html; charset=GB2312" %>
<%
if(ConsoleManager.isInitial() == false){
response.sendRedirect("config.jsp");
}
%>
<html>
<body style="font-size:12px;">
<%
String path = request.getParameter("path");
String action = request.getParameter("action");
if(action == null){
action ="query";
}
if(path == null){
path = ConsoleManager.getScheduleStrategyManager().getRootPath();
action ="query";
}
StringWriter writer = new StringWriter();
if(action.equals("delete")){
try{
ConsoleManager.getScheduleStrategyManager().deleteTree(path);
writer.write("删除目录:" + path + "成功!");
}catch(Exception e){
writer.write(e.getMessage());
}
}else{
ConsoleManager.getScheduleStrategyManager().printTree(path,writer,"<br/>");
}
%>
数据路径:
<input id="path" type="text" size="80" value="<%=path%>"/>
<input type="button" value="查询" onclick="queryPath()"/>
<input type="checkbox" id="openDeleteButton" onclick="openDelete()">
<input type="button" id ="deleteButton" disabled="disabled" value="删除" onclick="deletePath()"/>
<LABEL style="color:red"><b>请注意,会删除改目录及子目录的所有内容,而且不可恢复!</b></LABEL >
<hr/>
<pre>
<%=writer.getBuffer().toString()%>
</pre>
</body>
</html>
<script>
function queryPath(){
var url = "deleteZookeeperData.jsp?action=query&path=" + document.all("path").value;
location.href= url;
}
function deletePath(){
location.href="deleteZookeeperData.jsp?action=delete&path=" + document.all("path").value;
}
function openDelete(){
if(document.all("openDeleteButton").checked == false){
document.all("deleteButton").disabled=true;
}else{
document.all("deleteButton").disabled=false;
}
}
</script>