Update biz_v.html
Browse files- biz_v.html +23 -28
biz_v.html
CHANGED
@@ -244,30 +244,21 @@ button:hover {
|
|
244 |
<!-- Подключение скрипта Notyf -->
|
245 |
<script src="https://cdn.jsdelivr.net/npm/notyf/notyf.min.js"></script>
|
246 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
document.getElementById('uploadForm').addEventListener('submit', function(event) {
|
248 |
event.preventDefault();
|
249 |
const form = new FormData(this);
|
250 |
-
const notyf = new Notyf({
|
251 |
-
duration: 5000,
|
252 |
-
position: {
|
253 |
-
x: 'right',
|
254 |
-
y: 'top'
|
255 |
-
},
|
256 |
-
types: [
|
257 |
-
{
|
258 |
-
type: 'info',
|
259 |
-
background: 'green',
|
260 |
-
icon: {
|
261 |
-
className: 'notyf__icon--info',
|
262 |
-
tagName: 'span',
|
263 |
-
text: ''
|
264 |
-
}
|
265 |
-
}
|
266 |
-
]
|
267 |
-
});
|
268 |
notyf.open({
|
269 |
type: 'info',
|
270 |
-
|
|
|
271 |
});
|
272 |
fetch('/upload_csv', {
|
273 |
method: 'POST',
|
@@ -277,6 +268,7 @@ button:hover {
|
|
277 |
.then(data => {
|
278 |
notyf.open({
|
279 |
type: 'success',
|
|
|
280 |
message: data.message
|
281 |
});
|
282 |
})
|
@@ -288,16 +280,7 @@ button:hover {
|
|
288 |
});
|
289 |
});
|
290 |
});
|
291 |
-
</script>
|
292 |
|
293 |
-
<script>
|
294 |
-
const notyf = new Notyf({
|
295 |
-
duration: 5000,
|
296 |
-
position: {
|
297 |
-
x: 'right',
|
298 |
-
y: 'top',
|
299 |
-
},
|
300 |
-
});
|
301 |
let requestButtonClicked = false;
|
302 |
document.getElementById('sendRequestButton').addEventListener('click', function() {
|
303 |
if (requestButtonClicked) return;
|
@@ -306,6 +289,11 @@ button:hover {
|
|
306 |
const minDate = document.getElementById('dateSelect').value;
|
307 |
const type = document.getElementById('typeSelect').value;
|
308 |
const url = '/send_request';
|
|
|
|
|
|
|
|
|
|
|
309 |
fetch(url, {
|
310 |
method: 'POST',
|
311 |
headers: {
|
@@ -317,6 +305,11 @@ button:hover {
|
|
317 |
.then(data => {
|
318 |
console.log('JSON Response:', data);
|
319 |
createDropdown(data);
|
|
|
|
|
|
|
|
|
|
|
320 |
})
|
321 |
.catch(error => {
|
322 |
console.error('Error:', error);
|
@@ -326,6 +319,7 @@ button:hover {
|
|
326 |
requestButtonClicked = false;
|
327 |
});
|
328 |
});
|
|
|
329 |
function createDropdown(data) {
|
330 |
const container = document.getElementById('dropdown-container');
|
331 |
container.innerHTML = '';
|
@@ -343,6 +337,7 @@ button:hover {
|
|
343 |
sendGetRequestButton.removeEventListener('click', handleGetRequest);
|
344 |
sendGetRequestButton.addEventListener('click', handleGetRequest);
|
345 |
}
|
|
|
346 |
function handleGetRequest() {
|
347 |
const selectedValue = document.getElementById('dropdown').value;
|
348 |
const token = document.getElementById('tokenInput').value;
|
|
|
244 |
<!-- Подключение скрипта Notyf -->
|
245 |
<script src="https://cdn.jsdelivr.net/npm/notyf/notyf.min.js"></script>
|
246 |
<script>
|
247 |
+
const notyf = new Notyf({
|
248 |
+
duration: 5000,
|
249 |
+
position: {
|
250 |
+
x: 'right',
|
251 |
+
y: 'top',
|
252 |
+
},
|
253 |
+
});
|
254 |
+
|
255 |
document.getElementById('uploadForm').addEventListener('submit', function(event) {
|
256 |
event.preventDefault();
|
257 |
const form = new FormData(this);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
notyf.open({
|
259 |
type: 'info',
|
260 |
+
background: 'yellow',
|
261 |
+
message: 'Загрузка пользователей началась'
|
262 |
});
|
263 |
fetch('/upload_csv', {
|
264 |
method: 'POST',
|
|
|
268 |
.then(data => {
|
269 |
notyf.open({
|
270 |
type: 'success',
|
271 |
+
background: 'green',
|
272 |
message: data.message
|
273 |
});
|
274 |
})
|
|
|
280 |
});
|
281 |
});
|
282 |
});
|
|
|
283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
let requestButtonClicked = false;
|
285 |
document.getElementById('sendRequestButton').addEventListener('click', function() {
|
286 |
if (requestButtonClicked) return;
|
|
|
289 |
const minDate = document.getElementById('dateSelect').value;
|
290 |
const type = document.getElementById('typeSelect').value;
|
291 |
const url = '/send_request';
|
292 |
+
notyf.open({
|
293 |
+
type: 'info',
|
294 |
+
background: 'yellow',
|
295 |
+
message: 'Загрузка пользователей началась'
|
296 |
+
});
|
297 |
fetch(url, {
|
298 |
method: 'POST',
|
299 |
headers: {
|
|
|
305 |
.then(data => {
|
306 |
console.log('JSON Response:', data);
|
307 |
createDropdown(data);
|
308 |
+
notyf.open({
|
309 |
+
type: 'success',
|
310 |
+
background: 'green',
|
311 |
+
message: 'Пользователи добавлены в базу данных WhatsGRM'
|
312 |
+
});
|
313 |
})
|
314 |
.catch(error => {
|
315 |
console.error('Error:', error);
|
|
|
319 |
requestButtonClicked = false;
|
320 |
});
|
321 |
});
|
322 |
+
|
323 |
function createDropdown(data) {
|
324 |
const container = document.getElementById('dropdown-container');
|
325 |
container.innerHTML = '';
|
|
|
337 |
sendGetRequestButton.removeEventListener('click', handleGetRequest);
|
338 |
sendGetRequestButton.addEventListener('click', handleGetRequest);
|
339 |
}
|
340 |
+
|
341 |
function handleGetRequest() {
|
342 |
const selectedValue = document.getElementById('dropdown').value;
|
343 |
const token = document.getElementById('tokenInput').value;
|