DmitrMakeev commited on
Commit
0328fc4
·
verified ·
1 Parent(s): 27aed46

Update table.html

Browse files
Files changed (1) hide show
  1. table.html +46 -0
table.html CHANGED
@@ -10,6 +10,7 @@
10
  <link href="https://unpkg.com/[email protected]/dist/css/tabulator.min.css" rel="stylesheet">
11
  <script src="https://unpkg.com/[email protected]/dist/js/tabulator.min.js"></script>
12
  <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
 
13
 
14
  <style>
15
 
@@ -116,6 +117,51 @@ button:hover, #filter-clear:hover, #download-json:hover, #take-for-yourself:hove
116
  });
117
  </script>
118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
 
120
  <script>
121
  document.getElementById("st_onl").addEventListener("click", function() {
 
10
  <link href="https://unpkg.com/[email protected]/dist/css/tabulator.min.css" rel="stylesheet">
11
  <script src="https://unpkg.com/[email protected]/dist/js/tabulator.min.js"></script>
12
  <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
13
+ <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
14
 
15
  <style>
16
 
 
117
  });
118
  </script>
119
 
120
+
121
+ <script>
122
+ document.getElementById("delite_db").addEventListener("click", function () {
123
+ Swal.fire({
124
+ title: "Внимание",
125
+ text: "При нажатии кнопки 'Удалить' вы полностью очистите базу данных предыдущего цикла выращивания!",
126
+ icon: "warning",
127
+ showCancelButton: true,
128
+ confirmButtonColor: "#d33",
129
+ cancelButtonColor: "#3085d6",
130
+ confirmButtonText: "Удалить",
131
+ cancelButtonText: "Нет"
132
+ }).then((result) => {
133
+ if (result.isConfirmed) {
134
+ fetch("/delite_db")
135
+ .then(response => response.json())
136
+ .then(data => {
137
+ if (data.status === "ok") {
138
+ Swal.fire({
139
+ title: "Удалено!",
140
+ text: "База данных успешно очищена.",
141
+ icon: "success"
142
+ }).then(() => {
143
+ location.reload(); // 🔄 Перезагружаем страницу
144
+ });
145
+ } else {
146
+ Swal.fire({
147
+ title: "Ошибка",
148
+ text: "Не удалось очистить базу данных.",
149
+ icon: "error"
150
+ });
151
+ }
152
+ })
153
+ .catch(() => {
154
+ Swal.fire({
155
+ title: "Ошибка",
156
+ text: "Ошибка соединения с сервером.",
157
+ icon: "error"
158
+ });
159
+ });
160
+ }
161
+ });
162
+ });
163
+ </script>
164
+
165
 
166
  <script>
167
  document.getElementById("st_onl").addEventListener("click", function() {