Gogs 5 rokov pred
rodič
commit
231784f66b
1 zmenil súbory, kde vykonal 22 pridanie a 14 odobranie
  1. 22 14
      src/xeshop/templates/apidoc.html

+ 22 - 14
src/xeshop/templates/apidoc.html

@@ -41,6 +41,7 @@
 	<div class="container">
 		<div class="left">
 			<ol>
+				<input id="search" type="text" style="width: 95%;margin-bottom: 10px;height: 25px;border-radius: 3px;border: 1px solid #ccc;" placeholder="请输入接口名称">
 				{% for api in apis %}
 				<li draggable="true" id="{{api.id}}"><a href="#{{api.url}}{{api.method}}" >{{api.title}}</a>
 					{% if isroot %}
@@ -53,7 +54,10 @@
 		<div class="right">
 			{% for api in apis %}
 				<div id="{{api.url}}{{api.method}}">
-					<div style="background: #ccc;margin-top:20px;"><b>{{api.url}} &nbsp;&nbsp;&nbsp;&nbsp;{{api.method}}</b></div>
+					<div style="background: #ccc;margin-top:20px;">
+						<b><font class="url">{{api.url}}</font> &nbsp;&nbsp;&nbsp;&nbsp;<font class="method">{{api.method}}</font></b>
+						<button style="margin-left:50px;padding:0px;">发送请求</button>
+					</div>
 					<label>参数:</label>
 					<div style="margin-left:25px;">
 						{% if api.params %}
@@ -150,20 +154,24 @@
             }
         }
     }
-$(function(){
-	$(".delapi").click(function(e){
-		let id = e.target.parentNode.id;
-		$.ajax({
-			type:"DELETE",
-			url:"/api/doc/",
-			contentType:"application/json",
-			data:JSON.stringify({"id":id}),
-			success:function(){
-				window.location.reload();
-			}
-		})
+	$(function(){
+		$(".delapi").click(function(e){
+			let id = e.target.parentNode.id;
+			$.ajax({
+				type:"DELETE",
+				url:"/api/doc/",
+				contentType:"application/json",
+				data:JSON.stringify({"id":id}),
+				success:function(){
+					window.location.reload();
+				}
+			})
+		});
 	});
-});
+	//
+	$("#search").input(function(){
+		console.log($(this).val());
+	})
 
 </script>
 </html>