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 +1 -1
- complaints/login.html +49 -38
- 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.37.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.37.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.37.0</span>
|
| 40 |
</p>
|
| 41 |
</div>
|
| 42 |
<button class="sidebar-close-btn" onclick="closeSidebarDrawer()" title="ุฅุบูุงู ุงููุงุฆู
ุฉ" aria-label="ุฅุบูุงู ุงููุงุฆู
ุฉ">
|
complaints/js/app.js
CHANGED
|
@@ -13,7 +13,7 @@ let currentUser = null;
|
|
| 13 |
|
| 14 |
// โโ Smart API Backend Routing & CSRF Setup โโโโโโโโโโโโโโโโโโโโ
|
| 15 |
const BACKEND_HOST = (typeof window !== 'undefined' && (window.location.hostname.includes('hf.space') || window.location.hostname.includes('github.io')))
|
| 16 |
-
? 'https://
|
| 17 |
: '';
|
| 18 |
|
| 19 |
const originalFetch = window.fetch;
|
|
|
|
| 13 |
|
| 14 |
// โโ Smart API Backend Routing & CSRF Setup โโโโโโโโโโโโโโโโโโโโ
|
| 15 |
const BACKEND_HOST = (typeof window !== 'undefined' && (window.location.hostname.includes('hf.space') || window.location.hostname.includes('github.io')))
|
| 16 |
+
? 'https://abualzait-mat.hf.space'
|
| 17 |
: '';
|
| 18 |
|
| 19 |
const originalFetch = window.fetch;
|
complaints/login.html
CHANGED
|
@@ -259,21 +259,26 @@
|
|
| 259 |
|
| 260 |
<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;">
|
| 261 |
<p style="font-weight: 700; color: var(--accent-primary);">ุงูู
ู
ููุฉ ุงูุฃุฑุฏููุฉ ุงููุงุดู
ูุฉ โ ูุฒุงุฑุฉ ุงูุฏุงุฎููุฉ</p>
|
| 262 |
-
<p style="margin-top: 0.25rem;">MAT (Modular Assistant Toolkit) โ ุญููุจุฉ ุงูุฃุฏูุงุช ุงูู
ุณุงุนุฏุฉ โ ุงูุฅุตุฏุงุฑ 1.
|
| 263 |
</div>
|
| 264 |
</div>
|
| 265 |
</div>
|
| 266 |
|
| 267 |
<script>
|
| 268 |
-
const
|
| 269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 270 |
: '';
|
| 271 |
|
| 272 |
const originalFetch = window.fetch;
|
| 273 |
window.fetch = async function(resource, config = {}) {
|
| 274 |
let targetUrl = typeof resource === 'string' ? resource : (resource ? resource.url : '');
|
| 275 |
if (targetUrl.startsWith('/api/')) {
|
| 276 |
-
targetUrl = BACKEND_HOST + targetUrl;
|
| 277 |
if (typeof resource === 'string') {
|
| 278 |
resource = targetUrl;
|
| 279 |
}
|
|
@@ -300,41 +305,47 @@
|
|
| 300 |
const statusIcon = document.getElementById('serverStatusIcon');
|
| 301 |
const avatarBtns = document.querySelectorAll('.avatar-btn');
|
| 302 |
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 333 |
}
|
|
|
|
| 334 |
}
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
} catch (e) {}
|
| 338 |
|
| 339 |
isBackendOnline = false;
|
| 340 |
if (!wakeUpStartTime) wakeUpStartTime = Date.now();
|
|
@@ -342,7 +353,7 @@
|
|
| 342 |
|
| 343 |
badge.className = 'server-status-badge warming';
|
| 344 |
statusIcon.textContent = 'โณ';
|
| 345 |
-
statusText.textContent = `ุงูุฎุงุฏู
ุงูุณุญุงุจู ูู ู
ุฑุญูุฉ ุงูุฅุญู
ุงุก (SnapDeploy)... ูุฑุฌู ุงูุงูุชุธุงุฑ (${elapsedSec} ุซุงููุฉ)`;
|
| 346 |
|
| 347 |
avatarBtns.forEach(btn => {
|
| 348 |
btn.style.opacity = '0.5';
|
|
|
|
| 259 |
|
| 260 |
<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;">
|
| 261 |
<p style="font-weight: 700; color: var(--accent-primary);">ุงูู
ู
ููุฉ ุงูุฃุฑุฏููุฉ ุงููุงุดู
ูุฉ โ ูุฒุงุฑุฉ ุงูุฏุงุฎููุฉ</p>
|
| 262 |
+
<p style="margin-top: 0.25rem;">MAT (Modular Assistant Toolkit) โ ุญููุจุฉ ุงูุฃุฏูุงุช ุงูู
ุณุงุนุฏุฉ โ ุงูุฅุตุฏุงุฑ 1.37.0</p>
|
| 263 |
</div>
|
| 264 |
</div>
|
| 265 |
</div>
|
| 266 |
|
| 267 |
<script>
|
| 268 |
+
const BACKEND_CANDIDATES = [
|
| 269 |
+
'https://abualzait-mat.hf.space',
|
| 270 |
+
'https://mat-ee756.containers.snapdeploy.app'
|
| 271 |
+
];
|
| 272 |
+
|
| 273 |
+
let BACKEND_HOST = (typeof window !== 'undefined' && (window.location.hostname.includes('hf.space') || window.location.hostname.includes('github.io')))
|
| 274 |
+
? 'https://abualzait-mat.hf.space'
|
| 275 |
: '';
|
| 276 |
|
| 277 |
const originalFetch = window.fetch;
|
| 278 |
window.fetch = async function(resource, config = {}) {
|
| 279 |
let targetUrl = typeof resource === 'string' ? resource : (resource ? resource.url : '');
|
| 280 |
if (targetUrl.startsWith('/api/')) {
|
| 281 |
+
targetUrl = (BACKEND_HOST || '') + targetUrl;
|
| 282 |
if (typeof resource === 'string') {
|
| 283 |
resource = targetUrl;
|
| 284 |
}
|
|
|
|
| 305 |
const statusIcon = document.getElementById('serverStatusIcon');
|
| 306 |
const avatarBtns = document.querySelectorAll('.avatar-btn');
|
| 307 |
|
| 308 |
+
const testList = [BACKEND_HOST, ...BACKEND_CANDIDATES.filter(h => h !== BACKEND_HOST)];
|
| 309 |
+
|
| 310 |
+
for (const hostCandidate of testList) {
|
| 311 |
+
try {
|
| 312 |
+
const testUrl = (hostCandidate ? hostCandidate : '') + '/api/v1/mat/active-users';
|
| 313 |
+
const res = await originalFetch(testUrl, { cache: 'no-cache' });
|
| 314 |
+
if (res.ok) {
|
| 315 |
+
BACKEND_HOST = hostCandidate;
|
| 316 |
+
isBackendOnline = true;
|
| 317 |
+
if (pingInterval) clearInterval(pingInterval);
|
| 318 |
+
|
| 319 |
+
badge.className = 'server-status-badge online';
|
| 320 |
+
statusIcon.textContent = '๐ข';
|
| 321 |
+
statusText.textContent = 'ุงูุฎุงุฏู
ุงูุณุญุงุจู ู
ุชุตู ููุนู
ู ุจูุฌุงุญ! ูู
ููู ุงูุฏุฎูู ุงูุขู';
|
| 322 |
+
|
| 323 |
+
avatarBtns.forEach(btn => {
|
| 324 |
+
btn.style.opacity = '1';
|
| 325 |
+
btn.style.pointerEvents = 'auto';
|
| 326 |
+
});
|
| 327 |
+
|
| 328 |
+
const data = await res.json();
|
| 329 |
+
if (data && data.users && data.users.length > 0) {
|
| 330 |
+
const grid = document.getElementById('avatarGrid');
|
| 331 |
+
if (grid) {
|
| 332 |
+
grid.innerHTML = data.users.map(user => {
|
| 333 |
+
const initialChar = user.name ? user.name.charAt(0) : user.username.charAt(0);
|
| 334 |
+
const roleTitle = roleLabels[user.role] || 'ุถุงุจุท';
|
| 335 |
+
return `
|
| 336 |
+
<button type="button" class="avatar-btn" onclick="selectUser('${user.username}', this)">
|
| 337 |
+
<div class="avatar-circle">${initialChar}</div>
|
| 338 |
+
<span class="avatar-name">${user.name}</span>
|
| 339 |
+
<span class="avatar-role">${roleTitle}</span>
|
| 340 |
+
</button>
|
| 341 |
+
`;
|
| 342 |
+
}).join('');
|
| 343 |
+
}
|
| 344 |
}
|
| 345 |
+
return true;
|
| 346 |
}
|
| 347 |
+
} catch (e) {}
|
| 348 |
+
}
|
|
|
|
| 349 |
|
| 350 |
isBackendOnline = false;
|
| 351 |
if (!wakeUpStartTime) wakeUpStartTime = Date.now();
|
|
|
|
| 353 |
|
| 354 |
badge.className = 'server-status-badge warming';
|
| 355 |
statusIcon.textContent = 'โณ';
|
| 356 |
+
statusText.textContent = `ุงูุฎุงุฏู
ุงูุณุญุงุจู ูู ู
ุฑุญูุฉ ุงูุฅุญู
ุงุก (SnapDeploy/HuggingFace)... ูุฑุฌู ุงูุงูุชุธุงุฑ (${elapsedSec} ุซุงููุฉ)`;
|
| 357 |
|
| 358 |
avatarBtns.forEach(btn => {
|
| 359 |
btn.style.opacity = '0.5';
|
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.37.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.37.0) โ
|
| 6 |
โ โ
|
| 7 |
โ ูุนู
ู ุจุฏูู ุฅูุชุฑูุช ุนูู ุงูุดุจูุฉ ุงูู
ุญููุฉ โ
|
| 8 |
โ ูุง ูุญุชุงุฌ ุชุซุจูุช ุฃู ู
ูุชุจุงุช ุฅุถุงููุฉ โ
|