first commit
This commit is contained in:
56
setup.html
Normal file
56
setup.html
Normal file
@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>操作表</title>
|
||||
<link href="./bootstrap.min.css" rel="stylesheet">
|
||||
<script src="./jquery.min.js"></script>
|
||||
<script src="./bootstrap.min.js"></script>
|
||||
<script>
|
||||
// 确保在文档加载完成后执行
|
||||
$(document).ready(function(operation, table) {
|
||||
function query(operation, table) {
|
||||
$.ajax({
|
||||
url: "/setup.php",
|
||||
type: "POST",
|
||||
data: {
|
||||
operation: operation,
|
||||
table: table
|
||||
}
|
||||
}).done((res) => {
|
||||
console.log(res)
|
||||
// 检查并使用返回的JSON数据
|
||||
$("#result").html(res);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
$('#result').html('Request failed: ' + textStatus);
|
||||
});
|
||||
}
|
||||
|
||||
// 按钮点击事件绑定
|
||||
$('button').click(function() {
|
||||
const operation = $(this).attr('data-operation');
|
||||
const table = $('#mySelect').val()
|
||||
query(operation, table);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="text-center mb-4 mt-3">操作表</h1>
|
||||
<div class="container-sm mt-4 w-75 border border-2 p-4 rounded-3">
|
||||
<div class="d-flex h-100 ">
|
||||
<button data-operation="del" class="btn btn-danger m-2">drop table</button>
|
||||
<button data-operation="create" class="btn btn-success m-2">create table</button>
|
||||
<button data-operation="select" class="btn btn-primary m-2">select table</button>
|
||||
<select id="mySelect" class="form-select m-2 " aria-label="Select table">
|
||||
<option value="user_70" selected>user_70</option>
|
||||
<option value="nucleic_acid_test_2">nucleic_acid_test_2</option>
|
||||
<option value="patient_90">patient_90</option>
|
||||
</select>
|
||||
<button class="btn btn-secondary m-2" onclick="location.reload();">refresh</button>
|
||||
</div>
|
||||
<div class="m-4" id="result" style="margin-top:15px; margin-left: 20px; margin-right: 100px; padding: 50px">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user