DmitrMakeev
commited on
Commit
•
6d40743
1
Parent(s):
91f68a0
Update upl_csv.html
Browse files- upl_csv.html +0 -44
upl_csv.html
CHANGED
@@ -6,8 +6,6 @@
|
|
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/bootstrap@4.6.2/dist/css/bootstrap.min.css">
|
11 |
<style>
|
12 |
body {
|
13 |
font-family: Arial, sans-serif;
|
@@ -57,39 +55,6 @@
|
|
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 |
-
.loader {
|
68 |
-
--b: 10px; /* border thickness */
|
69 |
-
--n: 10; /* number of dashes*/
|
70 |
-
--g: 10deg; /* gap between dashes*/
|
71 |
-
--c: green; /* the color */
|
72 |
-
|
73 |
-
width: 100px; /* size */
|
74 |
-
aspect-ratio: 1;
|
75 |
-
border-radius: 50%;
|
76 |
-
padding: 1px; /* get rid of bad outlines */
|
77 |
-
background: conic-gradient(#0000, var(--c)) content-box;
|
78 |
-
--_m: /* we use +/-1deg between colors to avoid jagged edges */
|
79 |
-
repeating-conic-gradient(#0000 0deg,
|
80 |
-
#000 1deg calc(360deg/var(--n) - var(--g) - 1deg),
|
81 |
-
#0000 calc(360deg/var(--n) - var(--g)) calc(360deg/var(--n))),
|
82 |
-
radial-gradient(farthest-side, #0000 calc(98% - var(--b)), #000 calc(100% - var(--b)));
|
83 |
-
-webkit-mask: var(--_m);
|
84 |
-
mask: var(--_m);
|
85 |
-
-webkit-mask-composite: destination-in;
|
86 |
-
mask-composite: intersect;
|
87 |
-
animation: load 1s infinite steps(var(--n));
|
88 |
-
display: none;
|
89 |
-
}
|
90 |
-
@keyframes load {
|
91 |
-
to { transform: rotate(1turn); }
|
92 |
-
}
|
93 |
</style>
|
94 |
</head>
|
95 |
<body>
|
@@ -109,27 +74,19 @@
|
|
109 |
<input id="uploadButton" type="submit" value="Upload">
|
110 |
</form>
|
111 |
<div id="result"></div>
|
112 |
-
<div class="loader center-spinner"></div>
|
113 |
|
114 |
<!-- Подключение скрипта Notyf -->
|
115 |
<script src="https://cdn.jsdelivr.net/npm/notyf/notyf.min.js"></script>
|
116 |
-
<!-- Подключение скриптов Bootstrap -->
|
117 |
-
<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.slim.min.js"></script>
|
118 |
-
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
|
119 |
-
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
|
120 |
<script>
|
121 |
document.getElementById('uploadForm').addEventListener('submit', function(event) {
|
122 |
event.preventDefault();
|
123 |
const form = new FormData(this);
|
124 |
-
const loader = document.querySelector('.loader');
|
125 |
-
loader.style.display = 'block'; // Показываем спиннер
|
126 |
fetch('/upload_csv', {
|
127 |
method: 'POST',
|
128 |
body: form
|
129 |
})
|
130 |
.then(response => response.json())
|
131 |
.then(data => {
|
132 |
-
loader.style.display = 'none'; // Скрываем спиннер после завершения
|
133 |
const notyf = new Notyf({
|
134 |
duration: 5000, // Длительность показа уведомления
|
135 |
position: {
|
@@ -152,7 +109,6 @@
|
|
152 |
})
|
153 |
.catch(error => {
|
154 |
console.error('Error:', error);
|
155 |
-
loader.style.display = 'none'; // Скрываем спиннер в случае ошибки
|
156 |
const notyf = new Notyf({
|
157 |
duration: 5000, // Длительность показа уведомления
|
158 |
position: {
|
|
|
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 |
#uploadButton:hover {
|
56 |
background-color: #388E3C;
|
57 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
</style>
|
59 |
</head>
|
60 |
<body>
|
|
|
74 |
<input id="uploadButton" type="submit" value="Upload">
|
75 |
</form>
|
76 |
<div id="result"></div>
|
|
|
77 |
|
78 |
<!-- Подключение скрипта Notyf -->
|
79 |
<script src="https://cdn.jsdelivr.net/npm/notyf/notyf.min.js"></script>
|
|
|
|
|
|
|
|
|
80 |
<script>
|
81 |
document.getElementById('uploadForm').addEventListener('submit', function(event) {
|
82 |
event.preventDefault();
|
83 |
const form = new FormData(this);
|
|
|
|
|
84 |
fetch('/upload_csv', {
|
85 |
method: 'POST',
|
86 |
body: form
|
87 |
})
|
88 |
.then(response => response.json())
|
89 |
.then(data => {
|
|
|
90 |
const notyf = new Notyf({
|
91 |
duration: 5000, // Длительность показа уведомления
|
92 |
position: {
|
|
|
109 |
})
|
110 |
.catch(error => {
|
111 |
console.error('Error:', error);
|
|
|
112 |
const notyf = new Notyf({
|
113 |
duration: 5000, // Длительность показа уведомления
|
114 |
position: {
|