DmitrMakeev
commited on
Commit
•
6587908
1
Parent(s):
05fe525
Update biz_v.html
Browse files- biz_v.html +28 -18
biz_v.html
CHANGED
@@ -244,21 +244,30 @@ button:hover {
|
|
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 |
-
|
261 |
-
message: 'Загрузка пользователей началась'
|
262 |
});
|
263 |
fetch('/upload_csv', {
|
264 |
method: 'POST',
|
@@ -268,7 +277,6 @@ button:hover {
|
|
268 |
.then(data => {
|
269 |
notyf.open({
|
270 |
type: 'success',
|
271 |
-
background: 'green',
|
272 |
message: data.message
|
273 |
});
|
274 |
})
|
@@ -280,7 +288,16 @@ button:hover {
|
|
280 |
});
|
281 |
});
|
282 |
});
|
|
|
283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
let requestButtonClicked = false;
|
285 |
document.getElementById('sendRequestButton').addEventListener('click', function() {
|
286 |
if (requestButtonClicked) return;
|
@@ -300,11 +317,6 @@ button:hover {
|
|
300 |
.then(data => {
|
301 |
console.log('JSON Response:', data);
|
302 |
createDropdown(data);
|
303 |
-
notyf.open({
|
304 |
-
type: 'success',
|
305 |
-
background: 'green',
|
306 |
-
message: 'Пользователи добавлены в базу данных WhatsGRM'
|
307 |
-
});
|
308 |
})
|
309 |
.catch(error => {
|
310 |
console.error('Error:', error);
|
@@ -314,7 +326,6 @@ button:hover {
|
|
314 |
requestButtonClicked = false;
|
315 |
});
|
316 |
});
|
317 |
-
|
318 |
function createDropdown(data) {
|
319 |
const container = document.getElementById('dropdown-container');
|
320 |
container.innerHTML = '';
|
@@ -332,7 +343,6 @@ button:hover {
|
|
332 |
sendGetRequestButton.removeEventListener('click', handleGetRequest);
|
333 |
sendGetRequestButton.addEventListener('click', handleGetRequest);
|
334 |
}
|
335 |
-
|
336 |
function handleGetRequest() {
|
337 |
const selectedValue = document.getElementById('dropdown').value;
|
338 |
const token = document.getElementById('tokenInput').value;
|
|
|
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 |
+
message: 'Загрузка началась, пожалуйста, подождите'
|
|
|
271 |
});
|
272 |
fetch('/upload_csv', {
|
273 |
method: 'POST',
|
|
|
277 |
.then(data => {
|
278 |
notyf.open({
|
279 |
type: 'success',
|
|
|
280 |
message: data.message
|
281 |
});
|
282 |
})
|
|
|
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;
|
|
|
317 |
.then(data => {
|
318 |
console.log('JSON Response:', data);
|
319 |
createDropdown(data);
|
|
|
|
|
|
|
|
|
|
|
320 |
})
|
321 |
.catch(error => {
|
322 |
console.error('Error:', error);
|
|
|
326 |
requestButtonClicked = false;
|
327 |
});
|
328 |
});
|
|
|
329 |
function createDropdown(data) {
|
330 |
const container = document.getElementById('dropdown-container');
|
331 |
container.innerHTML = '';
|
|
|
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;
|