DmitrMakeev
commited on
Commit
•
f628a8a
1
Parent(s):
d6901d9
Update upl_csv.html
Browse files- upl_csv.html +16 -28
upl_csv.html
CHANGED
@@ -6,6 +6,8 @@
|
|
6 |
<title>CSV Upload</title>
|
7 |
<!-- Подключение стилей Notyf -->
|
8 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/notyf/notyf.min.css">
|
|
|
|
|
9 |
<style>
|
10 |
body {
|
11 |
font-family: Arial, sans-serif;
|
@@ -55,31 +57,12 @@
|
|
55 |
#uploadButton:hover {
|
56 |
background-color: #388E3C;
|
57 |
}
|
58 |
-
.
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
-webkit-animation: spin 2s linear infinite; /* Safari */
|
65 |
-
animation: spin 2s linear infinite;
|
66 |
-
display: none; /* Изначально скрыт */
|
67 |
-
position: fixed; /* Фиксированное положение */
|
68 |
-
top: 50%; /* По центру по вертикали */
|
69 |
-
left: 50%; /* По центру по горизонтали */
|
70 |
-
transform: translate(-50%, -50%); /* Центрирование */
|
71 |
-
z-index: 1000; /* Убедитесь, что спиннер находится поверх других элементов */
|
72 |
-
}
|
73 |
-
|
74 |
-
/* Safari */
|
75 |
-
@-webkit-keyframes spin {
|
76 |
-
0% { -webkit-transform: rotate(0deg); }
|
77 |
-
100% { -webkit-transform: rotate(360deg); }
|
78 |
-
}
|
79 |
-
|
80 |
-
@keyframes spin {
|
81 |
-
0% { transform: rotate(0deg); }
|
82 |
-
100% { transform: rotate(360deg); }
|
83 |
}
|
84 |
</style>
|
85 |
</head>
|
@@ -100,17 +83,22 @@
|
|
100 |
<input id="uploadButton" type="submit" value="Upload">
|
101 |
</form>
|
102 |
<div id="result"></div>
|
103 |
-
<div class="
|
|
|
|
|
104 |
|
105 |
<!-- Подключение скрипта Notyf -->
|
106 |
<script src="https://cdn.jsdelivr.net/npm/notyf/notyf.min.js"></script>
|
|
|
|
|
|
|
|
|
107 |
<script>
|
108 |
document.getElementById('uploadForm').addEventListener('submit', function(event) {
|
109 |
event.preventDefault();
|
110 |
const form = new FormData(this);
|
111 |
-
const loader = document.querySelector('.
|
112 |
loader.style.display = 'block'; // Показываем спиннер
|
113 |
-
|
114 |
fetch('/upload_csv', {
|
115 |
method: 'POST',
|
116 |
body: form
|
|
|
6 |
<title>CSV Upload</title>
|
7 |
<!-- Подключение стилей Notyf -->
|
8 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/notyf/notyf.min.css">
|
9 |
+
<!-- Подключение стилей Bootstrap -->
|
10 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
|
11 |
<style>
|
12 |
body {
|
13 |
font-family: Arial, sans-serif;
|
|
|
57 |
#uploadButton:hover {
|
58 |
background-color: #388E3C;
|
59 |
}
|
60 |
+
.center-spinner {
|
61 |
+
position: fixed;
|
62 |
+
top: 50%;
|
63 |
+
left: 50%;
|
64 |
+
transform: translate(-50%, -50%);
|
65 |
+
z-index: 1000;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
}
|
67 |
</style>
|
68 |
</head>
|
|
|
83 |
<input id="uploadButton" type="submit" value="Upload">
|
84 |
</form>
|
85 |
<div id="result"></div>
|
86 |
+
<div class="spinner-border text-success center-spinner" role="status" style="display: none;">
|
87 |
+
<span class="sr-only">Loading...</span>
|
88 |
+
</div>
|
89 |
|
90 |
<!-- Подключение скрипта Notyf -->
|
91 |
<script src="https://cdn.jsdelivr.net/npm/notyf/notyf.min.js"></script>
|
92 |
+
<!-- Подключение скриптов Bootstrap -->
|
93 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js"></script>
|
94 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script>
|
95 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
96 |
<script>
|
97 |
document.getElementById('uploadForm').addEventListener('submit', function(event) {
|
98 |
event.preventDefault();
|
99 |
const form = new FormData(this);
|
100 |
+
const loader = document.querySelector('.spinner-border');
|
101 |
loader.style.display = 'block'; // Показываем спиннер
|
|
|
102 |
fetch('/upload_csv', {
|
103 |
method: 'POST',
|
104 |
body: form
|