提交 2eab2eae 编写于 作者: L leon.li

add command modify pages

上级 60c8a345
......@@ -78,7 +78,7 @@
<li class='nav-header' style="margin-top:0px;">端到端监控配置</li>
<li><a style="padding:1px 30px" href="/cat/s/config?op=aggregations">JS报错配置</a></li>
<li><a style="padding:1px 30px" href="/cat/s/config?op=urlPatterns">WEB监控配置</a></li>
<li><a style="padding:1px 30px" href="/cat/s/config?op=appConfigUpdate">APP监控配置</a></li>
<li><a style="padding:1px 30px" href="/cat/s/config?op=appList">APP监控配置</a></li>
<li><a style="padding:1px 30px" href="/cat/s/config?op=appComparisonConfigUpdate">美团对比报表</a></li>
<li><a style="padding:1px 30px" href="/cat/s/config?op=webRule">WEB告警配置</a></li>
<li><a style="padding:1px 30px" href="/cat/s/config?op=appRule">APP告警配置</a></li>
......
<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="a" uri="/WEB-INF/app.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="res" uri="http://www.unidal.org/webres"%>
<%@ taglib prefix="w" uri="http://www.unidal.org/web/core"%>
<jsp:useBean id="ctx" type="com.dianping.cat.system.page.config.Context" scope="request"/>
<jsp:useBean id="payload" type="com.dianping.cat.system.page.config.Payload" scope="request"/>
<jsp:useBean id="model" type="com.dianping.cat.system.page.config.Model" scope="request"/>
<a:body>
<script type="text/javascript">
$(document).ready(function() {
$('#appList').addClass('active');
var state = '${model.opState}';
if(state=='Success'){
$('#state').html('操作成功');
}else{
$('#state').html('操作失败');
}
setTimeout(function(){
$('#state').html('&nbsp;');
},3000);
$(document).delegate('.update', 'click', function(e){
var anchor = this,
el = $(anchor);
if(e.ctrlKey || e.metaKey){
return true;
}else{
e.preventDefault();
}
$.ajax({
type: "post",
url: anchor.href,
success : function(response, textStatus) {
$('#modalBody').html(response);
$('#modal').modal();
}
});
});
$(".delete").bind("click", function() {
return confirm("确定要删除此项目吗(不可恢复)?");
});
$(document).delegate('#updateSubmit', 'click', function(e){
var name = $("#commandName").val();
var title = $("#commandTitle").val();
var domain = $("#commandDomain").val();
var id = $("#commandId").val();
if(name == undefined || name == ""){
if($("#errorMessage").length == 0){
$("#commandName").after($("<span class=\"text-error\" id=\"errorMessage\"> 该字段不能为空</span>"));
}
return;
}
if(title==undefined){
title = "";
}
if(domain==undefined){
domain="";
}
if(id==undefined){
id="";
}
window.location.href = "/cat/s/config?op=appSubmit&name="+name+"&title="+title+"&domain="+domain+"&id="+id;
})
});
</script>
<div>
<div class="row-fluid">
<div class="span2">
<%@include file="../configTree.jsp"%>
</div>
<div id="modal" class="modal hide fade" style="width:650px" tabindex="-1" role="dialog" aria-labelledby="ruleLabel" aria-hidden="true">
<div class="modal-header text-center">
<h3>App Command编辑</h3>
</div>
<div class="modal-body" id="modalBody">
</div>
<div class="modal-footer">
<button class="btn btn-primary" id="updateSubmit">提交</button>
<button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
</div>
</div>
<div class="span10">
<h4 id="state" class="text-center text-error">&nbsp;</h4>
<div>
</br>
<table class="table table-striped table-bordered table-condensed table-hover" id="contents" width="100%">
<thead>
<tr class="odd">
<th width="20%">名称</th>
<th width="35%">项目</th>
<th width="30%">标题</th>
<th width="15%">操作&nbsp;&nbsp; <a class='btn btn-primary btn-small update' href="?op=appUpdate">新增</a></th>
</tr></thead><tbody>
<c:forEach var="item" items="${model.commands}">
<tr>
<td>${item.name }</td>
<td>${item.domain }</td>
<td>${item.title }</td>
<td><a class='btn btn-small btn-primary update' href="?op=appUpdate&id=${item.id}">编辑</a>
<a class='delete btn btn-small btn-danger' href="?op=appPageDelete&id=${item.id}">删除</a></td>
</tr>
</c:forEach></tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</a:body>
\ No newline at end of file
<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="res" uri="http://www.unidal.org/webres"%>
<%@ taglib prefix="w" uri="http://www.unidal.org/web/core"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<jsp:useBean id="ctx" type="com.dianping.cat.system.page.config.Context" scope="request"/>
<jsp:useBean id="payload" type="com.dianping.cat.system.page.config.Payload" scope="request"/>
<jsp:useBean id="model" type="com.dianping.cat.system.page.config.Model" scope="request"/>
名称: <input name="name" value="${model.updateCommand.name}" id="commandName"/><br/>
项目: <input name="domain" value="${model.updateCommand.domain}" id="commandDomain"/><br/>
标题: <input name="title" value="${model.updateCommand.title}" id="commandTitle"/><br/>
<c:if test="${not empty payload.id}">
<input name="id" value="${payload.id}" id="commandId" style="display:none"/>
</c:if>
\ No newline at end of file
......@@ -8,13 +8,14 @@
<li class='nav-header'>端到端监控配置</li>
<li class="text-left" id="aggregationList"><a href="?op=aggregations">JS报错配置</a></li>
<li class="text-left" id="urlPatternList"><a href="?op=urlPatterns">WEB监控配置</a></li>
<li class="text-left" id="appConfigUpdate"><a href="?op=appConfigUpdate">APP监控配置</a></li>
<li class="text-left" id="appList"><a href="?op=appList">APP监控配置</a></li>
<li class="text-left" id="appConfigUpdate"><a href="?op=appConfigUpdate" style="display:none">APP全局配置</a></li>
<li class="text-left" id="appComparisonConfigUpdate"><a href="?op=appComparisonConfigUpdate">美团对比报表</a></li>
<li class="text-left" id="webRule"><a href="?op=webRule">WEB告警配置</a></li>
<li class="text-left" id="appRule"><a href="?op=appRule">APP告警配置</a></li>
<li class='nav-header'>应用监控配置</li>
<li class="text-left" id="metricConfigList"><a href="?op=metricConfigList">业务监控规则</a></li>
<li class="text-left" id="metricRuleConfigUpdate"><a href="?op=metricRuleConfigUpdate" style="display:none">业务监控规则</a></li>
<li class="text-left" id="metricRuleConfigUpdate"><a href="?op=metricRuleConfigUpdate" style="display:none">业务全局规则</a></li>
<li class="text-left" style="display:none" id="domainMetricRuleConfigUpdate"><a href="?op=domainMetricRuleConfigUpdate">业务XML规则</a></li>
<li class="text-left" id="exceptionConfigList"><a href="?op=exception">异常告警配置</a></li>
<li class="text-left" id="bugConfigUpdate"><a href="?op=bugConfigUpdate">框架异常配置</a></li>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册