remove frontend for rewrite
This commit is contained in:
parent
c3a88e187f
commit
e481968ab2
@ -1,33 +0,0 @@
|
||||
const apiUrl = 'http://localhost:8001';
|
||||
|
||||
function createTable(selector, items) {
|
||||
const $table = $("<table></table>");
|
||||
const $headerRow = $("<tr></tr>");
|
||||
|
||||
$.each(Object.keys(items[0]), function(i, key) {
|
||||
const $th = $("<th></th>").text(key)
|
||||
$headerRow.append($th);
|
||||
});
|
||||
$table.append($headerRow);
|
||||
|
||||
$.each(items, function (i, item) {
|
||||
const $tr = $("<tr></tr>");
|
||||
$.each(item, function(key, value) {
|
||||
const $td = $("<td></td>").text(value);
|
||||
$tr.append($td);
|
||||
});
|
||||
$table.append($tr);
|
||||
});
|
||||
|
||||
console.log($table);
|
||||
|
||||
$(selector).append($table);
|
||||
}
|
||||
function getCatalog() {
|
||||
$.getJSON(apiUrl + "/catalog", function (resp) {
|
||||
createTable('.posts', resp);
|
||||
});
|
||||
}
|
||||
$( document ).ready(function() {
|
||||
getCatalog();
|
||||
});
|
2
frontend/src/assets/js/jquery-3.7.1.min.js
vendored
2
frontend/src/assets/js/jquery-3.7.1.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Single-board Forum</title>
|
||||
<link rel="stylesheet" href="assets/css/main.css">
|
||||
<meta charset="UTF-8">
|
||||
<script src="assets/js/jquery-3.7.1.min.js"></script>
|
||||
<script src="assets/js/app.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Single-board Forum</h1>
|
||||
</header>
|
||||
<div class="posts">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user