DmitrMakeev commited on
Commit
bcbfb06
·
verified ·
1 Parent(s): 493367f

Update table.html

Browse files
Files changed (1) hide show
  1. table.html +63 -0
table.html CHANGED
@@ -62,11 +62,74 @@
62
  #delite_db:hover {
63
  background-color: #388E3C;
64
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
  </style>
67
  </head>
68
  <body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
 
 
 
 
 
 
 
 
 
 
70
  <!-- Навигационная панель -->
71
  <nav class="navbar navbar-light bg-light w-100">
72
  <div class="container">
 
62
  #delite_db:hover {
63
  background-color: #388E3C;
64
  }
65
+
66
+
67
+ #protection-overlay {
68
+ position: fixed;
69
+ top: 0;
70
+ left: 0;
71
+ width: 100%;
72
+ height: 100%;
73
+ background: rgba(0, 0, 0, 0.5); /* Полупрозрачный чёрный */
74
+ z-index: 9999; /* На передний план */
75
+ display: block; /* Включено по умолчанию */
76
+ pointer-events: auto; /* Блокирует клики */
77
+ }
78
+
79
 
80
  </style>
81
  </head>
82
  <body>
83
+ <div id="protection-overlay"></div> <!-- Полупрозрачный фон -->
84
+ <script>
85
+ document.addEventListener("DOMContentLoaded", function () {
86
+ const overlay = document.getElementById("protection-overlay");
87
+ let pageKey = localStorage.getItem("page_key");
88
+
89
+ // Функция проверки ключа
90
+ function checkApiKey(apiKey) {
91
+ fetch(`/page_key?api_sys=${apiKey}`)
92
+ .then(response => response.json())
93
+ .then(data => {
94
+ if (data.status === "ok") {
95
+ overlay.style.display = "none"; // ✅ Убираем защиту
96
+ } else {
97
+ requestNewKey("Неверный код. Введите заново!");
98
+ }
99
+ })
100
+ .catch(() => requestNewKey("Ошибка сервера. Попробуйте снова."));
101
+ }
102
+
103
+ // Функция запроса нового ключа
104
+ function requestNewKey(message = "Введите код доступа:") {
105
+ Swal.fire({
106
+ title: "Внимание!",
107
+ text: message,
108
+ input: "text",
109
+ inputAttributes: { autocapitalize: "off" },
110
+ showCancelButton: false,
111
+ confirmButtonText: "Отправить",
112
+ confirmButtonColor: "#3085d6",
113
+ allowOutsideClick: false
114
+ }).then((result) => {
115
+ if (result.isConfirmed && result.value) {
116
+ localStorage.setItem("page_key", result.value); // 🔥 Сохраняем ключ
117
+ checkApiKey(result.value); // 🔥 Проверяем ключ
118
+ } else {
119
+ requestNewKey("Введите корректный код!"); // Повторяем ввод
120
+ }
121
+ });
122
+ }
123
 
124
+ // Если ключ есть → Проверяем его, иначе запрашиваем новый
125
+ if (pageKey) {
126
+ checkApiKey(pageKey);
127
+ } else {
128
+ requestNewKey();
129
+ }
130
+ });
131
+ </script>
132
+
133
  <!-- Навигационная панель -->
134
  <nav class="navbar navbar-light bg-light w-100">
135
  <div class="container">