abualzait commited on
Commit
2f804f5
ยท
verified ยท
1 Parent(s): ef2c3c7

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.28.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.29.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.28.0
17
  > **Official Short URL:** [https://abualzait.github.io/MAT](https://abualzait.github.io/MAT)
18
  > **Direct Live Deployment:** [https://mat-ee756.containers.snapdeploy.app](https://mat-ee756.containers.snapdeploy.app)
19
  > **Cloud Secret Key:** `mat_secret_key_2026_prod`
 
13
 
14
  > **Official Arabic Name:** "ุญู‚ูŠุจุฉ ุงู„ุฃุฏูˆุงุช ุงู„ู…ุณุงุนุฏุฉ"
15
  > **Full Acronym Definition:** Modular Assistant Toolkit
16
+ > **Project Version:** 1.29.0
17
  > **Official Short URL:** [https://abualzait.github.io/MAT](https://abualzait.github.io/MAT)
18
  > **Direct Live Deployment:** [https://mat-ee756.containers.snapdeploy.app](https://mat-ee756.containers.snapdeploy.app)
19
  > **Cloud Secret Key:** `mat_secret_key_2026_prod`
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.28.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.29.0</span>
40
  </p>
41
  </div>
42
  <button class="sidebar-close-btn" onclick="closeSidebarDrawer()" title="ุฅุบู„ุงู‚ ุงู„ู‚ุงุฆู…ุฉ" aria-label="ุฅุบู„ุงู‚ ุงู„ู‚ุงุฆู…ุฉ">
complaints/js/app.js CHANGED
@@ -3,7 +3,7 @@ const matConfig = {
3
  name: 'MAT',
4
  arabicName: 'ุญู‚ูŠุจุฉ ุงู„ุฃุฏูˆุงุช ุงู„ู…ุณุงุนุฏุฉ',
5
  fullName: 'Modular Assistant Toolkit',
6
- apiPrefix: '/api/v1/mat/v1/mat'
7
  };
8
  /**
9
  * ู†ุธุงู… ุฏู„ูŠู„ ุงู„ู…ุฑุงูƒุฒ ุงู„ุฃู…ู†ูŠุฉ ูˆุฌุฏูˆู„ุฉ ุงู„ู…ูˆุงุนูŠุฏ โ€” JS
@@ -11,9 +11,20 @@ const matConfig = {
11
 
12
  let currentUser = null;
13
 
14
- // โ”€โ”€ CSRF Setup โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 
 
 
 
15
  const originalFetch = window.fetch;
16
  window.fetch = async function(resource, config = {}) {
 
 
 
 
 
 
 
17
  const csrfMatch = document.cookie.match(/(?:^|;\s*)csrf_token=([^;]*)/);
18
  if (csrfMatch && csrfMatch[1]) {
19
  config.headers = {
@@ -21,6 +32,9 @@ window.fetch = async function(resource, config = {}) {
21
  'X-CSRF-Token': csrfMatch[1]
22
  };
23
  }
 
 
 
24
  return originalFetch(resource, config);
25
  };
26
 
 
3
  name: 'MAT',
4
  arabicName: 'ุญู‚ูŠุจุฉ ุงู„ุฃุฏูˆุงุช ุงู„ู…ุณุงุนุฏุฉ',
5
  fullName: 'Modular Assistant Toolkit',
6
+ apiPrefix: '/api/v1/mat'
7
  };
8
  /**
9
  * ู†ุธุงู… ุฏู„ูŠู„ ุงู„ู…ุฑุงูƒุฒ ุงู„ุฃู…ู†ูŠุฉ ูˆุฌุฏูˆู„ุฉ ุงู„ู…ูˆุงุนูŠุฏ โ€” JS
 
11
 
12
  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;
20
  window.fetch = async function(resource, config = {}) {
21
+ let targetUrl = typeof resource === 'string' ? resource : (resource ? resource.url : '');
22
+ if (targetUrl.startsWith('/api/')) {
23
+ targetUrl = BACKEND_HOST + targetUrl;
24
+ if (typeof resource === 'string') {
25
+ resource = targetUrl;
26
+ }
27
+ }
28
  const csrfMatch = document.cookie.match(/(?:^|;\s*)csrf_token=([^;]*)/);
29
  if (csrfMatch && csrfMatch[1]) {
30
  config.headers = {
 
32
  'X-CSRF-Token': csrfMatch[1]
33
  };
34
  }
35
+ if (BACKEND_HOST) {
36
+ config.credentials = 'include';
37
+ }
38
  return originalFetch(resource, config);
39
  };
40
 
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.28.0</p>
228
  </div>
229
  </div>
230
  </div>
 
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.29.0</p>
228
  </div>
229
  </div>
230
  </div>
server.py CHANGED
@@ -2,7 +2,7 @@
2
  # -*- coding: utf-8 -*-
3
  """
4
  โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
5
- โ•‘ MAT (Modular Assistant Toolkit) โ€” ุญู‚ูŠุจุฉ ุงู„ุฃุฏูˆุงุช ุงู„ู…ุณุงุนุฏุฉ (1.28.0) โ•‘
6
  โ•‘ โ•‘
7
  โ•‘ ูŠุนู…ู„ ุจุฏูˆู† ุฅู†ุชุฑู†ุช ุนู„ู‰ ุงู„ุดุจูƒุฉ ุงู„ู…ุญู„ูŠุฉ โ•‘
8
  โ•‘ ู„ุง ูŠุญุชุงุฌ ุชุซุจูŠุช ุฃูŠ ู…ูƒุชุจุงุช ุฅุถุงููŠุฉ โ•‘
 
2
  # -*- coding: utf-8 -*-
3
  """
4
  โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
5
+ โ•‘ MAT (Modular Assistant Toolkit) โ€” ุญู‚ูŠุจุฉ ุงู„ุฃุฏูˆุงุช ุงู„ู…ุณุงุนุฏุฉ (1.29.0) โ•‘
6
  โ•‘ โ•‘
7
  โ•‘ ูŠุนู…ู„ ุจุฏูˆู† ุฅู†ุชุฑู†ุช ุนู„ู‰ ุงู„ุดุจูƒุฉ ุงู„ู…ุญู„ูŠุฉ โ•‘
8
  โ•‘ ู„ุง ูŠุญุชุงุฌ ุชุซุจูŠุช ุฃูŠ ู…ูƒุชุจุงุช ุฅุถุงููŠุฉ โ•‘