abualzait commited on
Commit
fbf6485
ยท
verified ยท
1 Parent(s): d88e975

Upload folder using huggingface_hub

Browse files
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.36.0</span></p>
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.36.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)
 
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.36.0</span>
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://mat-ee756.containers.snapdeploy.app'
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.36.0</p>
263
  </div>
264
  </div>
265
  </div>
266
 
267
  <script>
268
- const BACKEND_HOST = (typeof window !== 'undefined' && (window.location.hostname.includes('hf.space') || window.location.hostname.includes('github.io')))
269
- ? 'https://mat-ee756.containers.snapdeploy.app'
 
 
 
 
 
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
- try {
304
- const res = await fetch('/api/v1/mat/active-users', { cache: 'no-cache' });
305
- if (res.ok) {
306
- isBackendOnline = true;
307
- if (pingInterval) clearInterval(pingInterval);
308
-
309
- badge.className = 'server-status-badge online';
310
- statusIcon.textContent = '๐ŸŸข';
311
- statusText.textContent = 'ุงู„ุฎุงุฏู… ุงู„ุณุญุงุจูŠ ู…ุชุตู„ ูˆูŠุนู…ู„ ุจู†ุฌุงุญ! ูŠู…ูƒู†ูƒ ุงู„ุฏุฎูˆู„ ุงู„ุขู†';
312
-
313
- avatarBtns.forEach(btn => {
314
- btn.style.opacity = '1';
315
- btn.style.pointerEvents = 'auto';
316
- });
317
-
318
- const data = await res.json();
319
- if (data && data.users && data.users.length > 0) {
320
- const grid = document.getElementById('avatarGrid');
321
- if (grid) {
322
- grid.innerHTML = data.users.map(user => {
323
- const initialChar = user.name ? user.name.charAt(0) : user.username.charAt(0);
324
- const roleTitle = roleLabels[user.role] || 'ุถุงุจุท';
325
- return `
326
- <button type="button" class="avatar-btn" onclick="selectUser('${user.username}', this)">
327
- <div class="avatar-circle">${initialChar}</div>
328
- <span class="avatar-name">${user.name}</span>
329
- <span class="avatar-role">${roleTitle}</span>
330
- </button>
331
- `;
332
- }).join('');
 
 
 
 
 
 
333
  }
 
334
  }
335
- return true;
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.36.0)</p>
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.36.0) โ•‘
6
  โ•‘ โ•‘
7
  โ•‘ ูŠุนู…ู„ ุจุฏูˆู† ุฅู†ุชุฑู†ุช ุนู„ู‰ ุงู„ุดุจูƒุฉ ุงู„ู…ุญู„ูŠุฉ โ•‘
8
  โ•‘ ู„ุง ูŠุญุชุงุฌ ุชุซุจูŠุช ุฃูŠ ู…ูƒุชุจุงุช ุฅุถุงููŠุฉ โ•‘
 
2
  # -*- coding: utf-8 -*-
3
  """
4
  โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
5
+ โ•‘ MAT (Modular Assistant Toolkit) โ€” ุญู‚ูŠุจุฉ ุงู„ุฃุฏูˆุงุช ุงู„ู…ุณุงุนุฏุฉ (1.37.0) โ•‘
6
  โ•‘ โ•‘
7
  โ•‘ ูŠุนู…ู„ ุจุฏูˆู† ุฅู†ุชุฑู†ุช ุนู„ู‰ ุงู„ุดุจูƒุฉ ุงู„ู…ุญู„ูŠุฉ โ•‘
8
  โ•‘ ู„ุง ูŠุญุชุงุฌ ุชุซุจูŠุช ุฃูŠ ู…ูƒุชุจุงุช ุฅุถุงููŠุฉ โ•‘