Upload folder using huggingface_hub
Browse files- Police_Station_Finder.html +1 -1
- README.md +1 -1
- complaints/app.html +1 -1
- complaints/js/app.js +6 -1
- complaints/login.html +21 -4
- index.html +1 -1
- server.py +1 -1
Police_Station_Finder.html
CHANGED
|
@@ -844,7 +844,7 @@
|
|
| 844 |
<span>MAT</span>
|
| 845 |
<span style="font-size: 0.8rem; font-weight: 600; color: var(--secondary); background: rgba(0,109,57,0.1); padding: 2px 8px; border-radius: 6px;">ุฏููู ุงูู
ุฑุงูุฒ ุงูุฃู
ููุฉ</span>
|
| 846 |
</h1>
|
| 847 |
-
<p>ุญููุจุฉ ุงูุฃุฏูุงุช ุงูู
ุณุงุนุฏุฉ โ ุชุญุฏูุฏ ุงูู
ูุงูุน ุฌุบุฑุงููุงู <span class="version-tag">ุงูุฅุตุฏุงุฑ 1.
|
| 848 |
</div>
|
| 849 |
</div>
|
| 850 |
<div class="header-actions">
|
|
|
|
| 844 |
<span>MAT</span>
|
| 845 |
<span style="font-size: 0.8rem; font-weight: 600; color: var(--secondary); background: rgba(0,109,57,0.1); padding: 2px 8px; border-radius: 6px;">ุฏููู ุงูู
ุฑุงูุฒ ุงูุฃู
ููุฉ</span>
|
| 846 |
</h1>
|
| 847 |
+
<p>ุญููุจุฉ ุงูุฃุฏูุงุช ุงูู
ุณุงุนุฏุฉ โ ุชุญุฏูุฏ ุงูู
ูุงูุน ุฌุบุฑุงููุงู <span class="version-tag">ุงูุฅุตุฏุงุฑ 1.35.0</span></p>
|
| 848 |
</div>
|
| 849 |
</div>
|
| 850 |
<div class="header-actions">
|
README.md
CHANGED
|
@@ -13,7 +13,7 @@ license: mit
|
|
| 13 |
|
| 14 |
> **Official Arabic Name:** "ุญููุจุฉ ุงูุฃุฏูุงุช ุงูู
ุณุงุนุฏุฉ"
|
| 15 |
> **Full Acronym Definition:** Modular Assistant Toolkit
|
| 16 |
-
> **Project Version:** 1.
|
| 17 |
> **Official Short URL:** [https://abualzait.github.io/MAT](https://abualzait.github.io/MAT)
|
| 18 |
> **Hugging Face Live Space:** [https://abualzait-mat.hf.space](https://abualzait-mat.hf.space)
|
| 19 |
> **Direct Live Deployment:** [https://mat-ee756.containers.snapdeploy.app](https://mat-ee756.containers.snapdeploy.app)
|
|
|
|
| 13 |
|
| 14 |
> **Official Arabic Name:** "ุญููุจุฉ ุงูุฃุฏูุงุช ุงูู
ุณุงุนุฏุฉ"
|
| 15 |
> **Full Acronym Definition:** Modular Assistant Toolkit
|
| 16 |
+
> **Project Version:** 1.35.0
|
| 17 |
> **Official Short URL:** [https://abualzait.github.io/MAT](https://abualzait.github.io/MAT)
|
| 18 |
> **Hugging Face Live Space:** [https://abualzait-mat.hf.space](https://abualzait-mat.hf.space)
|
| 19 |
> **Direct Live Deployment:** [https://mat-ee756.containers.snapdeploy.app](https://mat-ee756.containers.snapdeploy.app)
|
complaints/app.html
CHANGED
|
@@ -36,7 +36,7 @@
|
|
| 36 |
<h1 class="header-main-title">ุญููุจุฉ ุงูุฃุฏูุงุช ุงูู
ุณุงุนุฏุฉ</h1>
|
| 37 |
<p class="header-jurisdiction">
|
| 38 |
<span>ู
ุญุงูุธุฉ ุงูุนุงุตู
ุฉ</span>
|
| 39 |
-
<span class="badge badge-purple" style="font-size:0.62rem; padding:1px 5px; border-radius:4px;">v1.
|
| 40 |
</p>
|
| 41 |
</div>
|
| 42 |
<button class="sidebar-close-btn" onclick="closeSidebarDrawer()" title="ุฅุบูุงู ุงููุงุฆู
ุฉ" aria-label="ุฅุบูุงู ุงููุงุฆู
ุฉ">
|
|
|
|
| 36 |
<h1 class="header-main-title">ุญููุจุฉ ุงูุฃุฏูุงุช ุงูู
ุณุงุนุฏุฉ</h1>
|
| 37 |
<p class="header-jurisdiction">
|
| 38 |
<span>ู
ุญุงูุธุฉ ุงูุนุงุตู
ุฉ</span>
|
| 39 |
+
<span class="badge badge-purple" style="font-size:0.62rem; padding:1px 5px; border-radius:4px;">v1.35.0</span>
|
| 40 |
</p>
|
| 41 |
</div>
|
| 42 |
<button class="sidebar-close-btn" onclick="closeSidebarDrawer()" title="ุฅุบูุงู ุงููุงุฆู
ุฉ" aria-label="ุฅุบูุงู ุงููุงุฆู
ุฉ">
|
complaints/js/app.js
CHANGED
|
@@ -59,10 +59,15 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|
| 59 |
// Default tab: Dashboard for all users
|
| 60 |
switchTab('dashboard');
|
| 61 |
|
| 62 |
-
// Start notifications & online users polling
|
| 63 |
startNotificationsPolling();
|
| 64 |
loadOnlineUsers();
|
| 65 |
setInterval(loadOnlineUsers, 10000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
// Setup Sidebar Hover Expansion for Collapsed State
|
| 68 |
const sidebarEl = document.getElementById('mainSidebar');
|
|
|
|
| 59 |
// Default tab: Dashboard for all users
|
| 60 |
switchTab('dashboard');
|
| 61 |
|
| 62 |
+
// Start notifications & online users polling & keep-alive ping
|
| 63 |
startNotificationsPolling();
|
| 64 |
loadOnlineUsers();
|
| 65 |
setInterval(loadOnlineUsers, 10000);
|
| 66 |
+
setInterval(() => {
|
| 67 |
+
if (BACKEND_HOST) {
|
| 68 |
+
fetch('/api/v1/mat/active-users').catch(() => {});
|
| 69 |
+
}
|
| 70 |
+
}, 45000);
|
| 71 |
|
| 72 |
// Setup Sidebar Hover Expansion for Collapsed State
|
| 73 |
const sidebarEl = document.getElementById('mainSidebar');
|
complaints/login.html
CHANGED
|
@@ -224,7 +224,7 @@
|
|
| 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>
|
|
@@ -292,7 +292,19 @@
|
|
| 292 |
}
|
| 293 |
}
|
| 294 |
|
| 295 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 296 |
|
| 297 |
function selectUser(username, btnEl) {
|
| 298 |
document.querySelectorAll('.avatar-btn').forEach(b => b.classList.remove('selected'));
|
|
@@ -303,7 +315,7 @@
|
|
| 303 |
handleLogin(new Event('submit'));
|
| 304 |
}
|
| 305 |
|
| 306 |
-
async function handleLogin(e) {
|
| 307 |
if (e) e.preventDefault();
|
| 308 |
const errorDiv = document.getElementById('loginError');
|
| 309 |
const username = document.getElementById('selectedUsername').value;
|
|
@@ -353,12 +365,17 @@
|
|
| 353 |
}
|
| 354 |
return;
|
| 355 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 356 |
}
|
| 357 |
} catch (err) {
|
| 358 |
console.warn('Backend API connection offline/unavailable, activating local session fallback:', err);
|
| 359 |
}
|
| 360 |
|
| 361 |
-
// Fallback for standalone/offline or when backend is down
|
| 362 |
if (!loggedInUser && (defaultUsersMap[username] || username)) {
|
| 363 |
loggedInUser = defaultUsersMap[username] || { username, name: username, role: 'officer' };
|
| 364 |
if (secret_code === '123' || secret_code === '12345' || secret_code === 'admin' || secret_code === 'mat') {
|
|
|
|
| 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.35.0</p>
|
| 228 |
</div>
|
| 229 |
</div>
|
| 230 |
</div>
|
|
|
|
| 292 |
}
|
| 293 |
}
|
| 294 |
|
| 295 |
+
async function wakeUpBackend() {
|
| 296 |
+
if (!BACKEND_HOST) return;
|
| 297 |
+
try {
|
| 298 |
+
await fetch('/api/v1/mat/active-users', { cache: 'no-cache' });
|
| 299 |
+
} catch (e) {
|
| 300 |
+
console.warn('Background wake-up ping sent to SnapDeploy container.');
|
| 301 |
+
}
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 305 |
+
loadActiveUsers();
|
| 306 |
+
wakeUpBackend();
|
| 307 |
+
});
|
| 308 |
|
| 309 |
function selectUser(username, btnEl) {
|
| 310 |
document.querySelectorAll('.avatar-btn').forEach(b => b.classList.remove('selected'));
|
|
|
|
| 315 |
handleLogin(new Event('submit'));
|
| 316 |
}
|
| 317 |
|
| 318 |
+
async function handleLogin(e, retryCount = 0) {
|
| 319 |
if (e) e.preventDefault();
|
| 320 |
const errorDiv = document.getElementById('loginError');
|
| 321 |
const username = document.getElementById('selectedUsername').value;
|
|
|
|
| 365 |
}
|
| 366 |
return;
|
| 367 |
}
|
| 368 |
+
} else if ((res.status === 503 || res.status === 502 || res.status === 504) && retryCount < 2) {
|
| 369 |
+
errorDiv.innerHTML = 'โณ ุงูุฎุงุฏู
ุงูุณุญุงุจู ูู ู
ุฑุญูุฉ ุงูุฅุญู
ุงุก (SnapDeploy)... ูุฑุฌู ุงูุงูุชุธุงุฑ ุซูุงูู';
|
| 370 |
+
errorDiv.classList.add('show');
|
| 371 |
+
await new Promise(r => setTimeout(r, 2500));
|
| 372 |
+
return handleLogin(null, retryCount + 1);
|
| 373 |
}
|
| 374 |
} catch (err) {
|
| 375 |
console.warn('Backend API connection offline/unavailable, activating local session fallback:', err);
|
| 376 |
}
|
| 377 |
|
| 378 |
+
// Fallback for standalone/offline or when backend is down/sleeping
|
| 379 |
if (!loggedInUser && (defaultUsersMap[username] || username)) {
|
| 380 |
loggedInUser = defaultUsersMap[username] || { username, name: username, role: 'officer' };
|
| 381 |
if (secret_code === '123' || secret_code === '12345' || secret_code === 'admin' || secret_code === 'mat') {
|
index.html
CHANGED
|
@@ -95,7 +95,7 @@
|
|
| 95 |
<div class="card">
|
| 96 |
<img src="./amman_logo.png" alt="ุดุนุงุฑ ุงูู
ุญุงูุธุฉ" class="logo-img">
|
| 97 |
<h1>ุญููุจุฉ ุงูุฃุฏูุงุช ุงูู
ุณุงุนุฏุฉ (MAT)</h1>
|
| 98 |
-
<p class="subtitle">ุงูู
ู
ููุฉ ุงูุฃุฑุฏููุฉ ุงููุงุดู
ูุฉ โ ูุฒุงุฑุฉ ุงูุฏุงุฎููุฉ โ ู
ุญุงูุธุฉ ุงูุนุงุตู
ุฉ (ุงูุฅุตุฏุงุฑ 1.
|
| 99 |
|
| 100 |
<div class="btn-group">
|
| 101 |
<a href="./complaints/login.html" class="btn-portal btn-primary">
|
|
|
|
| 95 |
<div class="card">
|
| 96 |
<img src="./amman_logo.png" alt="ุดุนุงุฑ ุงูู
ุญุงูุธุฉ" class="logo-img">
|
| 97 |
<h1>ุญููุจุฉ ุงูุฃุฏูุงุช ุงูู
ุณุงุนุฏุฉ (MAT)</h1>
|
| 98 |
+
<p class="subtitle">ุงูู
ู
ููุฉ ุงูุฃุฑุฏููุฉ ุงููุงุดู
ูุฉ โ ูุฒุงุฑุฉ ุงูุฏุงุฎููุฉ โ ู
ุญุงูุธุฉ ุงูุนุงุตู
ุฉ (ุงูุฅุตุฏุงุฑ 1.35.0)</p>
|
| 99 |
|
| 100 |
<div class="btn-group">
|
| 101 |
<a href="./complaints/login.html" class="btn-portal btn-primary">
|
server.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
# -*- coding: utf-8 -*-
|
| 3 |
"""
|
| 4 |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 5 |
-
โ MAT (Modular Assistant Toolkit) โ ุญููุจุฉ ุงูุฃุฏูุงุช ุงูู
ุณุงุนุฏุฉ (1.
|
| 6 |
โ โ
|
| 7 |
โ ูุนู
ู ุจุฏูู ุฅูุชุฑูุช ุนูู ุงูุดุจูุฉ ุงูู
ุญููุฉ โ
|
| 8 |
โ ูุง ูุญุชุงุฌ ุชุซุจูุช ุฃู ู
ูุชุจุงุช ุฅุถุงููุฉ โ
|
|
|
|
| 2 |
# -*- coding: utf-8 -*-
|
| 3 |
"""
|
| 4 |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 5 |
+
โ MAT (Modular Assistant Toolkit) โ ุญููุจุฉ ุงูุฃุฏูุงุช ุงูู
ุณุงุนุฏุฉ (1.35.0) โ
|
| 6 |
โ โ
|
| 7 |
โ ูุนู
ู ุจุฏูู ุฅูุชุฑูุช ุนูู ุงูุดุจูุฉ ุงูู
ุญููุฉ โ
|
| 8 |
โ ูุง ูุญุชุงุฌ ุชุซุจูุช ุฃู ู
ูุชุจุงุช ุฅุถุงููุฉ โ
|