Commit 3068f490 by 钟明宏

optimized content show

parent 2e32da56
......@@ -71,11 +71,19 @@ public class IndexController {
if (isRole || developer.exitProject(file.getName())) {
html.append("<tr>");
//项目名字
html.append("<td>").append("<button type=\"button\" class=\"btn btn-link\" url='/").append(file.getName()).append("/index.html'>").append(file.getName()).append("</button>").append("</td>");
html.append("<td>").append("<button type=\"button\" class=\"btn btn-link\"")
.append("url='/").append(file.getName()).append("/index.html'>").append(file.getName()).append("</button>").append("</td>");
html.append("<td>").append(projectAttribute.getVersion()).append("</td>");
//项目时间
html.append("<td>").append(DateFormatUtils.format(file.lastModified(), "yyyy-MM-dd HH:mm:ss")).append("</td>");
html.append("<td>").append(projectAttribute.getDescription()).append("</td>");
if (projectAttribute.getDescription() != null && projectAttribute.getDescription().length() > 20) {
html.append("<td><button type='button' class='btn btn-link' title='").append(projectAttribute.getDescription()).append("' data-toggle=\"tooltip\" data-placement=\"top\"")
.append("url='/").append(file.getName()).append("/index.html'>");
html.append(projectAttribute.getDescription().substring(0, 20))
.append("</button></td>");
} else {
html.append("<td>").append(projectAttribute.getDescription()).append("</td>");
}
//是有有删除标记
if (isRole) {
html.append("<td>").append("<button type=\"button\" class=\"btn btn-danger\" url='/del/").append(file.getName()).append("'>删除</button>").append("</td>");
......@@ -88,14 +96,15 @@ public class IndexController {
html.append("</body>");
html.append("<script type=\"text/javascript\" src=\"/jquery-3.4.1.min.js\" ></script>");
html.append("<script>");
html.append("$(\".btn-danger\").click(function(){\n" +
"\t\t\tvar url = $(this).attr(\"url\");\n" +
"\t\t\twindow.location=url;\n" +
"\t\t})\n" +
"\t\t$(\".btn-link\").click(function(){\n" +
"\t\t\tvar url = $(this).attr(\"url\");\n" +
"\t\t\twindow.location=url;\n" +
"\t\t})");
html.append("$(\".btn-danger\").click(function(){\n")
.append("\t\t\tvar url = $(this).attr(\"url\");\n")
.append("\t\t\twindow.location=url;\n")
.append("\t\t})\n")
.append("\t\t$(\".btn-link\").click(function(){\n")
.append("\t\t\tvar url = $(this).attr(\"url\");\n")
.append("if(url == undefined)return;")
.append("\t\t\twindow.location=url;\n")
.append("\t\t})");
html.append("</script>");
html.append("</html>");
response.setContentType("text/html;charset=UTF-8");
......
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 sign in to comment