-
Notifications
You must be signed in to change notification settings - Fork 1
/
kafka.html
49 lines (42 loc) · 2.07 KB
/
kafka.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
46
47
48
49
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<!-- JavaScript Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"></script>
<title>Document</title>
</head>
<body>
<div id="1" style="width: 300px; flex-direction: column; margin: auto; margin-top: 20px;"></div>
<button type="button" class="btn btn-primary" style="margin-left: 48%;">Save</button>
<script>
fetch('./kafka.json')
.then(function (response) {
return response.json();
})
.then(function (data) {
for (var i = 0; i < data.length; i++) {
var newfield = document.createElement('input');
newfield.setAttribute('type', data[i].type);
newfield.setAttribute('name', data[i].name);
newfield.setAttribute('required', data[i].required);
var label1 = document.createElement('label');
label1.innerText = data[i].name;
label1.style.marginLeft = "5px";
label1.setAttribute('for', data[i].name);
newfield.style.margin = "2px";
newfield.style.width = "300px"
document.getElementById("1").appendChild(label1);
document.getElementById("1").appendChild(newfield);
document.getElementById("1").appendChild(document.createElement('br'));
}
})
</script>
</body>
</html>