sldshr commited on
Commit
ea223a7
·
verified ·
1 Parent(s): 7ae578d

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +15 -214
index.html CHANGED
@@ -93,27 +93,6 @@
93
  margin-bottom: 20px;
94
  font-size: 13px;
95
  color: #444;
96
- display: flex;
97
- justify-content: space-between;
98
- align-items: center;
99
- gap: 10px;
100
- }
101
- .refresh-btn {
102
- background: linear-gradient(to bottom, #f0f0f0 0%, #d8d8d8 100%);
103
- border: 1px solid #a0a0a0;
104
- border-radius: 3px;
105
- padding: 5px 12px;
106
- font-size: 11px;
107
- font-weight: bold;
108
- color: #333;
109
- cursor: pointer;
110
- font-family: Verdana, Arial, sans-serif;
111
- }
112
- .refresh-btn:hover {
113
- background: linear-gradient(to bottom, #ffffff 0%, #e0e0e0 100%);
114
- }
115
- .refresh-btn:active {
116
- background: linear-gradient(to bottom, #c8c8c8 0%, #e0e0e0 100%);
117
  }
118
  table {
119
  width: 100%;
@@ -150,61 +129,6 @@
150
  font-weight: bold;
151
  margin-left: 8px;
152
  }
153
- .status {
154
- display: inline-block;
155
- border-radius: 3px;
156
- padding: 2px 7px;
157
- font-size: 11px;
158
- font-weight: bold;
159
- margin-left: 5px;
160
- transition: background-color 0.3s, color 0.3s;
161
- cursor: help;
162
- }
163
- .status.online {
164
- background-color: #e8f5e9;
165
- color: #2e7d32;
166
- border: 1px solid #a5d6a7;
167
- }
168
- .status.online::before {
169
- content: "● ";
170
- color: #4caf50;
171
- }
172
- .status.offline {
173
- background-color: #fdecea;
174
- color: #c62828;
175
- border: 1px solid #ef9a9a;
176
- }
177
- .status.offline::before {
178
- content: "● ";
179
- color: #e53935;
180
- }
181
- .status.checking {
182
- background-color: #fff8e1;
183
- color: #f57f17;
184
- border: 1px solid #ffe082;
185
- }
186
- .status.checking::before {
187
- content: "◌ ";
188
- color: #fbc02d;
189
- }
190
- .status.host-error {
191
- background-color: #fdecea;
192
- color: #c62828;
193
- border: 1px solid #ef9a9a;
194
- }
195
- .status.host-error::before {
196
- content: "● ";
197
- color: #e53935;
198
- }
199
- .status.cf-error {
200
- background-color: #fff8e1;
201
- color: #f57f17;
202
- border: 1px solid #ffe082;
203
- }
204
- .status.cf-error::before {
205
- content: "● ";
206
- color: #fbc02d;
207
- }
208
  .url {
209
  display: block;
210
  color: #888;
@@ -441,8 +365,7 @@
441
 
442
  <div class="content">
443
  <div class="intro">
444
- <span data-i18n="intro">Каждому серверу выделено <b>512 MB RAM</b>. Статус обновляется автоматически.</span>
445
- <button class="refresh-btn" onclick="checkAll()" data-i18n="refresh">Проверить</button>
446
  </div>
447
 
448
  <table>
@@ -450,7 +373,6 @@
450
  <td>
451
  <a href="https://sldchat.fastapicloud.dev/" target="_blank">SLD Chat — FastAPI Cloud</a>
452
  <span class="ram" data-i18n="ram512">512 MB RAM</span>
453
- <span class="status checking" data-url="https://sldchat.fastapicloud.dev/" id="s1">Checking</span>
454
  <span class="url">https://sldchat.fastapicloud.dev/</span>
455
  </td>
456
  </tr>
@@ -458,7 +380,6 @@
458
  <td>
459
  <a href="https://sldchat.onrunxbuild.com/" target="_blank">SLD Chat — OnRunX Build</a>
460
  <span class="ram" data-i18n="ram512">512 MB RAM</span>
461
- <span class="status checking" data-url="https://sldchat.onrunxbuild.com/" id="s2">Checking</span>
462
  <span class="url">https://sldchat.onrunxbuild.com/</span>
463
  </td>
464
  </tr>
@@ -466,7 +387,6 @@
466
  <td>
467
  <a href="https://sldshrs-backery.fastapicloud.dev/" target="_blank">SLD Shrs Backery — FastAPI Cloud</a>
468
  <span class="ram" data-i18n="ram512">512 MB RAM</span>
469
- <span class="status checking" data-url="https://sldshrs-backery.fastapicloud.dev/" id="s3">Checking</span>
470
  <span class="url">https://sldshrs-backery.fastapicloud.dev/</span>
471
  </td>
472
  </tr>
@@ -474,7 +394,6 @@
474
  <td>
475
  <a href="https://e1l0e97mjeyu.ramnaymcloud.com/" target="_blank">SLD Chat — Ramnaym Cloud</a>
476
  <span class="ram" data-i18n="ram100">100 MB RAM</span>
477
- <span class="status checking" data-url="https://e1l0e97mjeyu.ramnaymcloud.com/" id="s4">Checking</span>
478
  <span class="url">https://e1l0e97mjeyu.ramnaymcloud.com/</span>
479
  </td>
480
  </tr>
@@ -503,12 +422,12 @@
503
  <div class="modal-body" id="guideBody">
504
 
505
  <h2 data-i18n="guideH0">Шаг 0. Скачайте файлы сервера</h2>
506
- <p data-i18n="guideP0">Скачайте готовые файлы сервера из репозитория и положите их в отдельную папку:</p>
507
  <div class="download-box">
508
- <a href="https://huggingface.co/spaces/sldshr/SDM/raw/main/main.py" download data-i18n="downloadMain">⬇ Скачать main.py</a>
509
- <a href="https://huggingface.co/spaces/sldshr/SDM/raw/main/requirements.txt" download data-i18n="downloadReq">⬇ Скачать requirements.txt</a>
510
  </div>
511
- <p data-i18n="guideP0b">После скачивания у вас должна получиться папка с двумя файлами: <code>main.py</code> и <code>requirements.txt</code>.</p>
512
 
513
  <h2 data-i18n="guideH2">Шаг 1. Установите Python</h2>
514
  <p data-i18n="guideP2">Скачайте Python 3.10+ с официального сайта <code>python.org</code> и установите. При установке на Windows обязательно отметьте галочку <b>«Add Python to PATH»</b>.</p>
@@ -517,7 +436,7 @@
517
  pip --version</code></pre>
518
 
519
  <h2 data-i18n="guideH3">Шаг 2. Откройте папку с сервером</h2>
520
- <p data-i18n="guideP4">В терминале перейдите в папку, куда вы скачали <code>main.py</code> и <code>requirements.txt</code>:</p>
521
  <pre><code>cd путь/к/папке/сервера</code></pre>
522
 
523
  <h2 data-i18n="guideH4">Шаг 3. Создайте виртуальное окружение</h2>
@@ -577,33 +496,23 @@ pip --version</code></pre>
577
  const translations = {
578
  ru: {
579
  subtitle: 'Список доступных серверов',
580
- intro: 'Каждому серверу выделено <b>512 MB RAM</b>. Статус обновляется автоматически.',
581
- refresh: 'Проверить',
582
  ram512: '512 MB RAM',
583
  ram100: '100 MB RAM',
584
- checking: 'Проверка',
585
- online: 'Онлайн',
586
- offline: 'Оффлайн',
587
- cfError: 'Cloudflare: 526',
588
- hostError: 'Ошибка хостинга ',
589
- titleOnline: 'Сервер доступен',
590
- titleOffline: 'Сервер недоступен',
591
- titleCfError: 'Cloudflare не может подключиться к хостингу (хостинг лежит)',
592
- titleHostError: 'Хостинг вернул ошибку сервера',
593
  btn: 'EN',
594
  contactText: 'Чтобы ваш сервер попал в этот список — напишите мне на почту',
595
  guideBtn: 'Гайд по сетапу',
596
  guideTitle: 'Гайд: как поднять свой сервер',
597
  guideH0: 'Шаг 0. Скачайте файлы сервера',
598
- guideP0: 'Скачайте готовые файлы сервера из репозитория и положите их в отдельную папку:',
599
  downloadMain: '⬇ Скачать main.py',
600
  downloadReq: '⬇ Скачать requirements.txt',
601
- guideP0b: 'После скачивания у вас должна получиться папка с двумя файлами: <code>main.py</code> и <code>requirements.txt</code>.',
602
  guideH2: 'Шаг 1. Установите Python',
603
  guideP2: 'Скачайте Python 3.10+ с официального сайта <code>python.org</code> и установите. При установке на Windows обязательно отметьте галочку <b>«Add Python to PATH»</b>.',
604
  guideP3: 'Проверьте установку в терминале:',
605
  guideH3: 'Шаг 2. Откройте папку с сервером',
606
- guideP4: 'В терминале перейдите в папку, куда вы скачали <code>main.py</code> и <code>requirements.txt</code>:',
607
  guideH4: 'Шаг 3. Создайте виртуальное окружение',
608
  guideP5: 'Это изолирует зависимости проекта от системных:',
609
  guideP6: 'Активируйте его:',
@@ -625,33 +534,23 @@ pip --version</code></pre>
625
  },
626
  en: {
627
  subtitle: 'List of available servers',
628
- intro: 'Each server is allocated <b>512 MB RAM</b>. Status updates automatically.',
629
- refresh: 'Check',
630
  ram512: '512 MB RAM',
631
  ram100: '100 MB RAM',
632
- checking: 'Checking',
633
- online: 'Online',
634
- offline: 'Offline',
635
- cfError: 'Cloudflare: 526',
636
- hostError: 'Host Error ',
637
- titleOnline: 'Server is available',
638
- titleOffline: 'Server is unavailable',
639
- titleCfError: 'Cloudflare cannot reach the host (host is down)',
640
- titleHostError: 'Host returned a server error',
641
  btn: 'RU',
642
  contactText: 'To get your server into this list — email me at',
643
  guideBtn: 'Setup Guide',
644
  guideTitle: 'Guide: how to run your own server',
645
  guideH0: 'Step 0. Download the server files',
646
- guideP0: 'Download the ready-made server files from the repository into a separate folder:',
647
  downloadMain: '⬇ Download main.py',
648
  downloadReq: '⬇ Download requirements.txt',
649
- guideP0b: 'After downloading, you should have a folder with two files: <code>main.py</code> and <code>requirements.txt</code>.',
650
  guideH2: 'Step 1. Install Python',
651
  guideP2: 'Download Python 3.10+ from <code>python.org</code> and install it. On Windows, be sure to check <b>“Add Python to PATH”</b>.',
652
  guideP3: 'Verify the installation in the terminal:',
653
  guideH3: 'Step 2. Open the server folder',
654
- guideP4: 'In the terminal, go to the folder where you downloaded <code>main.py</code> and <code>requirements.txt</code>:',
655
  guideH4: 'Step 3. Create a virtual environment',
656
  guideP5: 'This isolates the project dependencies from the system ones:',
657
  guideP6: 'Activate it:',
@@ -685,25 +584,6 @@ pip --version</code></pre>
685
  }
686
  });
687
 
688
- document.querySelectorAll('.status').forEach(el => {
689
- const state = el.dataset.state;
690
- if (!state) return;
691
- if (state === 'online') el.textContent = t.online;
692
- else if (state === 'offline') el.textContent = t.offline;
693
- else if (state === 'checking') el.textContent = t.checking;
694
- else if (state === 'cf-error') el.textContent = t.cfError;
695
- else if (state === 'host-error') el.textContent = t.hostError + (el.dataset.code || '');
696
- });
697
-
698
- document.querySelectorAll('.status').forEach(el => {
699
- const state = el.dataset.state;
700
- if (!state) return;
701
- if (state === 'online') el.title = t.titleOnline;
702
- else if (state === 'offline') el.title = t.titleOffline;
703
- else if (state === 'cf-error') el.title = t.titleCfError;
704
- else if (state === 'host-error') el.title = t.titleHostError;
705
- });
706
-
707
  document.getElementById('langBtn').textContent = t.btn;
708
  document.documentElement.lang = currentLang;
709
  }
@@ -729,86 +609,7 @@ pip --version</code></pre>
729
  if (e.key === 'Escape') closeGuide();
730
  });
