DmitrMakeev
commited on
Commit
•
a939a4d
1
Parent(s):
ce55078
Update biz_v.html
Browse files- biz_v.html +3 -11
biz_v.html
CHANGED
@@ -49,13 +49,6 @@
|
|
49 |
<option value="2023-01-01T00:00:00">2023-01-01</option>
|
50 |
<option value="2024-01-01T00:00:00">2024-01-01</option>
|
51 |
</select>
|
52 |
-
<label for="limitInput">Limit:</label>
|
53 |
-
<input type="number" id="limitInput" placeholder="20" min="1" max="100">
|
54 |
-
<label for="webinarType">Webinar Type:</label>
|
55 |
-
<select id="webinarType">
|
56 |
-
<option value="LiveWebinars">Live Webinars</option>
|
57 |
-
<option value="AutoWebinars">Auto Webinars</option>
|
58 |
-
</select>
|
59 |
<button id="sendRequestButton">Send Request</button>
|
60 |
<textarea id="responseArea" rows="10" cols="50" readonly></textarea>
|
61 |
<div id="dropdown-container"></div>
|
@@ -66,20 +59,19 @@
|
|
66 |
document.getElementById('sendRequestButton').addEventListener('click', function() {
|
67 |
const token = document.getElementById('tokenInput').value;
|
68 |
const minDate = document.getElementById('dateSelect').value;
|
69 |
-
const limit = document.getElementById('limitInput').value;
|
70 |
-
const webinarType = document.getElementById('webinarType').value;
|
71 |
const url = '/send_request';
|
72 |
fetch(url, {
|
73 |
method: 'POST',
|
74 |
headers: {
|
75 |
'Content-Type': 'application/x-www-form-urlencoded'
|
76 |
},
|
77 |
-
body: 'token=' + encodeURIComponent(token) + '&minDate=' + encodeURIComponent(minDate)
|
78 |
})
|
79 |
.then(response => response.json())
|
80 |
.then(data => {
|
81 |
console.log('JSON Response:', data);
|
82 |
document.getElementById('responseArea').value = JSON.stringify(data, null, 2);
|
|
|
83 |
createDropdown(data);
|
84 |
})
|
85 |
.catch(error => {
|
@@ -87,7 +79,6 @@
|
|
87 |
document.getElementById('responseArea').value = 'Error: ' + error.message;
|
88 |
});
|
89 |
});
|
90 |
-
|
91 |
function createDropdown(data) {
|
92 |
const container = document.getElementById('dropdown-container');
|
93 |
const select = document.createElement('select');
|
@@ -99,6 +90,7 @@
|
|
99 |
select.appendChild(option);
|
100 |
});
|
101 |
container.appendChild(select);
|
|
|
102 |
document.getElementById('sendGetRequestButton').addEventListener('click', function() {
|
103 |
const selectedValue = document.getElementById('dropdown').value;
|
104 |
const token = document.getElementById('tokenInput').value;
|
|
|
49 |
<option value="2023-01-01T00:00:00">2023-01-01</option>
|
50 |
<option value="2024-01-01T00:00:00">2024-01-01</option>
|
51 |
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
<button id="sendRequestButton">Send Request</button>
|
53 |
<textarea id="responseArea" rows="10" cols="50" readonly></textarea>
|
54 |
<div id="dropdown-container"></div>
|
|
|
59 |
document.getElementById('sendRequestButton').addEventListener('click', function() {
|
60 |
const token = document.getElementById('tokenInput').value;
|
61 |
const minDate = document.getElementById('dateSelect').value;
|
|
|
|
|
62 |
const url = '/send_request';
|
63 |
fetch(url, {
|
64 |
method: 'POST',
|
65 |
headers: {
|
66 |
'Content-Type': 'application/x-www-form-urlencoded'
|
67 |
},
|
68 |
+
body: 'token=' + encodeURIComponent(token) + '&minDate=' + encodeURIComponent(minDate)
|
69 |
})
|
70 |
.then(response => response.json())
|
71 |
.then(data => {
|
72 |
console.log('JSON Response:', data);
|
73 |
document.getElementById('responseArea').value = JSON.stringify(data, null, 2);
|
74 |
+
// Создание выпадающего списка
|
75 |
createDropdown(data);
|
76 |
})
|
77 |
.catch(error => {
|
|
|
79 |
document.getElementById('responseArea').value = 'Error: ' + error.message;
|
80 |
});
|
81 |
});
|
|
|
82 |
function createDropdown(data) {
|
83 |
const container = document.getElementById('dropdown-container');
|
84 |
const select = document.createElement('select');
|
|
|
90 |
select.appendChild(option);
|
91 |
});
|
92 |
container.appendChild(select);
|
93 |
+
// Добавление обработчика для кнопки отправки GET-запроса
|
94 |
document.getElementById('sendGetRequestButton').addEventListener('click', function() {
|
95 |
const selectedValue = document.getElementById('dropdown').value;
|
96 |
const token = document.getElementById('tokenInput').value;
|