-
Notifications
You must be signed in to change notification settings - Fork 179
/
add.html
executable file
·45 lines (45 loc) · 1.67 KB
/
add.html
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
<section class="content-header">
<h1>添加URI映射</h1>
</section>
<section class="content">
<!-- /.row -->
<div class="row">
<div class="col-xs-12">
<div class="box box-primary">
<div class="box-body">
<div class="form-group">
<label>原始请求URI(例如 / 会匹配 / 开头的所有请求)</label>
<input type="text" class="form-control" name="request_uri" placeholder="原始请求URI">
</div>
<div class="form-group">
<label>后端服务URI</label>
<input type="text" class="form-control" name="original_uri" placeholder="后端服务URI">
</div>
<div class="form-group">
<label >配置备注描述</label>
<input type="text" class="form-control" name="description" placeholder="配置备注描述">
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<button id="add-api-btn" class="btn btn-primary">添加</button>
<button class="btn btn-default" onclick="load_page('/pages/api/list.html');">取消</button>
</div>
</div>
<!-- /.box -->
</div>
</div>
</section>
<script type="text/javascript">
$(".content-header h1").html(domain_name+" > "+service_name+" > 添加URI映射")
$("#add-api-btn").click(function(){
var params = {service_id:service_id,request_uri:$("input[name='request_uri']").val(),original_uri:$("input[name='original_uri']").val(),description:$("input[name='description']").val()};
api_invoke("/api/v1/api/add", params, function(data){
if(data.errno == 0){
load_page("/pages/api/list.html");
}else{
alert(data.msg);
}
});
});
</script>