731
 
732
- async function checkServer(url) {
733
- const controller = new AbortController();
734
- const timeoutId = setTimeout(() => controller.abort(), 8000);
735
-
736
- try {
737
- const response = await fetch(url, {
738
- method: 'GET',
739
- mode: 'cors',
740
- cache: 'no-store',
741
- signal: controller.signal
742
- });
743
- clearTimeout(timeoutId);
744
-
745
- if (response.status === 526) {
746
- return { state: 'cf-error', code: '' };
747
- }
748
- if (response.status >= 500) {
749
- return { state: 'host-error', code: String(response.status) };
750
- }
751
- return { state: 'online', code: '' };
752
- } catch (err) {
753
- clearTimeout(timeoutId);
754
-
755
- try {
756
- const controller2 = new AbortController();
757
- const timeoutId2 = setTimeout(() => controller2.abort(), 8000);
758
-
759
- await fetch(url, {
760
- method: 'GET',
761
- mode: 'no-cors',
762
- cache: 'no-store',
763
- signal: controller2.signal
764
- });
765
- clearTimeout(timeoutId2);
766
- return { state: 'online', code: '' };
767
- } catch (err2) {
768
- return { state: 'offline', code: '' };
769
- }
770
- }
771
- }
772
-
773
- async function updateStatus(el) {
774
- const url = el.dataset.url;
775
- const t = translations[currentLang];
776
-
777
- el.className = 'status checking';
778
- el.dataset.state = 'checking';
779
- el.textContent = t.checking;
780
-
781
- const [result] = await Promise.all([
782
- checkServer(url),
783
- new Promise(r => setTimeout(r, 300))
784
- ]);
785
-
786
- el.className = 'status ' + result.state;
787
- el.dataset.state = result.state;
788
- el.dataset.code = result.code || '';
789
-
790
- if (result.state === 'online') {
791
- el.textContent = t.online;
792
- el.title = t.titleOnline;
793
- } else if (result.state === 'offline') {
794
- el.textContent = t.offline;
795
- el.title = t.titleOffline;
796
- } else if (result.state === 'cf-error') {
797
- el.textContent = t.cfError;
798
- el.title = t.titleCfError;
799
- } else if (result.state === 'host-error') {
800
- el.textContent = t.hostError + result.code;
801
- el.title = t.titleHostError;
802
- }
803
- }
804
-
805
- function checkAll() {
806
- document.querySelectorAll('.status').forEach(el => {
807
- updateStatus(el);
808
- });
809
- }
810
-
811
- window.addEventListener('DOMContentLoaded', checkAll);
812
  </script>
