Upload folder using huggingface_hub
Browse files- complaints/login.html +22 -3
complaints/login.html
CHANGED
|
@@ -224,12 +224,31 @@
|
|
| 224 |
|
| 225 |
<div style="margin-top: 2rem; font-size: 0.8rem; color: var(--text-muted); text-align: center; border-top: 1px solid var(--border-color); padding-top: 1rem;">
|
| 226 |
<p style="font-weight: 700; color: var(--accent-primary);">المملكة الأردنية الهاشمية — وزارة الداخلية</p>
|
| 227 |
-
<p style="margin-top: 0.25rem;">MAT (Modular Assistant Toolkit) — حقيبة الأدوات المساعدة — الإصدار 1.
|
| 228 |
</div>
|
| 229 |
</div>
|
| 230 |
</div>
|
| 231 |
|
| 232 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
const roleLabels = {
|
| 234 |
'admin': 'رئيس قسم',
|
| 235 |
'officer': 'ضابط شكاوي',
|
|
@@ -314,7 +333,7 @@
|
|
| 314 |
} else {
|
| 315 |
localStorage.removeItem('adminModeActive');
|
| 316 |
}
|
| 317 |
-
window.location.href = '/';
|
| 318 |
} else {
|
| 319 |
errorDiv.textContent = data.error || 'فشل تسجيل الدخول';
|
| 320 |
errorDiv.classList.add('show');
|
|
@@ -326,7 +345,7 @@
|
|
| 326 |
}
|
| 327 |
}
|
| 328 |
} catch (err) {
|
| 329 |
-
errorDiv.textContent = 'تعذر الاتصال بالخادم
|
| 330 |
errorDiv.classList.add('show');
|
| 331 |
if (activeAvatar) {
|
| 332 |
activeAvatar.style.opacity = '1';
|
|
|
|
| 224 |
|
| 225 |
<div style="margin-top: 2rem; font-size: 0.8rem; color: var(--text-muted); text-align: center; border-top: 1px solid var(--border-color); padding-top: 1rem;">
|
| 226 |
<p style="font-weight: 700; color: var(--accent-primary);">المملكة الأردنية الهاشمية — وزارة الداخلية</p>
|
| 227 |
+
<p style="margin-top: 0.25rem;">MAT (Modular Assistant Toolkit) — حقيبة الأدوات المساعدة — الإصدار 1.32.0</p>
|
| 228 |
</div>
|
| 229 |
</div>
|
| 230 |
</div>
|
| 231 |
|
| 232 |
<script>
|
| 233 |
+
const BACKEND_HOST = (typeof window !== 'undefined' && (window.location.hostname.includes('hf.space') || window.location.hostname.includes('github.io')))
|
| 234 |
+
? 'https://mat-ee756.containers.snapdeploy.app'
|
| 235 |
+
: '';
|
| 236 |
+
|
| 237 |
+
const originalFetch = window.fetch;
|
| 238 |
+
window.fetch = async function(resource, config = {}) {
|
| 239 |
+
let targetUrl = typeof resource === 'string' ? resource : (resource ? resource.url : '');
|
| 240 |
+
if (targetUrl.startsWith('/api/')) {
|
| 241 |
+
targetUrl = BACKEND_HOST + targetUrl;
|
| 242 |
+
if (typeof resource === 'string') {
|
| 243 |
+
resource = targetUrl;
|
| 244 |
+
}
|
| 245 |
+
}
|
| 246 |
+
if (BACKEND_HOST) {
|
| 247 |
+
config.credentials = 'include';
|
| 248 |
+
}
|
| 249 |
+
return originalFetch(resource, config);
|
| 250 |
+
};
|
| 251 |
+
|
| 252 |
const roleLabels = {
|
| 253 |
'admin': 'رئيس قسم',
|
| 254 |
'officer': 'ضابط شكاوي',
|
|
|
|
| 333 |
} else {
|
| 334 |
localStorage.removeItem('adminModeActive');
|
| 335 |
}
|
| 336 |
+
window.location.href = './app.html';
|
| 337 |
} else {
|
| 338 |
errorDiv.textContent = data.error || 'فشل تسجيل الدخول';
|
| 339 |
errorDiv.classList.add('show');
|
|
|
|
| 345 |
}
|
| 346 |
}
|
| 347 |
} catch (err) {
|
| 348 |
+
errorDiv.textContent = 'تعذر الاتصال بالخادم';
|
| 349 |
errorDiv.classList.add('show');
|
| 350 |
if (activeAvatar) {
|
| 351 |
activeAvatar.style.opacity = '1';
|