813
 
814
  </body>
 
93
  margin-bottom: 20px;
94
  font-size: 13px;
95
  color: #444;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  }
97
  table {
98
  width: 100%;
 
129
  font-weight: bold;
130
  margin-left: 8px;
131
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  .url {
133
  display: block;
134
  color: #888;
 
365
 
366
  <div class="content">
367
  <div class="intro">
368
+ <span data-i18n="intro">Каждому серверу выделено <b>512 MB RAM</b>. Список обновляется вручную.</span>
 
369
  </div>
370
 
371
  <table>
 
373
  <td>
374
  <a href="https://sldchat.fastapicloud.dev/" target="_blank">SLD Chat — FastAPI Cloud</a>
375
  <span class="ram" data-i18n="ram512">512 MB RAM</span>
 
376
  <span class="url">https://sldchat.fastapicloud.dev/</span>
377
  </td>
378
  </tr>
 
380
  <td>
381
  <a href="https://sldchat.onrunxbuild.com/" target="_blank">SLD Chat — OnRunX Build</a>
382
  <span class="ram" data-i18n="ram512">512 MB RAM</span>
 
383
  <span class="url">https://sldchat.onrunxbuild.com/</span>
384
  </td>
385
  </tr>
 
387
  <td>
388
  <a href="https://sldshrs-backery.fastapicloud.dev/" target="_blank">SLD Shrs Backery — FastAPI Cloud</a>
389
  <span class="ram" data-i18n="ram512">512 MB RAM</span>
 
390
  <span class="url">https://sldshrs-backery.fastapicloud.dev/</span>
391
  </td>
392
  </tr>
 
394
  <td>
395
  <a href="https://e1l0e97mjeyu.ramnaymcloud.com/" target="_blank">SLD Chat — Ramnaym Cloud</a>
396
  <span class="ram" data-i18n="ram100">100 MB RAM</span>
 
397
  <span class="url">https://e1l0e97mjeyu.ramnaymcloud.com/</span>
398
  </td>
399
  </tr>
 
422
  <div class="modal-body" id="guideBody">
423
 
424
  <h2 data-i18n="guideH0">Шаг 0. Скачайте файлы сервера</h2>
425
+ <p data-i18n="guideP0">Скачайте готовые файлы сервера и положите их в отдельную папку:</p>
426
  <div class="download-box">
427
+ <a href="https://huggingface.co/spaces/sldshr/SDM/raw/main/main.py" target="_blank" rel="noopener" data-i18n="downloadMain">⬇ Скачать main.py</a>
428
+ <a href="https://huggingface.co/spaces/sldshr/SDM/raw/main/requirements.txt" target="_blank" rel="noopener" data-i18n="downloadReq">⬇ Скачать requirements.txt</a>
429
  </div>
430
+ <p data-i18n="guideP0b">На открывшейся странице нажмите <b>Ctrl+S</b> (или <b>Cmd+S</b> на macOS), чтобы сохранить файл. Так вы получите папку с двумя файлами: <code>main.py</code> и <code>requirements.txt</code>.</p>
431
 
432
  <h2 data-i18n="guideH2">Шаг 1. Установите Python</h2>
433
  <p data-i18n="guideP2">Скачайте Python 3.10+ с официального сайта <code>python.org</code> и установите. При установке на Windows обязательно отметьте галочку <b>«Add Python to PATH»</b>.</p>
 
436
  pip --version</code></pre>
437
 
438
  <h2 data-i18n="guideH3">Шаг 2. Откройте папку с сервером</h2>
439
+ <p data-i18n="guideP4">В терминале перейдите в папку, куда вы сохранили <code>main.py</code> и <code>requirements.txt</code>:</p>
440
  <pre><code>cd путь/к/папке/сервера</code></pre>
441
 
442
  <h2 data-i18n="guideH4">Шаг 3. Создайте виртуальное окружение</h2>
 
496
  const translations = {
497
  ru: {
498
  subtitle: 'Список доступных серверов',
499
+ intro: 'Каждому серверу выделено <b>512 MB RAM</b>. Список обновляется вручную.',
 
500
  ram512: '512 MB RAM',
501
  ram100: '100 MB RAM',
 
 
 
 
 
 
 
 
 
502
  btn: 'EN',
503
  contactText: 'Чтобы ваш сервер попал в этот список — напишите мне на почту',
504
  guideBtn: 'Гайд по сетапу',
505
  guideTitle: 'Гайд: как поднять свой сервер',
506
  guideH0: 'Шаг 0. Скачайте файлы сервера',
507
+ guideP0: 'Скачайте готовые файлы сервера и положите их в отдельную папку:',
508
  downloadMain: '⬇ Скачать main.py',
509
  downloadReq: '⬇ Скачать requirements.txt',
510
+ guideP0b: 'На открывшейся странице нажмите <b>Ctrl+S</b> (или <b>Cmd+S</b> на macOS), чтобы сохранить файл. Так вы получите папку с двумя файлами: <code>main.py</code> и <code>requirements.txt</code>.',
511
  guideH2: 'Шаг 1. Установите Python',
512
  guideP2: 'Скачайте Python 3.10+ с официального сайта <code>python.org</code> и установите. При установке на Windows обязательно отметьте галочку <b>«Add Python to PATH»</b>.',
513
  guideP3: 'Проверьте установку в терминале:',
514
  guideH3: 'Шаг 2. Откройте папку с сервером',
515
+ guideP4: 'В терминале перейдите в папку, куда вы сохранили <code>main.py</code> и <code>requirements.txt</code>:',
516
  guideH4: 'Шаг 3. Создайте виртуальное окружение',
517
  guideP5: 'Это изолирует зависимости проекта от системных:',
518
  guideP6: 'Активируйте его:',
 
534
  },
535
  en: {
536
  subtitle: 'List of available servers',
537
+ intro: 'Each server is allocated <b>512 MB RAM</b>. The list is updated manually.',
 
538
  ram512: '512 MB RAM',
539
  ram100: '100 MB RAM',
 
 
 
 
 
 
 
 
 
540
  btn: 'RU',
541
  contactText: 'To get your server into this list — email me at',
542
  guideBtn: 'Setup Guide',
543
  guideTitle: 'Guide: how to run your own server',
544
  guideH0: 'Step 0. Download the server files',
545
+ guideP0: 'Download the ready-made server files into a separate folder:',
546
  downloadMain: '⬇ Download main.py',
547
  downloadReq: '⬇ Download requirements.txt',
548
+ guideP0b: 'On the page that opens, press <b>Ctrl+S</b> (or <b>Cmd+S</b> on macOS) to save the file. You will end up with a folder containing two files: <code>main.py</code> and <code>requirements.txt</code>.',
549
  guideH2: 'Step 1. Install Python',
550
  guideP2: 'Download Python 3.10+ from <code>python.org</code> and install it. On Windows, be sure to check <b>“Add Python to PATH”</b>.',
551
  guideP3: 'Verify the installation in the terminal:',
552
  guideH3: 'Step 2. Open the server folder',
553
+ guideP4: 'In the terminal, go to the folder where you saved <code>main.py</code> and <code>requirements.txt</code>:',
554
  guideH4: 'Step 3. Create a virtual environment',
555
  guideP5: 'This isolates the project dependencies from the system ones:',
556
  guideP6: 'Activate it:',
 
584
  }
585
  });
586
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
587
  document.getElementById('langBtn').textContent = t.btn;
588
  document.documentElement.lang = currentLang;
589
  }
 
609
  if (e.key === 'Escape') closeGuide();
610
  });
611
 
612
+ window.addEventListener('DOMContentLoaded', applyLang);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
613
  </script>
614
 
615
  </body>